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

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

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

_ZN5Botan10fmt_detail6do_fmtERNSt3__119basic_ostringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EE:
   20|  2.49k|inline void do_fmt(std::ostringstream& oss, std::string_view format) {
   21|  2.49k|   oss << format;
   22|  2.49k|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   53|  2.08k|std::string fmt(std::string_view format, const T&... args) {
   54|  2.08k|   std::ostringstream oss;
   55|  2.08k|   oss.imbue(std::locale::classic());
   56|  2.08k|   fmt_detail::do_fmt(oss, format, args...);
   57|  2.08k|   return oss.str();
   58|  2.08k|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   25|  2.08k|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|  2.08k|   size_t i = 0;
   27|       |
   28|  12.4k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 12.4k, False: 0]
  ------------------
   29|  12.4k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 2.08k, False: 10.4k]
  |  Branch (29:30): [True: 2.08k, False: 0]
  |  Branch (29:59): [True: 2.08k, False: 0]
  ------------------
   30|  2.08k|         oss << val;
   31|  2.08k|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  10.4k|      } else {
   33|  10.4k|         oss << format[i];
   34|  10.4k|      }
   35|       |
   36|  10.4k|      i += 1;
   37|  10.4k|   }
   38|  2.08k|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEjEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   53|     90|std::string fmt(std::string_view format, const T&... args) {
   54|     90|   std::ostringstream oss;
   55|     90|   oss.imbue(std::locale::classic());
   56|     90|   fmt_detail::do_fmt(oss, format, args...);
   57|     90|   return oss.str();
   58|     90|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJjEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   25|     90|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|     90|   size_t i = 0;
   27|       |
   28|     90|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 90, False: 0]
  ------------------
   29|     90|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 90, False: 0]
  |  Branch (29:30): [True: 90, False: 0]
  |  Branch (29:59): [True: 90, False: 0]
  ------------------
   30|     90|         oss << val;
   31|     90|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|     90|      } else {
   33|      0|         oss << format[i];
   34|      0|      }
   35|       |
   36|      0|      i += 1;
   37|      0|   }
   38|     90|}
_ZN5Botan10fmt_detail6do_fmtIjJEEEvRNSt3__119basic_ostringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    300|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    300|   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: 300, False: 390]
  |  Branch (29:30): [True: 300, False: 0]
  |  Branch (29:59): [True: 300, False: 0]
  ------------------
   30|    300|         oss << val;
   31|    300|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|    390|      } else {
   33|    390|         oss << format[i];
   34|    390|      }
   35|       |
   36|    390|      i += 1;
   37|    390|   }
   38|    300|}
_ZN5Botan3fmtIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEES7_NS1_17basic_string_viewIcS4_EEDpRKT_:
   53|    119|std::string fmt(std::string_view format, const T&... args) {
   54|    119|   std::ostringstream oss;
   55|    119|   oss.imbue(std::locale::classic());
   56|    119|   fmt_detail::do_fmt(oss, format, args...);
   57|    119|   return oss.str();
   58|    119|}
_ZN5Botan10fmt_detail6do_fmtINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_S7_EENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    119|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    119|   size_t i = 0;
   27|       |
   28|  2.61k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 2.61k, False: 0]
  ------------------
   29|  2.61k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 119, False: 2.49k]
  |  Branch (29:30): [True: 119, False: 0]
  |  Branch (29:59): [True: 119, False: 0]
  ------------------
   30|    119|         oss << val;
   31|    119|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  2.49k|      } else {
   33|  2.49k|         oss << format[i];
   34|  2.49k|      }
   35|       |
   36|  2.49k|      i += 1;
   37|  2.49k|   }
   38|    119|}
_ZN5Botan3fmtIJjjEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EEDpRKT_:
   53|    210|std::string fmt(std::string_view format, const T&... args) {
   54|    210|   std::ostringstream oss;
   55|    210|   oss.imbue(std::locale::classic());
   56|    210|   fmt_detail::do_fmt(oss, format, args...);
   57|    210|   return oss.str();
   58|    210|}
_ZN5Botan10fmt_detail6do_fmtIjJjEEEvRNSt3__119basic_ostringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    210|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    210|   size_t i = 0;
   27|       |
   28|  7.14k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 7.14k, False: 0]
  ------------------
   29|  7.14k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 210, False: 6.93k]
  |  Branch (29:30): [True: 210, False: 0]
  |  Branch (29:59): [True: 210, False: 0]
  ------------------
   30|    210|         oss << val;
   31|    210|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  6.93k|      } else {
   33|  6.93k|         oss << format[i];
   34|  6.93k|      }
   35|       |
   36|  6.93k|      i += 1;
   37|  6.93k|   }
   38|    210|}

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

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

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

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

_ZN5Botan11ASN1_ObjectC2Ev:
  117|   104k|      ASN1_Object() = default;
_ZN5Botan11ASN1_ObjectD2Ev:
  122|   363k|      virtual ~ASN1_Object() = default;
_ZNK5Botan10BER_Object6is_setEv:
  138|   396k|      bool is_set() const { return m_type_tag != ASN1_Type::NoObject; }
_ZNK5Botan10BER_Object7taggingEv:
  140|   213k|      uint32_t tagging() const { return type_tag() | class_tag(); }
_ZNK5Botan10BER_Object8type_tagEv:
  142|   213k|      ASN1_Type type_tag() const { return m_type_tag; }
_ZNK5Botan10BER_Object9class_tagEv:
  144|   213k|      ASN1_Class class_tag() const { return m_class_tag; }
_ZNK5Botan10BER_Object4typeEv:
  146|  97.5k|      ASN1_Type type() const { return m_type_tag; }
_ZNK5Botan10BER_Object9get_classEv:
  148|  49.0k|      ASN1_Class get_class() const { return m_class_tag; }
_ZNK5Botan10BER_Object4bitsEv:
  150|  1.92M|      const uint8_t* bits() const { return m_value.data(); }
_ZNK5Botan10BER_Object6lengthEv:
  152|  4.15M|      size_t length() const { return m_value.size(); }
_ZNK5Botan10BER_Object4dataEv:
  154|  76.0k|      std::span<const uint8_t> data() const { return std::span{m_value}; }
_ZN5Botan10BER_Object12mutable_bitsEm:
  171|   164k|      uint8_t* mutable_bits(size_t length) {
  172|   164k|         m_value.resize(length);
  173|   164k|         return m_value.data();
  174|   164k|      }
_ZNK5Botan3OID14get_componentsEv:
  321|   379k|      const std::vector<uint32_t>& get_components() const {
  322|   379k|         return m_id;
  323|   379k|      }
_ZNK5Botan11ASN1_String5valueEv:
  365|  45.2k|      const std::string& value() const { return m_utf8_str; }
_ZN5BotanorENS_10ASN1_ClassES0_:
   78|  65.5k|inline ASN1_Class operator|(ASN1_Class x, ASN1_Class y) {
   79|  65.5k|   return static_cast<ASN1_Class>(static_cast<uint32_t>(x) | static_cast<uint32_t>(y));
   80|  65.5k|}
_ZN5BotanorENS_9ASN1_TypeENS_10ASN1_ClassE:
   82|   213k|inline uint32_t operator|(ASN1_Type x, ASN1_Class y) {
   83|   213k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
   84|   213k|}
_ZN5BotanorENS_10ASN1_ClassENS_9ASN1_TypeE:
   86|  49.0k|inline uint32_t operator|(ASN1_Class x, ASN1_Type y) {
   87|  49.0k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
   88|  49.0k|}
_ZN5Botan10BER_ObjectC2Ev:
  130|   234k|      BER_Object() = default;
_ZN5Botan10BER_ObjectC2EOS0_:
  133|  64.5k|      BER_Object(BER_Object&& other) = default;
_ZN5Botan11ASN1_ObjectC2ERKS0_:
  118|  45.2k|      ASN1_Object(const ASN1_Object&) = default;
_ZN5Botan11ASN1_ObjectC2EOS0_:
  120|   213k|      ASN1_Object(ASN1_Object&&) = default;
_ZN5Botan11ASN1_ObjectaSEOS0_:
  121|  82.9k|      ASN1_Object& operator=(ASN1_Object&&) = default;
_ZN5Botan3OIDC2Ev:
  220|  49.1k|      explicit OID() = default;

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

_ZN5Botan11BER_Decoder6Limits3BEREm:
   42|  3.09k|            static Limits BER(size_t max_nested_indef = 16) { return Limits(true, max_nested_indef); }
_ZN5Botan11BER_Decoder6LimitsC2Ebm:
   54|  3.09k|                  m_allow_ber(allow_ber), m_max_nested_indef(max_nested_indef) {}
_ZNK5Botan11BER_Decoder6Limits18allow_ber_encodingEv:
   44|   333k|            bool allow_ber_encoding() const { return m_allow_ber; }
_ZNK5Botan11BER_Decoder6Limits20require_der_encodingEv:
   46|   167k|            bool require_der_encoding() const { return !allow_ber_encoding(); }
_ZNK5Botan11BER_Decoder6Limits28max_nested_indefinite_lengthEv:
   48|   165k|            size_t max_nested_indefinite_length() const { return m_max_nested_indef; }
_ZNK5Botan11BER_Decoder6limitsEv:
   98|  67.4k|      Limits limits() const { return m_limits; }
_ZN5Botan11BER_Decoder14start_sequenceEv:
  160|  53.8k|      BER_Decoder start_sequence() { return start_cons(ASN1_Type::Sequence, ASN1_Class::Universal); }
_ZN5Botan11BER_Decoder9start_setEv:
  162|  12.6k|      BER_Decoder start_set() { return start_cons(ASN1_Type::Set, ASN1_Class::Universal); }
_ZN5Botan11BER_Decoder9raw_bytesINSt3__19allocatorIhEEEERS0_RNS2_6vectorIhT_EE:
  203|  2.92k|      BER_Decoder& raw_bytes(std::vector<uint8_t, Alloc>& out) {
  204|  2.92k|         out.clear();
  205|  1.07M|         for(;;) {
  206|  1.07M|            if(auto next = this->read_next_byte()) {
  ------------------
  |  Branch (206:21): [True: 1.07M, False: 2.92k]
  ------------------
  207|  1.07M|               out.push_back(*next);
  208|  1.07M|            } else {
  209|  2.92k|               break;
  210|  2.92k|            }
  211|  1.07M|         }
  212|  2.92k|         return (*this);
  213|  2.92k|      }

_ZN5Botan10DataSourceC2Ev:
  100|  70.5k|      DataSource() = default;
_ZN5Botan10DataSourceD2Ev:
  101|  70.5k|      virtual ~DataSource() = default;
_ZN5Botan17DataSource_MemoryC2ENSt3__14spanIKhLm18446744073709551615EEE:
  141|  6.01k|      explicit DataSource_Memory(std::span<const uint8_t> in) : m_source(in.begin(), in.end()), m_offset(0) {}

_ZN5Botan11DER_Encoder10add_objectENS_9ASN1_TypeENS_10ASN1_ClassENSt3__14spanIKhLm18446744073709551615EEE:
  184|  45.2k|      DER_Encoder& add_object(ASN1_Type type_tag, ASN1_Class class_tag, std::span<const uint8_t> rep) {
  185|  45.2k|         return add_object(type_tag, class_tag, rep.data(), rep.size());
  186|  45.2k|      }
_ZN5Botan11DER_Encoder10add_objectENS_9ASN1_TypeENS_10ASN1_ClassERKNSt3__16vectorIhNS3_9allocatorIhEEEE:
  188|  45.2k|      DER_Encoder& add_object(ASN1_Type type_tag, ASN1_Class class_tag, const std::vector<uint8_t>& rep) {
  189|  45.2k|         return add_object(type_tag, class_tag, std::span{rep});
  190|  45.2k|      }

_ZN5Botan8copy_memIhQsr3stdE12is_trivial_vIu7__decayIT_EEEEvPS1_PKS1_m:
  144|  2.67M|inline constexpr void copy_mem(T* out, const T* in, size_t n) {
  145|  2.67M|   BOTAN_ASSERT_IMPLICATION(n > 0, in != nullptr && out != nullptr, "If n > 0 then args are not null");
  ------------------
  |  |  103|  2.67M|   do {                                                                                          \
  |  |  104|  2.67M|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                              \
  |  |  105|  5.27M|      if((expr1) && !(expr2)) {                                                                  \
  |  |  ------------------
  |  |  |  Branch (105:10): [True: 2.63M, False: 43.8k]
  |  |  |  Branch (105:23): [True: 2.63M, False: 0]
  |  |  |  Branch (105:23): [True: 2.63M, False: 0]
  |  |  ------------------
  |  |  106|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                                     \
  |  |  107|      0|         Botan::assertion_failure(#expr1 " implies " #expr2, msg, __func__, __FILE__, __LINE__); \
  |  |  108|      0|      }                                                                                          \
  |  |  109|  2.67M|   } while(0)
  |  |  ------------------
  |  |  |  Branch (109:12): [Folded, False: 2.67M]
  |  |  ------------------
  ------------------
  146|       |
  147|  2.67M|   if(in != nullptr && out != nullptr && n > 0) {
  ------------------
  |  Branch (147:7): [True: 2.67M, False: 157]
  |  Branch (147:24): [True: 2.63M, False: 39.8k]
  |  Branch (147:42): [True: 2.63M, False: 3.82k]
  ------------------
  148|  2.63M|      std::memmove(out, in, sizeof(T) * n);
  149|  2.63M|   }
  150|  2.67M|}
_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|   100k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|   100k|   ranges::assert_equal_byte_lengths(out, in);
  178|   100k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|   100k|}
_ZN5Botan19secure_scrub_memoryITkNS_6ranges23contiguous_output_rangeERNSt3__16vectorIhNS2_9allocatorIhEEEEEEvOT_:
   59|   299k|void secure_scrub_memory(ranges::contiguous_output_range auto&& data) {
   60|   299k|   secure_scrub_memory(std::ranges::data(data), ranges::size_bytes(data));
   61|   299k|}
_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|  29.3k|inline constexpr ToT typecast_copy(const FromR& src) {
  211|  29.3k|   ToT dst;  // NOLINT(*-member-init)
  212|  29.3k|   typecast_copy(dst, src);
  213|  29.3k|   return dst;
  214|  29.3k|}
_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|  29.3k|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|  29.3k|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|  29.3k|}
_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|  29.3k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|  29.3k|   ranges::assert_equal_byte_lengths(out, in);
  178|  29.3k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|  29.3k|}
_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|  3.72k|inline constexpr ToT typecast_copy(const FromR& src) {
  211|  3.72k|   ToT dst;  // NOLINT(*-member-init)
  212|  3.72k|   typecast_copy(dst, src);
  213|  3.72k|   return dst;
  214|  3.72k|}
_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|  3.72k|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|  3.72k|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|  3.72k|}
_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|  3.72k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|  3.72k|   ranges::assert_equal_byte_lengths(out, in);
  178|  3.72k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|  3.72k|}

_ZN5Botan7X509_DNC2Ev:
   48|  6.18k|      X509_DN() = default;
_ZNK5Botan7X509_DN16_canonical_bytesEv:
  152|  2.94k|      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|   201k|{
  101|   201k|   const std::span s0{r0};
  102|       |
  103|   201k|   if constexpr(statically_spanable_range<R0>) {
  104|   201k|      constexpr size_t expected_size = s0.size_bytes();
  105|   201k|      (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|   201k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__15arrayImLm1EEEEEvRKT0_:
   77|   201k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|   201k|   const std::span s{r};
   79|   201k|   if constexpr(statically_spanable_range<R>) {
   80|   201k|      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|   201k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__15arrayIhLm8EEEEEmRKT_:
   59|   100k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|   100k|   return std::span{r}.size_bytes();
   61|   100k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__16vectorIhNS2_9allocatorIhEEEEEEmRKT_:
   59|   299k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|   299k|   return std::span{r}.size_bytes();
   61|   299k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm2ETkNS0_14spanable_rangeENSt3__14spanIKhLm2EEEEEvRKT0_:
   77|  58.7k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  58.7k|   const std::span s{r};
   79|  58.7k|   if constexpr(statically_spanable_range<R>) {
   80|  58.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|  58.7k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanItLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm2EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  29.3k|{
  101|  29.3k|   const std::span s0{r0};
  102|       |
  103|  29.3k|   if constexpr(statically_spanable_range<R0>) {
  104|  29.3k|      constexpr size_t expected_size = s0.size_bytes();
  105|  29.3k|      (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|  29.3k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanItLm1EEEEEmRKT_:
   59|  29.3k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  29.3k|   return std::span{r}.size_bytes();
   61|  29.3k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm4ETkNS0_14spanable_rangeENSt3__14spanIKhLm4EEEEEvRKT0_:
   77|  7.45k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  7.45k|   const std::span s{r};
   79|  7.45k|   if constexpr(statically_spanable_range<R>) {
   80|  7.45k|      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|  7.45k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIjLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm4EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  3.72k|{
  101|  3.72k|   const std::span s0{r0};
  102|       |
  103|  3.72k|   if constexpr(statically_spanable_range<R0>) {
  104|  3.72k|      constexpr size_t expected_size = s0.size_bytes();
  105|  3.72k|      (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|  3.72k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIjLm1EEEEEmRKT_:
   59|  3.72k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  3.72k|   return std::span{r}.size_bytes();
   61|  3.72k|}

_ZN5Botan16secure_allocatorIhE10deallocateEPhm:
   54|  5.88k|      void deallocate(T* p, std::size_t n) { deallocate_memory(p, n, sizeof(T)); }
_ZN5Botan16secure_allocatorIhE8allocateEm:
   52|  5.88k|      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_:
  268|  29.3k|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  269|  29.3k|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  270|       |      // Noop, if the parameter type already is the desired return type.
  271|  29.3k|      return std::forward<ParamT>(t);
  272|       |   } else if constexpr(std::constructible_from<T, ParamT>) {
  273|       |      // Implicit conversion from the parameter type to the return type.
  274|       |      return T{std::forward<ParamT>(t)};
  275|       |   } else {
  276|       |      // Explicitly calling the wrapped type's constructor to support
  277|       |      // implicit conversions on types that mark their constructors as explicit.
  278|       |      static_assert(concepts::strong_type<T> && std::constructible_from<typename T::wrapped_type, ParamT>);
  279|       |      return T{typename T::wrapped_type{std::forward<ParamT>(t)}};
  280|       |   }
  281|  29.3k|}
_ZN5Botan16wrap_strong_typeIjRjQoosr3stdE18constructible_fromIT_T0_Eaasr8conceptsE11strong_typeIS2_Esr3stdE18constructible_fromINS2_12wrapped_typeES3_EEEDcOS3_:
  268|  3.72k|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  269|  3.72k|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  270|       |      // Noop, if the parameter type already is the desired return type.
  271|  3.72k|      return std::forward<ParamT>(t);
  272|       |   } else if constexpr(std::constructible_from<T, ParamT>) {
  273|       |      // Implicit conversion from the parameter type to the return type.
  274|       |      return T{std::forward<ParamT>(t)};
  275|       |   } else {
  276|       |      // Explicitly calling the wrapped type's constructor to support
  277|       |      // implicit conversions on types that mark their constructors as explicit.
  278|       |      static_assert(concepts::strong_type<T> && std::constructible_from<typename T::wrapped_type, ParamT>);
  279|       |      return T{typename T::wrapped_type{std::forward<ParamT>(t)}};
  280|       |   }
  281|  3.72k|}

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

_Z4fuzzNSt3__14spanIKhLm18446744073709551615EEE:
   12|  3.09k|void fuzz(std::span<const uint8_t> in) {
   13|  3.09k|   Botan::X509_DN dn1;
   14|  3.09k|   Botan::X509_DN dn2;
   15|       |
   16|  3.09k|   try {
   17|  3.09k|      Botan::BER_Decoder ber(in);
   18|  3.09k|      dn1.decode_from(ber);
   19|  3.09k|      dn2.decode_from(ber);
   20|  3.09k|   } catch(...) {
   21|  2.60k|      return;
   22|  2.60k|   }
   23|       |
   24|    491|   const bool eq = dn1 == dn2;
   25|    491|   const bool lt1 = dn1 < dn2;
   26|    491|   const bool lt2 = dn2 < dn1;
   27|       |
   28|    491|   if(lt1 == false && lt2 == false) {
  ------------------
  |  Branch (28:7): [True: 270, False: 221]
  |  Branch (28:23): [True: 40, False: 230]
  ------------------
   29|     40|      FUZZER_ASSERT_TRUE(eq);
  ------------------
  |  |   89|     40|   do {                                                               \
  |  |   90|     40|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|     40|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 40]
  |  |  ------------------
  |  |   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|     40|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 40]
  |  |  ------------------
  ------------------
   30|    451|   } else {
   31|       |      // one is less than the other
   32|    451|      FUZZER_ASSERT_TRUE(lt1 || lt2);
  ------------------
  |  |   89|    451|   do {                                                               \
  |  |   90|    451|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    681|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:12): [True: 221, False: 230]
  |  |  |  Branch (91:12): [True: 230, 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|    451|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 451]
  |  |  ------------------
  ------------------
   33|       |
   34|       |      // it is not the case that both are less than the other
   35|    451|      FUZZER_ASSERT_TRUE(!lt1 || !lt2);
  ------------------
  |  |   89|    451|   do {                                                               \
  |  |   90|    451|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    672|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:12): [True: 230, False: 221]
  |  |  |  Branch (91:12): [True: 221, 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|    451|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 451]
  |  |  ------------------
  ------------------
   36|    451|   }
   37|    491|}

_ZNK5Botan11ASN1_Object10BER_encodeEv:
   20|  45.2k|std::vector<uint8_t> ASN1_Object::BER_encode() const {
   21|  45.2k|   std::vector<uint8_t> output;
   22|  45.2k|   DER_Encoder der(output);
   23|  45.2k|   this->encode_into(der);
   24|  45.2k|   return output;
   25|  45.2k|}
_ZN5Botan10BER_ObjectD2Ev:
   27|   299k|BER_Object::~BER_Object() {
   28|   299k|   secure_scrub_memory(m_value);
   29|   299k|}
_ZNK5Botan10BER_Object11assert_is_aENS_9ASN1_TypeENS_10ASN1_ClassENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   34|  65.5k|void BER_Object::assert_is_a(ASN1_Type expected_type_tag, ASN1_Class expected_class_tag, std::string_view descr) const {
   35|  65.5k|   if(!this->is_a(expected_type_tag, expected_class_tag)) {
  ------------------
  |  Branch (35:7): [True: 968, False: 64.5k]
  ------------------
   36|    968|      std::stringstream msg;
   37|       |
   38|    968|      msg << "Tag mismatch when decoding " << descr << " got ";
   39|       |
   40|    968|      if(m_class_tag == ASN1_Class::NoObject && m_type_tag == ASN1_Type::NoObject) {
  ------------------
  |  Branch (40:10): [True: 690, False: 278]
  |  Branch (40:49): [True: 690, False: 0]
  ------------------
   41|    690|         msg << "EOF";
   42|    690|      } else {
   43|    278|         if(m_class_tag == ASN1_Class::Universal || m_class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (43:13): [True: 97, False: 181]
  |  Branch (43:53): [True: 119, False: 62]
  ------------------
   44|    216|            msg << asn1_tag_to_string(m_type_tag);
   45|    216|         } else {
   46|     62|            msg << std::to_string(static_cast<uint32_t>(m_type_tag));
   47|     62|         }
   48|       |
   49|    278|         msg << "/" << asn1_class_to_string(m_class_tag);
   50|    278|      }
   51|       |
   52|    968|      msg << " expected ";
   53|       |
   54|    968|      if(expected_class_tag == ASN1_Class::Universal || expected_class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (54:10): [True: 0, False: 968]
  |  Branch (54:57): [True: 968, False: 0]
  ------------------
   55|    968|         msg << asn1_tag_to_string(expected_type_tag);
   56|    968|      } else {
   57|      0|         msg << std::to_string(static_cast<uint32_t>(expected_type_tag));
   58|      0|      }
   59|       |
   60|    968|      msg << "/" << asn1_class_to_string(expected_class_tag);
   61|       |
   62|    968|      throw BER_Decoding_Error(msg.str());
   63|    968|   }
   64|  65.5k|}
_ZNK5Botan10BER_Object4is_aENS_9ASN1_TypeENS_10ASN1_ClassE:
   66|  65.5k|bool BER_Object::is_a(ASN1_Type expected_type_tag, ASN1_Class expected_class_tag) const {
   67|  65.5k|   return (m_type_tag == expected_type_tag && m_class_tag == expected_class_tag);
  ------------------
  |  Branch (67:12): [True: 64.5k, False: 960]
  |  Branch (67:47): [True: 64.5k, False: 8]
  ------------------
   68|  65.5k|}
_ZN5Botan10BER_Object11set_taggingENS_9ASN1_TypeENS_10ASN1_ClassE:
   74|   166k|void BER_Object::set_tagging(ASN1_Type type_tag, ASN1_Class class_tag) {
   75|   166k|   m_type_tag = type_tag;
   76|   166k|   m_class_tag = class_tag;
   77|   166k|}
_ZN5Botan20asn1_class_to_stringENS_10ASN1_ClassE:
   79|  1.24k|std::string asn1_class_to_string(ASN1_Class type) {
   80|  1.24k|   switch(type) {
   81|     97|      case ASN1_Class::Universal:
  ------------------
  |  Branch (81:7): [True: 97, False: 1.14k]
  ------------------
   82|     97|         return "UNIVERSAL";
   83|  1.08k|      case ASN1_Class::Constructed:
  ------------------
  |  Branch (83:7): [True: 1.08k, False: 159]
  ------------------
   84|  1.08k|         return "CONSTRUCTED";
   85|     13|      case ASN1_Class::ContextSpecific:
  ------------------
  |  Branch (85:7): [True: 13, False: 1.23k]
  ------------------
   86|     13|         return "CONTEXT_SPECIFIC";
   87|      4|      case ASN1_Class::Application:
  ------------------
  |  Branch (87:7): [True: 4, False: 1.24k]
  ------------------
   88|      4|         return "APPLICATION";
   89|     11|      case ASN1_Class::Private:
  ------------------
  |  Branch (89:7): [True: 11, False: 1.23k]
  ------------------
   90|     11|         return "PRIVATE";
   91|      0|      case ASN1_Class::NoObject:
  ------------------
  |  Branch (91:7): [True: 0, False: 1.24k]
  ------------------
   92|      0|         return "NO_OBJECT";
   93|     34|      default:
  ------------------
  |  Branch (93:7): [True: 34, False: 1.21k]
  ------------------
   94|     34|         return "CLASS(" + std::to_string(static_cast<size_t>(type)) + ")";
   95|  1.24k|   }
   96|  1.24k|}
_ZN5Botan18asn1_tag_to_stringENS_9ASN1_TypeE:
   98|  1.30k|std::string asn1_tag_to_string(ASN1_Type type) {
   99|  1.30k|   switch(type) {
  100|    943|      case ASN1_Type::Sequence:
  ------------------
  |  Branch (100:7): [True: 943, False: 360]
  ------------------
  101|    943|         return "SEQUENCE";
  102|       |
  103|     36|      case ASN1_Type::Set:
  ------------------
  |  Branch (103:7): [True: 36, False: 1.26k]
  ------------------
  104|     36|         return "SET";
  105|       |
  106|     14|      case ASN1_Type::PrintableString:
  ------------------
  |  Branch (106:7): [True: 14, False: 1.28k]
  ------------------
  107|     14|         return "PRINTABLE STRING";
  108|       |
  109|     12|      case ASN1_Type::NumericString:
  ------------------
  |  Branch (109:7): [True: 12, False: 1.29k]
  ------------------
  110|     12|         return "NUMERIC STRING";
  111|       |
  112|     12|      case ASN1_Type::Ia5String:
  ------------------
  |  Branch (112:7): [True: 12, False: 1.29k]
  ------------------
  113|     12|         return "IA5 STRING";
  114|       |
  115|      7|      case ASN1_Type::TeletexString:
  ------------------
  |  Branch (115:7): [True: 7, False: 1.29k]
  ------------------
  116|      7|         return "T61 STRING";
  117|       |
  118|     91|      case ASN1_Type::Utf8String:
  ------------------
  |  Branch (118:7): [True: 91, False: 1.21k]
  ------------------
  119|     91|         return "UTF8 STRING";
  120|       |
  121|     14|      case ASN1_Type::VisibleString:
  ------------------
  |  Branch (121:7): [True: 14, False: 1.28k]
  ------------------
  122|     14|         return "VISIBLE STRING";
  123|       |
  124|      2|      case ASN1_Type::BmpString:
  ------------------
  |  Branch (124:7): [True: 2, False: 1.30k]
  ------------------
  125|      2|         return "BMP STRING";
  126|       |
  127|      4|      case ASN1_Type::UniversalString:
  ------------------
  |  Branch (127:7): [True: 4, False: 1.29k]
  ------------------
  128|      4|         return "UNIVERSAL STRING";
  129|       |
  130|      1|      case ASN1_Type::UtcTime:
  ------------------
  |  Branch (130:7): [True: 1, False: 1.30k]
  ------------------
  131|      1|         return "UTC TIME";
  132|       |
  133|      3|      case ASN1_Type::GeneralizedTime:
  ------------------
  |  Branch (133:7): [True: 3, False: 1.30k]
  ------------------
  134|      3|         return "GENERALIZED TIME";
  135|       |
  136|      4|      case ASN1_Type::OctetString:
  ------------------
  |  Branch (136:7): [True: 4, False: 1.29k]
  ------------------
  137|      4|         return "OCTET STRING";
  138|       |
  139|      2|      case ASN1_Type::BitString:
  ------------------
  |  Branch (139:7): [True: 2, False: 1.30k]
  ------------------
  140|      2|         return "BIT STRING";
  141|       |
  142|      1|      case ASN1_Type::Enumerated:
  ------------------
  |  Branch (142:7): [True: 1, False: 1.30k]
  ------------------
  143|      1|         return "ENUMERATED";
  144|       |
  145|      2|      case ASN1_Type::Integer:
  ------------------
  |  Branch (145:7): [True: 2, False: 1.30k]
  ------------------
  146|      2|         return "INTEGER";
  147|       |
  148|      1|      case ASN1_Type::Null:
  ------------------
  |  Branch (148:7): [True: 1, False: 1.30k]
  ------------------
  149|      1|         return "NULL";
  150|       |
  151|     20|      case ASN1_Type::ObjectId:
  ------------------
  |  Branch (151:7): [True: 20, False: 1.28k]
  ------------------
  152|     20|         return "OBJECT";
  153|       |
  154|     12|      case ASN1_Type::Boolean:
  ------------------
  |  Branch (154:7): [True: 12, False: 1.29k]
  ------------------
  155|     12|         return "BOOLEAN";
  156|       |
  157|      0|      case ASN1_Type::NoObject:
  ------------------
  |  Branch (157:7): [True: 0, False: 1.30k]
  ------------------
  158|      0|         return "NO_OBJECT";
  159|       |
  160|    122|      default:
  ------------------
  |  Branch (160:7): [True: 122, False: 1.18k]
  ------------------
  161|    122|         return "TAG(" + std::to_string(static_cast<uint32_t>(type)) + ")";
  162|  1.30k|   }
  163|  1.30k|}
_ZN5Botan18BER_Decoding_ErrorC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  168|  2.08k|BER_Decoding_Error::BER_Decoding_Error(std::string_view err) : Decoding_Error(fmt("BER: {}", err)) {}
_ZN5Botan11BER_Bad_TagC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEj:
  170|     90|BER_Bad_Tag::BER_Bad_Tag(std::string_view str, uint32_t tagging) : BER_Decoding_Error(fmt("{}: {}", str, tagging)) {}
_ZN5Botan4ASN19to_stringERKNS_10BER_ObjectE:
  190|  27.1k|std::string to_string(const BER_Object& obj) {
  191|  27.1k|   return bytes_to_string(obj.data());
  192|  27.1k|}

_ZN5BotanltERKNS_3OIDES2_:
  171|   189k|bool operator<(const OID& a, const OID& b) {
  172|   189k|   const std::vector<uint32_t>& oid1 = a.get_components();
  173|   189k|   const std::vector<uint32_t>& oid2 = b.get_components();
  174|       |
  175|   189k|   return std::lexicographical_compare(oid1.begin(), oid1.end(), oid2.begin(), oid2.end());
  176|   189k|}
_ZNK5Botan3OID11encode_intoERNS_11DER_EncoderE:
  181|  45.2k|void OID::encode_into(DER_Encoder& der) const {
  182|  45.2k|   if(m_id.size() < 2) {
  ------------------
  |  Branch (182:7): [True: 0, False: 45.2k]
  ------------------
  183|      0|      throw Invalid_Argument("OID::encode_into: OID is invalid");
  184|      0|   }
  185|       |
  186|  45.2k|   auto append = [](std::vector<uint8_t>& encoding, uint32_t z) {
  187|  45.2k|      if(z <= 0x7F) {
  188|  45.2k|         encoding.push_back(static_cast<uint8_t>(z));
  189|  45.2k|      } else {
  190|  45.2k|         const size_t z7 = (high_bit(z) + 7 - 1) / 7;
  191|       |
  192|  45.2k|         for(size_t j = 0; j != z7; ++j) {
  193|  45.2k|            uint8_t zp = static_cast<uint8_t>(z >> (7 * (z7 - j - 1)) & 0x7F);
  194|       |
  195|  45.2k|            if(j != z7 - 1) {
  196|  45.2k|               zp |= 0x80;
  197|  45.2k|            }
  198|       |
  199|  45.2k|            encoding.push_back(zp);
  200|  45.2k|         }
  201|  45.2k|      }
  202|  45.2k|   };
  203|       |
  204|  45.2k|   std::vector<uint8_t> encoding;
  205|       |
  206|       |   // We know 40 * root can't overflow because root is between 0 and 2
  207|  45.2k|   auto first = checked_add(40 * m_id[0], m_id[1]);
  208|  45.2k|   BOTAN_ASSERT_NOMSG(first.has_value());
  ------------------
  |  |   77|  45.2k|   do {                                                                     \
  |  |   78|  45.2k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  45.2k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 45.2k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  45.2k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 45.2k]
  |  |  ------------------
  ------------------
  209|       |
  210|  45.2k|   append(encoding, *first);
  211|       |
  212|   104k|   for(size_t i = 2; i != m_id.size(); ++i) {
  ------------------
  |  Branch (212:22): [True: 58.7k, False: 45.2k]
  ------------------
  213|  58.7k|      append(encoding, m_id[i]);
  214|  58.7k|   }
  215|  45.2k|   der.add_object(ASN1_Type::ObjectId, ASN1_Class::Universal, encoding);
  216|  45.2k|}
_ZN5Botan3OID11decode_fromERNS_11BER_DecoderE:
  221|  49.0k|void OID::decode_from(BER_Decoder& decoder) {
  222|  49.0k|   const BER_Object obj = decoder.get_next_object();
  223|  49.0k|   if(obj.tagging() != (ASN1_Class::Universal | ASN1_Type::ObjectId)) {
  ------------------
  |  Branch (223:7): [True: 90, False: 48.9k]
  ------------------
  224|     90|      throw BER_Bad_Tag("Error decoding OID, unknown tag", obj.tagging());
  225|     90|   }
  226|       |
  227|  48.9k|   if(obj.length() == 0) {
  ------------------
  |  Branch (227:7): [True: 2, False: 48.9k]
  ------------------
  228|      2|      throw BER_Decoding_Error("OID encoding is too short");
  229|      2|   }
  230|       |
  231|  48.9k|   auto consume = [](BufferSlicer& data) -> uint32_t {
  232|  48.9k|      BOTAN_ASSERT_NOMSG(!data.empty());
  233|  48.9k|      uint32_t b = data.take_byte();
  234|       |
  235|  48.9k|      if(b > 0x7F) {
  236|  48.9k|         b &= 0x7F;
  237|       |
  238|       |         // Even BER requires that the OID have minimal length, ie that
  239|       |         // the first byte of a multibyte encoding cannot be zero
  240|       |         // See X.690 section 8.19.2
  241|  48.9k|         if(b == 0) {
  242|  48.9k|            throw Decoding_Error("Leading zero byte in multibyte OID encoding");
  243|  48.9k|         }
  244|       |
  245|  48.9k|         while(true) {
  246|  48.9k|            if(data.empty()) {
  247|  48.9k|               throw Decoding_Error("Truncated OID value");
  248|  48.9k|            }
  249|       |
  250|  48.9k|            const uint8_t next = data.take_byte();
  251|  48.9k|            const bool more = (next & 0x80) == 0x80;
  252|  48.9k|            const uint8_t value = next & 0x7F;
  253|       |
  254|  48.9k|            if((b >> (32 - 7)) != 0) {
  255|  48.9k|               throw Decoding_Error("OID component overflow");
  256|  48.9k|            }
  257|       |
  258|  48.9k|            b = (b << 7) | value;
  259|       |
  260|  48.9k|            if(!more) {
  261|  48.9k|               break;
  262|  48.9k|            }
  263|  48.9k|         }
  264|  48.9k|      }
  265|       |
  266|  48.9k|      return b;
  267|  48.9k|   };
  268|       |
  269|  48.9k|   BufferSlicer data(obj.data());
  270|  48.9k|   std::vector<uint32_t> parts;
  271|   178k|   while(!data.empty()) {
  ------------------
  |  Branch (271:10): [True: 129k, False: 48.9k]
  ------------------
  272|   129k|      const uint32_t comp = consume(data);
  273|       |
  274|   129k|      if(parts.empty()) {
  ------------------
  |  Branch (274:10): [True: 48.8k, False: 80.5k]
  ------------------
  275|       |         // divide into root and second arc
  276|       |
  277|  48.8k|         const uint32_t root_arc = [](uint32_t b0) -> uint32_t {
  278|  48.8k|            if(b0 < 40) {
  279|  48.8k|               return 0;
  280|  48.8k|            } else if(b0 < 80) {
  281|  48.8k|               return 1;
  282|  48.8k|            } else {
  283|  48.8k|               return 2;
  284|  48.8k|            }
  285|  48.8k|         }(comp);
  286|       |
  287|  48.8k|         parts.push_back(root_arc);
  288|  48.8k|         BOTAN_ASSERT_NOMSG(comp >= 40 * root_arc);
  ------------------
  |  |   77|  48.8k|   do {                                                                     \
  |  |   78|  48.8k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  48.8k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 48.8k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  48.8k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 48.8k]
  |  |  ------------------
  ------------------
  289|  48.8k|         parts.push_back(comp - 40 * root_arc);
  290|  80.5k|      } else {
  291|  80.5k|         parts.push_back(comp);
  292|  80.5k|      }
  293|   129k|   }
  294|       |
  295|  48.9k|   m_id = parts;
  296|  48.9k|}
asn1_oid.cpp:_ZZNK5Botan3OID11encode_intoERNS_11DER_EncoderEENK3$_0clERNSt3__16vectorIhNS4_9allocatorIhEEEEj:
  186|   104k|   auto append = [](std::vector<uint8_t>& encoding, uint32_t z) {
  187|   104k|      if(z <= 0x7F) {
  ------------------
  |  Branch (187:10): [True: 94.6k, False: 9.39k]
  ------------------
  188|  94.6k|         encoding.push_back(static_cast<uint8_t>(z));
  189|  94.6k|      } else {
  190|  9.39k|         const size_t z7 = (high_bit(z) + 7 - 1) / 7;
  191|       |
  192|  32.2k|         for(size_t j = 0; j != z7; ++j) {
  ------------------
  |  Branch (192:28): [True: 22.8k, False: 9.39k]
  ------------------
  193|  22.8k|            uint8_t zp = static_cast<uint8_t>(z >> (7 * (z7 - j - 1)) & 0x7F);
  194|       |
  195|  22.8k|            if(j != z7 - 1) {
  ------------------
  |  Branch (195:16): [True: 13.4k, False: 9.39k]
  ------------------
  196|  13.4k|               zp |= 0x80;
  197|  13.4k|            }
  198|       |
  199|  22.8k|            encoding.push_back(zp);
  200|  22.8k|         }
  201|  9.39k|      }
  202|   104k|   };
asn1_oid.cpp:_ZZN5Botan3OID11decode_fromERNS_11BER_DecoderEENK3$_0clERNS_12BufferSlicerE:
  231|   129k|   auto consume = [](BufferSlicer& data) -> uint32_t {
  232|   129k|      BOTAN_ASSERT_NOMSG(!data.empty());
  ------------------
  |  |   77|   129k|   do {                                                                     \
  |  |   78|   129k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|   129k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 129k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|   129k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 129k]
  |  |  ------------------
  ------------------
  233|   129k|      uint32_t b = data.take_byte();
  234|       |
  235|   129k|      if(b > 0x7F) {
  ------------------
  |  Branch (235:10): [True: 12.0k, False: 117k]
  ------------------
  236|  12.0k|         b &= 0x7F;
  237|       |
  238|       |         // Even BER requires that the OID have minimal length, ie that
  239|       |         // the first byte of a multibyte encoding cannot be zero
  240|       |         // See X.690 section 8.19.2
  241|  12.0k|         if(b == 0) {
  ------------------
  |  Branch (241:13): [True: 6, False: 12.0k]
  ------------------
  242|      6|            throw Decoding_Error("Leading zero byte in multibyte OID encoding");
  243|      6|         }
  244|       |
  245|  17.5k|         while(true) {
  ------------------
  |  Branch (245:16): [True: 17.5k, Folded]
  ------------------
  246|  17.5k|            if(data.empty()) {
  ------------------
  |  Branch (246:16): [True: 27, False: 17.5k]
  ------------------
  247|     27|               throw Decoding_Error("Truncated OID value");
  248|     27|            }
  249|       |
  250|  17.5k|            const uint8_t next = data.take_byte();
  251|  17.5k|            const bool more = (next & 0x80) == 0x80;
  252|  17.5k|            const uint8_t value = next & 0x7F;
  253|       |
  254|  17.5k|            if((b >> (32 - 7)) != 0) {
  ------------------
  |  Branch (254:16): [True: 20, False: 17.5k]
  ------------------
  255|     20|               throw Decoding_Error("OID component overflow");
  256|     20|            }
  257|       |
  258|  17.5k|            b = (b << 7) | value;
  259|       |
  260|  17.5k|            if(!more) {
  ------------------
  |  Branch (260:16): [True: 12.0k, False: 5.46k]
  ------------------
  261|  12.0k|               break;
  262|  12.0k|            }
  263|  17.5k|         }
  264|  12.0k|      }
  265|       |
  266|   129k|      return b;
  267|   129k|   };
asn1_oid.cpp:_ZZN5Botan3OID11decode_fromERNS_11BER_DecoderEENK3$_1clEj:
  277|  48.8k|         const uint32_t root_arc = [](uint32_t b0) -> uint32_t {
  278|  48.8k|            if(b0 < 40) {
  ------------------
  |  Branch (278:16): [True: 37.9k, False: 10.9k]
  ------------------
  279|  37.9k|               return 0;
  280|  37.9k|            } else if(b0 < 80) {
  ------------------
  |  Branch (280:23): [True: 6.07k, False: 4.89k]
  ------------------
  281|  6.07k|               return 1;
  282|  6.07k|            } else {
  283|  4.89k|               return 2;
  284|  4.89k|            }
  285|  48.8k|         }(comp);

_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEENS_9ASN1_TypeE:
  135|  49.1k|ASN1_String::ASN1_String(std::string_view str, ASN1_Type t) : m_utf8_str(str), m_tag(t) {
  136|  49.1k|   if(!is_utf8_subset_string_type(m_tag)) {
  ------------------
  |  Branch (136:7): [True: 0, False: 49.1k]
  ------------------
  137|      0|      throw Invalid_Argument("ASN1_String only supports encoding to UTF-8 or a UTF-8 subset");
  138|      0|   }
  139|       |
  140|  49.1k|   if(!is_valid_asn1_string_content(m_utf8_str, m_tag)) {
  ------------------
  |  Branch (140:7): [True: 0, False: 49.1k]
  ------------------
  141|      0|      throw Invalid_Argument(fmt("ASN1_String: Invalid {} encoding", asn1_tag_to_string(m_tag)));
  142|      0|   }
  143|  49.1k|}
_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  145|  49.1k|ASN1_String::ASN1_String(std::string_view str) : ASN1_String(str, choose_encoding(str)) {}
_ZN5Botan11ASN1_String11decode_fromERNS_11BER_DecoderE:
  162|  48.8k|void ASN1_String::decode_from(BER_Decoder& source) {
  163|  48.8k|   const BER_Object obj = source.get_next_object();
  164|       |
  165|  48.8k|   if(obj.get_class() != ASN1_Class::Universal || !is_asn1_string_type(obj.type())) {
  ------------------
  |  Branch (165:7): [True: 135, False: 48.7k]
  |  Branch (165:51): [True: 86, False: 48.6k]
  ------------------
  166|    210|      auto typ = static_cast<uint32_t>(obj.type());
  167|    210|      auto cls = static_cast<uint32_t>(obj.get_class());
  168|    210|      throw Decoding_Error(fmt("ASN1_String: Unknown string type {}/{}", typ, cls));
  169|    210|   }
  170|       |
  171|  48.6k|   m_tag = obj.type();
  172|  48.6k|   m_data.assign(obj.bits(), obj.bits() + obj.length());
  173|       |
  174|  48.6k|   if(m_tag == ASN1_Type::BmpString) {
  ------------------
  |  Branch (174:7): [True: 1.34k, False: 47.3k]
  ------------------
  175|  1.34k|      m_utf8_str = ucs2_to_utf8(m_data);
  176|  47.3k|   } else if(m_tag == ASN1_Type::UniversalString) {
  ------------------
  |  Branch (176:14): [True: 5.26k, False: 42.0k]
  ------------------
  177|  5.26k|      m_utf8_str = ucs4_to_utf8(m_data);
  178|  42.0k|   } else if(m_tag == ASN1_Type::TeletexString) {
  ------------------
  |  Branch (178:14): [True: 14.9k, False: 27.1k]
  ------------------
  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|  14.9k|      m_utf8_str = latin1_to_utf8(m_data);
  184|  27.1k|   } else {
  185|       |      // All other supported string types are UTF-8 or some subset thereof
  186|  27.1k|      m_utf8_str = ASN1::to_string(obj);
  187|       |
  188|  27.1k|      if(!is_valid_asn1_string_content(m_utf8_str, m_tag)) {
  ------------------
  |  Branch (188:10): [True: 119, False: 27.0k]
  ------------------
  189|    119|         throw Decoding_Error(fmt("ASN1_String: Invalid {} encoding", asn1_tag_to_string(m_tag)));
  190|    119|      }
  191|  27.1k|   }
  192|  48.6k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_119is_asn1_string_typeENS_9ASN1_TypeE:
   99|  48.7k|bool is_asn1_string_type(ASN1_Type tag) {
  100|  48.7k|   return (is_utf8_subset_string_type(tag) || tag == ASN1_Type::TeletexString || tag == ASN1_Type::BmpString ||
  ------------------
  |  Branch (100:12): [True: 27.1k, False: 21.6k]
  |  Branch (100:47): [True: 14.9k, False: 6.69k]
  |  Branch (100:82): [True: 1.34k, False: 5.34k]
  ------------------
  101|  5.34k|           tag == ASN1_Type::UniversalString);
  ------------------
  |  Branch (101:12): [True: 5.26k, False: 86]
  ------------------
  102|  48.7k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_126is_utf8_subset_string_typeENS_9ASN1_TypeE:
   94|   174k|bool is_utf8_subset_string_type(ASN1_Type tag) {
   95|   174k|   return (tag == ASN1_Type::NumericString || tag == ASN1_Type::PrintableString || tag == ASN1_Type::VisibleString ||
  ------------------
  |  Branch (95:12): [True: 1.23k, False: 172k]
  |  Branch (95:47): [True: 134k, False: 38.8k]
  |  Branch (95:84): [True: 4.04k, False: 34.7k]
  ------------------
   96|  34.7k|           tag == ASN1_Type::Ia5String || tag == ASN1_Type::Utf8String);
  ------------------
  |  Branch (96:12): [True: 5.19k, False: 29.5k]
  |  Branch (96:43): [True: 7.96k, False: 21.6k]
  ------------------
   97|   174k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_128is_valid_asn1_string_contentERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_9ASN1_TypeE:
  104|  76.3k|bool is_valid_asn1_string_content(const std::string& str, ASN1_Type tag) {
  105|  76.3k|   BOTAN_ASSERT_NOMSG(is_utf8_subset_string_type(tag));
  ------------------
  |  |   77|  76.3k|   do {                                                                     \
  |  |   78|  76.3k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  76.3k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 76.3k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  76.3k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 76.3k]
  |  |  ------------------
  ------------------
  106|       |
  107|  76.3k|   switch(tag) {
  108|  3.98k|      case ASN1_Type::Utf8String:
  ------------------
  |  Branch (108:7): [True: 3.98k, False: 72.3k]
  ------------------
  109|  3.98k|         return is_valid_utf8(str);
  110|    618|      case ASN1_Type::NumericString:
  ------------------
  |  Branch (110:7): [True: 618, False: 75.6k]
  ------------------
  111|  67.6k|      case ASN1_Type::PrintableString:
  ------------------
  |  Branch (111:7): [True: 67.0k, False: 9.22k]
  ------------------
  112|  70.2k|      case ASN1_Type::Ia5String:
  ------------------
  |  Branch (112:7): [True: 2.59k, False: 73.7k]
  ------------------
  113|  72.3k|      case ASN1_Type::VisibleString:
  ------------------
  |  Branch (113:7): [True: 2.02k, False: 74.2k]
  ------------------
  114|  72.3k|         return g_char_validator.valid_encoding(str, tag);
  115|      0|      default:
  ------------------
  |  Branch (115:7): [True: 0, False: 76.3k]
  ------------------
  116|      0|         return false;
  117|  76.3k|   }
  118|  76.3k|}
asn1_str.cpp:_ZNK5Botan12_GLOBAL__N_131ASN1_String_Codepoint_Validator14valid_encodingENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_9ASN1_TypeE:
   25|   121k|      constexpr bool valid_encoding(std::string_view str, ASN1_Type tag) const {
   26|   121k|         const uint8_t mask = mask_for(tag);
   27|   121k|         for(const char c : str) {
  ------------------
  |  Branch (27:27): [True: 1.73k, False: 121k]
  ------------------
   28|  1.73k|            const uint8_t codepoint = static_cast<uint8_t>(c);
   29|  1.73k|            const bool is_valid = (m_table[codepoint] & mask) != 0;
   30|       |
   31|  1.73k|            if(!is_valid) {
  ------------------
  |  Branch (31:16): [True: 32, False: 1.70k]
  ------------------
   32|     32|               return false;
   33|     32|            }
   34|  1.73k|         }
   35|       |
   36|   121k|         return true;
   37|   121k|      }
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_131ASN1_String_Codepoint_Validator8mask_forENS_9ASN1_TypeE:
   45|   121k|      static constexpr uint8_t mask_for(ASN1_Type tag) {
   46|   121k|         switch(tag) {
   47|    618|            case ASN1_Type::NumericString:
  ------------------
  |  Branch (47:13): [True: 618, False: 120k]
  ------------------
   48|    618|               return Numeric_String;
   49|   116k|            case ASN1_Type::PrintableString:
  ------------------
  |  Branch (49:13): [True: 116k, False: 5.23k]
  ------------------
   50|   116k|               return Printable_String;
   51|  2.59k|            case ASN1_Type::Ia5String:
  ------------------
  |  Branch (51:13): [True: 2.59k, False: 118k]
  ------------------
   52|  2.59k|               return IA5_String;
   53|  2.02k|            case ASN1_Type::VisibleString:
  ------------------
  |  Branch (53:13): [True: 2.02k, False: 119k]
  ------------------
   54|  2.02k|               return Visible_String;
   55|      0|            default:
  ------------------
  |  Branch (55:13): [True: 0, False: 121k]
  ------------------
   56|      0|               return 0;
   57|   121k|         }
   58|   121k|      }
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_115choose_encodingENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  120|  49.1k|ASN1_Type choose_encoding(std::string_view str) {
  121|  49.1k|   if(g_char_validator.valid_encoding(str, ASN1_Type::PrintableString)) {
  ------------------
  |  Branch (121:7): [True: 49.1k, False: 0]
  ------------------
  122|  49.1k|      return ASN1_Type::PrintableString;
  123|  49.1k|   } else {
  124|      0|      return ASN1_Type::Utf8String;
  125|      0|   }
  126|  49.1k|}

_ZN5Botan11BER_DecoderD2Ev:
  366|  70.5k|BER_Decoder::~BER_Decoder() = default;
_ZNK5Botan11BER_Decoder10more_itemsEv:
  371|  75.7k|bool BER_Decoder::more_items() const {
  372|  75.7k|   if(m_source->end_of_data() && !m_pushed.is_set()) {
  ------------------
  |  Branch (372:7): [True: 13.9k, False: 61.8k]
  |  Branch (372:34): [True: 13.9k, False: 0]
  ------------------
  373|  13.9k|      return false;
  374|  13.9k|   }
  375|  61.8k|   return true;
  376|  75.7k|}
_ZN5Botan11BER_Decoder14read_next_byteEv:
  405|  1.07M|std::optional<uint8_t> BER_Decoder::read_next_byte() {
  406|  1.07M|   BOTAN_ASSERT_NOMSG(m_source != nullptr);
  ------------------
  |  |   77|  1.07M|   do {                                                                     \
  |  |   78|  1.07M|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  1.07M|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 1.07M]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  1.07M|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 1.07M]
  |  |  ------------------
  ------------------
  407|  1.07M|   uint8_t b = 0;
  408|  1.07M|   if(m_source->read_byte(b) != 0) {
  ------------------
  |  Branch (408:7): [True: 1.07M, False: 2.92k]
  ------------------
  409|  1.07M|      return b;
  410|  1.07M|   } else {
  411|  2.92k|      return {};
  412|  2.92k|   }
  413|  1.07M|}
_ZN5Botan11BER_Decoder15get_next_objectEv:
  426|   164k|BER_Object BER_Decoder::get_next_object() {
  427|   164k|   BER_Object next;
  428|       |
  429|   164k|   if(m_pushed.is_set()) {
  ------------------
  |  Branch (429:7): [True: 0, False: 164k]
  ------------------
  430|      0|      std::swap(next, m_pushed);
  431|      0|      return next;
  432|      0|   }
  433|       |
  434|   166k|   for(;;) {
  435|   166k|      ASN1_Type type_tag = ASN1_Type::NoObject;
  436|   166k|      ASN1_Class class_tag = ASN1_Class::NoObject;
  437|   166k|      decode_tag(m_source, type_tag, class_tag);
  438|   166k|      next.set_tagging(type_tag, class_tag);
  439|   166k|      if(next.is_set() == false) {  // no more objects
  ------------------
  |  Branch (439:10): [True: 816, False: 165k]
  ------------------
  440|    816|         return next;
  441|    816|      }
  442|       |
  443|   165k|      const size_t allow_indef = m_limits.allow_ber_encoding() ? m_limits.max_nested_indefinite_length() : 0;
  ------------------
  |  Branch (443:34): [True: 165k, False: 38]
  ------------------
  444|   165k|      const bool der_mode = m_limits.require_der_encoding();
  445|   165k|      const auto dl = decode_length(m_source, allow_indef, der_mode, is_constructed(class_tag));
  446|       |
  447|       |      // Per X.690 8.1.5 the only valid EOC encoding is the two-octet
  448|       |      // sequence 0x00 0x00. Reject any other length encoding on a tag of
  449|       |      // (Eoc, Universal) before we consume the "content" bytes.
  450|   165k|      if(type_tag == ASN1_Type::Eoc && class_tag == ASN1_Class::Universal &&
  ------------------
  |  Branch (450:10): [True: 2.34k, False: 163k]
  |  Branch (450:40): [True: 2.31k, False: 28]
  ------------------
  451|  2.31k|         (dl.content_length() != 0 || dl.indefinite_length())) {
  ------------------
  |  Branch (451:11): [True: 98, False: 2.22k]
  |  Branch (451:39): [True: 0, False: 2.22k]
  ------------------
  452|     98|         throw BER_Decoding_Error("EOC marker with non-zero length");
  453|     98|      }
  454|       |
  455|   165k|      if(!m_source->check_available(dl.total_length())) {
  ------------------
  |  Branch (455:10): [True: 168, False: 165k]
  ------------------
  456|    168|         throw BER_Decoding_Error("Value truncated");
  457|    168|      }
  458|       |
  459|   165k|      uint8_t* out = next.mutable_bits(dl.content_length());
  460|   165k|      if(m_source->read(out, dl.content_length()) != dl.content_length()) {
  ------------------
  |  Branch (460:10): [True: 0, False: 165k]
  ------------------
  461|      0|         throw BER_Decoding_Error("Value truncated");
  462|      0|      }
  463|       |
  464|   165k|      if(dl.indefinite_length()) {
  ------------------
  |  Branch (464:10): [True: 53.7k, False: 111k]
  ------------------
  465|       |         // After reading the data consume the 2-byte EOC
  466|  53.7k|         uint8_t eoc[2] = {0xFF, 0xFF};
  467|  53.7k|         if(m_source->read(eoc, 2) != 2 || eoc[0] != 0x00 || eoc[1] != 0x00) {
  ------------------
  |  Branch (467:13): [True: 0, False: 53.7k]
  |  Branch (467:44): [True: 0, False: 53.7k]
  |  Branch (467:62): [True: 0, False: 53.7k]
  ------------------
  468|      0|            throw BER_Decoding_Error("Missing or malformed EOC marker");
  469|      0|         }
  470|  53.7k|      }
  471|       |
  472|   165k|      if(next.tagging() == static_cast<uint32_t>(ASN1_Type::Eoc)) {
  ------------------
  |  Branch (472:10): [True: 2.22k, False: 163k]
  ------------------
  473|  2.22k|         if(m_limits.require_der_encoding()) {
  ------------------
  |  Branch (473:13): [True: 0, False: 2.22k]
  ------------------
  474|      0|            throw BER_Decoding_Error("Detected EOC marker in DER structure");
  475|      0|         }
  476|  2.22k|         continue;
  477|   163k|      } else {
  478|   163k|         break;
  479|   163k|      }
  480|   165k|   }
  481|       |
  482|   163k|   return next;
  483|   164k|}
_ZN5Botan11BER_Decoder10start_consENS_9ASN1_TypeENS_10ASN1_ClassE:
  514|  66.5k|BER_Decoder BER_Decoder::start_cons(ASN1_Type type_tag, ASN1_Class class_tag) {
  515|  66.5k|   BER_Object obj = get_next_object();
  516|  66.5k|   obj.assert_is_a(type_tag, class_tag | ASN1_Class::Constructed);
  517|  66.5k|   BER_Decoder child(std::move(obj), this);
  518|  66.5k|   return child;
  519|  66.5k|}
_ZN5Botan11BER_Decoder8end_consEv:
  524|  51.3k|BER_Decoder& BER_Decoder::end_cons() {
  525|  51.3k|   if(m_parent == nullptr) {
  ------------------
  |  Branch (525:7): [True: 0, False: 51.3k]
  ------------------
  526|      0|      throw Invalid_State("BER_Decoder::end_cons called with null parent");
  527|      0|   }
  528|  51.3k|   if(!m_source->end_of_data() || m_pushed.is_set()) {
  ------------------
  |  Branch (528:7): [True: 26, False: 51.3k]
  |  Branch (528:35): [True: 0, False: 51.3k]
  ------------------
  529|     26|      throw Decoding_Error("BER_Decoder::end_cons called with data left");
  530|     26|   }
  531|  51.3k|   return (*m_parent);
  532|  51.3k|}
_ZN5Botan11BER_DecoderC2EONS_10BER_ObjectEPS0_:
  535|  64.5k|      m_limits(parent != nullptr ? parent->limits() : BER_Decoder::Limits::BER()), m_parent(parent) {
  ------------------
  |  Branch (535:16): [True: 64.5k, False: 0]
  ------------------
  536|  64.5k|   m_data_src = std::make_unique<DataSource_BERObject>(std::move(obj));
  537|  64.5k|   m_source = m_data_src.get();
  538|  64.5k|}
_ZN5Botan11BER_DecoderC2ENSt3__14spanIKhLm18446744073709551615EEENS0_6LimitsE:
  548|  6.01k|BER_Decoder::BER_Decoder(std::span<const uint8_t> buf, Limits limits) : m_limits(limits) {
  549|  6.01k|   m_data_src = std::make_unique<DataSource_Memory>(buf);
  550|  6.01k|   m_source = m_data_src.get();
  551|  6.01k|}
_ZN5Botan11BER_Decoder6decodeERNS_11ASN1_ObjectENS_9ASN1_TypeENS_10ASN1_ClassE:
  560|  97.8k|BER_Decoder& BER_Decoder::decode(ASN1_Object& obj, ASN1_Type /*unused*/, ASN1_Class /*unused*/) {
  561|  97.8k|   obj.decode_from(*this);
  562|  97.8k|   return (*this);
  563|  97.8k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_110decode_tagEPNS_10DataSourceERNS_9ASN1_TypeERNS_10ASN1_ClassE:
   27|   166k|size_t decode_tag(DataSource* ber, ASN1_Type& type_tag, ASN1_Class& class_tag) {
   28|   166k|   auto b = ber->read_byte();
   29|       |
   30|   166k|   if(!b) {
  ------------------
  |  Branch (30:7): [True: 816, False: 165k]
  ------------------
   31|    816|      type_tag = ASN1_Type::NoObject;
   32|    816|      class_tag = ASN1_Class::NoObject;
   33|    816|      return 0;
   34|    816|   }
   35|       |
   36|   165k|   if((*b & 0x1F) != 0x1F) {
  ------------------
  |  Branch (36:7): [True: 165k, False: 346]
  ------------------
   37|   165k|      type_tag = ASN1_Type(*b & 0x1F);
   38|   165k|      class_tag = ASN1_Class(*b & 0xE0);
   39|   165k|      return 1;
   40|   165k|   }
   41|       |
   42|    346|   size_t tag_bytes = 1;
   43|    346|   class_tag = ASN1_Class(*b & 0xE0);
   44|       |
   45|    346|   uint32_t tag_buf = 0;
   46|  1.12k|   while(true) {
  ------------------
  |  Branch (46:10): [True: 1.12k, Folded]
  ------------------
   47|  1.12k|      b = ber->read_byte();
   48|  1.12k|      if(!b) {
  ------------------
  |  Branch (48:10): [True: 19, False: 1.10k]
  ------------------
   49|     19|         throw BER_Decoding_Error("Long-form tag truncated");
   50|     19|      }
   51|  1.10k|      if((tag_buf >> 24) != 0) {
  ------------------
  |  Branch (51:10): [True: 8, False: 1.09k]
  ------------------
   52|      8|         throw BER_Decoding_Error("Long-form tag overflowed 32 bits");
   53|      8|      }
   54|       |      // This is required even by BER (see X.690 section 8.1.2.4.2 sentence c).
   55|       |      // Bits 7-1 of the first subsequent octet must not be all zero; this rules
   56|       |      // out both 0x80 (continuation with no data) and 0x00 (a long-form encoding
   57|       |      // of tag value 0, which collides with the EOC marker).
   58|  1.09k|      if(tag_bytes == 1 && (*b & 0x7F) == 0) {
  ------------------
  |  Branch (58:10): [True: 338, False: 761]
  |  Branch (58:28): [True: 4, False: 334]
  ------------------
   59|      4|         throw BER_Decoding_Error("Long form tag with leading zero");
   60|      4|      }
   61|  1.09k|      ++tag_bytes;
   62|  1.09k|      tag_buf = (tag_buf << 7) | (*b & 0x7F);
   63|  1.09k|      if((*b & 0x80) == 0) {
  ------------------
  |  Branch (63:10): [True: 315, False: 780]
  ------------------
   64|    315|         break;
   65|    315|      }
   66|  1.09k|   }
   67|       |   // Per X.690 8.1.2.2, tag values 0-30 shall be encoded in the short form.
   68|       |   // Long-form encoding is reserved for tag values >= 31 (X.690 8.1.2.3).
   69|       |   // This is unconditional and applies to BER as well as DER.
   70|    315|   if(tag_buf <= 30) {
  ------------------
  |  Branch (70:7): [True: 6, False: 309]
  ------------------
   71|      6|      throw BER_Decoding_Error("Long-form tag encoding used for small tag value");
   72|      6|   }
   73|       |
   74|    309|   if(tag_buf == static_cast<uint32_t>(ASN1_Type::NoObject)) {
  ------------------
  |  Branch (74:7): [True: 1, False: 308]
  ------------------
   75|      1|      throw BER_Decoding_Error("Tag value collides with internal sentinel");
   76|      1|   }
   77|       |
   78|       |   // NOLINTNEXTLINE(clang-analyzer-optin.core.EnumCastOutOfRange)
   79|    308|   type_tag = ASN1_Type(tag_buf);
   80|    308|   return tag_bytes;
   81|    309|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_113decode_lengthEPNS_10DataSourceEmbb:
  126|   165k|BerDecodedLength decode_length(DataSource* ber, size_t allow_indef, bool der_mode, bool constructed) {
  127|   165k|   uint8_t b = 0;
  128|   165k|   if(ber->read_byte(b) == 0) {
  ------------------
  |  Branch (128:7): [True: 211, False: 165k]
  ------------------
  129|    211|      throw BER_Decoding_Error("Length field not found");
  130|    211|   }
  131|   165k|   if((b & 0x80) == 0) {
  ------------------
  |  Branch (131:7): [True: 108k, False: 57.0k]
  ------------------
  132|   108k|      return BerDecodedLength(b, 1);
  133|   108k|   }
  134|       |
  135|  57.0k|   const size_t num_length_bytes = (b & 0x7F);
  136|  57.0k|   if(num_length_bytes > 4) {
  ------------------
  |  Branch (136:7): [True: 29, False: 57.0k]
  ------------------
  137|     29|      throw BER_Decoding_Error("Length field is too large");
  138|     29|   }
  139|       |
  140|  57.0k|   const size_t field_size = 1 + num_length_bytes;
  141|       |
  142|  57.0k|   if(num_length_bytes == 0) {
  ------------------
  |  Branch (142:7): [True: 54.2k, False: 2.80k]
  ------------------
  143|  54.2k|      if(der_mode) {
  ------------------
  |  Branch (143:10): [True: 0, False: 54.2k]
  ------------------
  144|      0|         throw BER_Decoding_Error("Detected indefinite-length encoding in DER structure");
  145|  54.2k|      } else if(!constructed) {
  ------------------
  |  Branch (145:17): [True: 18, False: 54.2k]
  ------------------
  146|       |         // Indefinite length is only valid for constructed types (X.690 8.1.3.2)
  147|     18|         throw BER_Decoding_Error("Indefinite-length encoding used with non-constructed type");
  148|  54.2k|      } else if(allow_indef == 0) {
  ------------------
  |  Branch (148:17): [True: 0, False: 54.2k]
  ------------------
  149|      0|         throw BER_Decoding_Error("Nested EOC markers too deep, rejecting to avoid stack exhaustion");
  150|  54.2k|      } else {
  151|       |         // find_eoc returns bytes up to and including the EOC marker.
  152|       |         // Return the content length; the caller consumes the EOC separately.
  153|  54.2k|         const size_t eoc_len = find_eoc(ber, /*base_offset=*/0, allow_indef - 1);
  154|  54.2k|         if(eoc_len < 2) {
  ------------------
  |  Branch (154:13): [True: 0, False: 54.2k]
  ------------------
  155|      0|            throw BER_Decoding_Error("Invalid EOC encoding");
  156|      0|         }
  157|  54.2k|         return BerDecodedLength::indefinite(eoc_len - 2, field_size);
  158|  54.2k|      }
  159|  54.2k|   }
  160|       |
  161|  2.80k|   size_t length = 0;
  162|       |
  163|  12.6k|   for(size_t i = 0; i != num_length_bytes; ++i) {
  ------------------
  |  Branch (163:22): [True: 9.89k, False: 2.78k]
  ------------------
  164|  9.89k|      if(ber->read_byte(b) == 0) {
  ------------------
  |  Branch (164:10): [True: 15, False: 9.87k]
  ------------------
  165|     15|         throw BER_Decoding_Error("Corrupted length field");
  166|     15|      }
  167|       |      // Can't overflow since we already checked that num_length_bytes <= 4
  168|  9.87k|      length = (length << 8) | b;
  169|  9.87k|   }
  170|       |
  171|       |   // DER requires shortest possible length encoding
  172|  2.78k|   if(der_mode) {
  ------------------
  |  Branch (172:7): [True: 0, False: 2.78k]
  ------------------
  173|      0|      if(length < 128) {
  ------------------
  |  Branch (173:10): [True: 0, False: 0]
  ------------------
  174|      0|         throw BER_Decoding_Error("Detected non-canonical length encoding in DER structure");
  175|      0|      }
  176|      0|      if(num_length_bytes > 1 && length < (size_t(1) << ((num_length_bytes - 1) * 8))) {
  ------------------
  |  Branch (176:10): [True: 0, False: 0]
  |  Branch (176:34): [True: 0, False: 0]
  ------------------
  177|      0|         throw BER_Decoding_Error("Detected non-canonical length encoding in DER structure");
  178|      0|      }
  179|      0|   }
  180|       |
  181|  2.78k|   return BerDecodedLength(length, field_size);
  182|  2.78k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_116BerDecodedLengthC2Emm:
   99|   111k|            BerDecodedLength(content_length, field_length, false) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_116BerDecodedLengthC2Emmb:
  116|   165k|            m_content_length(content_length), m_field_length(field_length), m_indefinite(indefinite) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_18find_eocEPNS_10DataSourceEmm:
  293|   147k|size_t find_eoc(DataSource* src, size_t base_offset, size_t allow_indef) {
  294|   147k|   size_t offset = base_offset;
  295|       |
  296|   505k|   while(true) {
  ------------------
  |  Branch (296:10): [True: 505k, Folded]
  ------------------
  297|   505k|      ASN1_Type type_tag = ASN1_Type::NoObject;
  298|   505k|      ASN1_Class class_tag = ASN1_Class::NoObject;
  299|   505k|      const size_t tag_size = peek_tag(src, offset, type_tag, class_tag);
  300|   505k|      if(type_tag == ASN1_Type::NoObject) {
  ------------------
  |  Branch (300:10): [True: 224, False: 505k]
  ------------------
  301|    224|         throw BER_Decoding_Error("Missing EOC marker in indefinite-length encoding");
  302|    224|      }
  303|       |
  304|   505k|      size_t length_size = 0;
  305|   505k|      const size_t item_size = peek_length(src, offset + tag_size, length_size, allow_indef, is_constructed(class_tag));
  306|       |
  307|   505k|      if(auto new_offset = checked_add(offset, tag_size, length_size, item_size)) {
  ------------------
  |  Branch (307:15): [True: 504k, False: 379]
  ------------------
  308|   504k|         offset = new_offset.value();
  309|   504k|      } else {
  310|    379|         throw Decoding_Error("Integer overflow while scanning for EOC");
  311|    379|      }
  312|       |
  313|   504k|      if(type_tag == ASN1_Type::Eoc && class_tag == ASN1_Class::Universal) {
  ------------------
  |  Branch (313:10): [True: 147k, False: 357k]
  |  Branch (313:40): [True: 146k, False: 492]
  ------------------
  314|       |         // Per X.690 8.1.5 the EOC marker is exactly two zero octets
  315|   146k|         if(length_size != 1 || item_size != 0) {
  ------------------
  |  Branch (315:13): [True: 1, False: 146k]
  |  Branch (315:33): [True: 27, False: 146k]
  ------------------
  316|     28|            throw BER_Decoding_Error("EOC marker with non-zero length");
  317|     28|         }
  318|   146k|         break;
  319|   146k|      }
  320|   504k|   }
  321|       |
  322|   146k|   return offset - base_offset;
  323|   147k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_18peek_tagEPNS_10DataSourceEmRNS_9ASN1_TypeERNS_10ASN1_ClassE:
  188|   505k|size_t peek_tag(DataSource* src, size_t offset, ASN1_Type& type_tag, ASN1_Class& class_tag) {
  189|   505k|   uint8_t b = 0;
  190|   505k|   if(src->peek(&b, 1, offset) == 0) {
  ------------------
  |  Branch (190:7): [True: 224, False: 505k]
  ------------------
  191|    224|      type_tag = ASN1_Type::NoObject;
  192|    224|      class_tag = ASN1_Class::NoObject;
  193|    224|      return 0;
  194|    224|   }
  195|       |
  196|   505k|   if((b & 0x1F) != 0x1F) {
  ------------------
  |  Branch (196:7): [True: 504k, False: 603]
  ------------------
  197|   504k|      type_tag = ASN1_Type(b & 0x1F);
  198|   504k|      class_tag = ASN1_Class(b & 0xE0);
  199|   504k|      return 1;
  200|   504k|   }
  201|       |
  202|    603|   class_tag = ASN1_Class(b & 0xE0);
  203|    603|   size_t tag_bytes = 1;
  204|    603|   uint32_t tag_buf = 0;
  205|       |
  206|  1.53k|   while(true) {
  ------------------
  |  Branch (206:10): [True: 1.53k, Folded]
  ------------------
  207|  1.53k|      if(src->peek(&b, 1, offset + tag_bytes) == 0) {
  ------------------
  |  Branch (207:10): [True: 14, False: 1.52k]
  ------------------
  208|     14|         throw BER_Decoding_Error("Long-form tag truncated");
  209|     14|      }
  210|  1.52k|      if((tag_buf >> 24) != 0) {
  ------------------
  |  Branch (210:10): [True: 7, False: 1.51k]
  ------------------
  211|      7|         throw BER_Decoding_Error("Long-form tag overflowed 32 bits");
  212|      7|      }
  213|       |      // Required even by BER (X.690 section 8.1.2.4.2 sentence c).
  214|       |      // Bits 7-1 of the first subsequent octet must not be all zero; this rules
  215|       |      // out both 0x80 (continuation with no data) and 0x00 (a long-form encoding
  216|       |      // of tag value 0, which collides with the EOC marker).
  217|  1.51k|      if(tag_bytes == 1 && (b & 0x7F) == 0) {
  ------------------
  |  Branch (217:10): [True: 599, False: 917]
  |  Branch (217:28): [True: 2, False: 597]
  ------------------
  218|      2|         throw BER_Decoding_Error("Long form tag with leading zero");
  219|      2|      }
  220|  1.51k|      ++tag_bytes;
  221|  1.51k|      tag_buf = (tag_buf << 7) | (b & 0x7F);
  222|  1.51k|      if((b & 0x80) == 0) {
  ------------------
  |  Branch (222:10): [True: 580, False: 934]
  ------------------
  223|    580|         break;
  224|    580|      }
  225|  1.51k|   }
  226|       |
  227|       |   // Per X.690 8.1.2.2, tag values 0-30 shall be encoded in the short form.
  228|       |   // Long-form encoding is reserved for tag values >= 31 (X.690 8.1.2.3).
  229|       |   // This is unconditional and applies to BER as well as DER.
  230|    580|   if(tag_buf <= 30) {
  ------------------
  |  Branch (230:7): [True: 6, False: 574]
  ------------------
  231|      6|      throw BER_Decoding_Error("Long-form tag encoding used for small tag value");
  232|      6|   }
  233|       |
  234|    574|   if(tag_buf == static_cast<uint32_t>(ASN1_Type::NoObject)) {
  ------------------
  |  Branch (234:7): [True: 1, False: 573]
  ------------------
  235|      1|      throw BER_Decoding_Error("Tag value collides with internal sentinel");
  236|      1|   }
  237|       |
  238|       |   // NOLINTNEXTLINE(clang-analyzer-optin.core.EnumCastOutOfRange)
  239|    573|   type_tag = ASN1_Type(tag_buf);
  240|    573|   return tag_bytes;
  241|    574|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_111peek_lengthEPNS_10DataSourceEmRmmb:
  248|   505k|size_t peek_length(DataSource* src, size_t offset, size_t& field_size, size_t allow_indef, bool constructed) {
  249|   505k|   uint8_t b = 0;
  250|   505k|   if(src->peek(&b, 1, offset) == 0) {
  ------------------
  |  Branch (250:7): [True: 121, False: 504k]
  ------------------
  251|    121|      throw BER_Decoding_Error("Length field not found");
  252|    121|   }
  253|       |
  254|   504k|   field_size = 1;
  255|   504k|   if((b & 0x80) == 0) {
  ------------------
  |  Branch (255:7): [True: 404k, False: 100k]
  ------------------
  256|   404k|      return b;
  257|   404k|   }
  258|       |
  259|   100k|   const size_t num_length_bytes = (b & 0x7F);
  260|   100k|   field_size += num_length_bytes;
  261|   100k|   if(field_size > 5) {
  ------------------
  |  Branch (261:7): [True: 16, False: 100k]
  ------------------
  262|     16|      throw BER_Decoding_Error("Length field is too large");
  263|     16|   }
  264|       |
  265|   100k|   if(num_length_bytes == 0) {
  ------------------
  |  Branch (265:7): [True: 93.2k, False: 7.58k]
  ------------------
  266|       |      // Indefinite length is only valid for constructed types (X.690 8.1.3.2)
  267|  93.2k|      if(!constructed) {
  ------------------
  |  Branch (267:10): [True: 6, False: 93.2k]
  ------------------
  268|      6|         throw BER_Decoding_Error("Indefinite-length encoding used with non-constructed type");
  269|      6|      }
  270|  93.2k|      if(allow_indef == 0) {
  ------------------
  |  Branch (270:10): [True: 1, False: 93.2k]
  ------------------
  271|      1|         throw BER_Decoding_Error("Nested EOC markers too deep, rejecting to avoid stack exhaustion");
  272|      1|      }
  273|  93.2k|      return find_eoc(src, offset + 1, allow_indef - 1);
  274|  93.2k|   }
  275|       |
  276|  7.58k|   size_t length = 0;
  277|  35.2k|   for(size_t i = 0; i < num_length_bytes; ++i) {
  ------------------
  |  Branch (277:22): [True: 27.6k, False: 7.56k]
  ------------------
  278|  27.6k|      if(src->peek(&b, 1, offset + 1 + i) == 0) {
  ------------------
  |  Branch (278:10): [True: 17, False: 27.6k]
  ------------------
  279|     17|         throw BER_Decoding_Error("Corrupted length field");
  280|     17|      }
  281|  27.6k|      if(get_byte<0>(length) != 0) {
  ------------------
  |  Branch (281:10): [True: 0, False: 27.6k]
  ------------------
  282|      0|         throw BER_Decoding_Error("Field length overflow");
  283|      0|      }
  284|  27.6k|      length = (length << 8) | b;
  285|  27.6k|   }
  286|  7.56k|   return length;
  287|  7.58k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_116BerDecodedLength10indefiniteEmm:
  101|  53.7k|      static BerDecodedLength indefinite(size_t content_length, size_t field_length) {
  102|  53.7k|         return BerDecodedLength(content_length, field_length, true);
  103|  53.7k|      }
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_114is_constructedENS_10ASN1_ClassE:
   20|   670k|bool is_constructed(ASN1_Class class_tag) {
   21|   670k|   return (static_cast<uint32_t>(class_tag) & static_cast<uint32_t>(ASN1_Class::Constructed)) != 0;
   22|   670k|}
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength14content_lengthEv:
  105|   496k|      size_t content_length() const { return m_content_length; }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength17indefinite_lengthEv:
  112|   167k|      bool indefinite_length() const { return m_indefinite; }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength12total_lengthEv:
  108|   164k|      size_t total_length() const { return m_indefinite ? m_content_length + 2 : m_content_length; }
  ------------------
  |  Branch (108:44): [True: 53.7k, False: 111k]
  ------------------
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObjectC2EONS_10BER_ObjectE:
  357|  64.5k|      explicit DataSource_BERObject(BER_Object&& obj) : m_obj(std::move(obj)) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject4readEPhm:
  327|  1.56M|      size_t read(uint8_t out[], size_t length) override {
  328|  1.56M|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   77|  1.56M|   do {                                                                     \
  |  |   78|  1.56M|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  1.56M|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 1.56M]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  1.56M|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 1.56M]
  |  |  ------------------
  ------------------
  329|  1.56M|         const size_t got = std::min<size_t>(m_obj.length() - m_offset, length);
  330|  1.56M|         copy_mem(out, m_obj.bits() + m_offset, got);
  331|  1.56M|         m_offset += got;
  332|  1.56M|         return got;
  333|  1.56M|      }
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject15check_availableEm:
  348|   147k|      bool check_available(size_t n) override {
  349|   147k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   77|   147k|   do {                                                                     \
  |  |   78|   147k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|   147k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 147k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|   147k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 147k]
  |  |  ------------------
  ------------------
  350|   147k|         return (n <= (m_obj.length() - m_offset));
  351|   147k|      }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject4peekEPhmm:
  335|   255k|      size_t peek(uint8_t out[], size_t length, size_t peek_offset) const override {
  336|   255k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   77|   255k|   do {                                                                     \
  |  |   78|   255k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|   255k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 255k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|   255k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 255k]
  |  |  ------------------
  ------------------
  337|   255k|         const size_t bytes_left = m_obj.length() - m_offset;
  338|       |
  339|   255k|         if(peek_offset >= bytes_left) {
  ------------------
  |  Branch (339:13): [True: 62, False: 255k]
  ------------------
  340|     62|            return 0;
  341|     62|         }
  342|       |
  343|   255k|         const size_t got = std::min(bytes_left - peek_offset, length);
  344|   255k|         copy_mem(out, m_obj.bits() + m_offset + peek_offset, got);
  345|   255k|         return got;
  346|   255k|      }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject11end_of_dataEv:
  353|   112k|      bool end_of_data() const override { return get_bytes_read() == m_obj.length(); }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject14get_bytes_readEv:
  355|   112k|      size_t get_bytes_read() const override { return m_offset; }

_ZN5Botan11DER_EncoderC2ERNSt3__16vectorIhNS1_9allocatorIhEEEE:
   72|  45.2k|DER_Encoder::DER_Encoder(std::vector<uint8_t>& vec) {
   73|  45.2k|   m_append_output = [&vec](const uint8_t b[], size_t l) { vec.insert(vec.end(), b, b + l); };
   74|  45.2k|}
_ZN5Botan11DER_Encoder10add_objectENS_9ASN1_TypeENS_10ASN1_ClassEPKhm:
  244|  45.2k|DER_Encoder& DER_Encoder::add_object(ASN1_Type type_tag, ASN1_Class class_tag, const uint8_t rep[], size_t length) {
  245|  45.2k|   std::vector<uint8_t> hdr;
  246|  45.2k|   encode_tag(hdr, type_tag, class_tag);
  247|  45.2k|   encode_length(hdr, length);
  248|       |
  249|  45.2k|   if(!m_subsequences.empty()) {
  ------------------
  |  Branch (249:7): [True: 0, False: 45.2k]
  ------------------
  250|      0|      m_subsequences[m_subsequences.size() - 1].add_bytes(hdr.data(), hdr.size(), rep, length);
  251|  45.2k|   } else if(m_append_output) {
  ------------------
  |  Branch (251:14): [True: 45.2k, False: 0]
  ------------------
  252|  45.2k|      m_append_output(hdr.data(), hdr.size());
  253|  45.2k|      m_append_output(rep, length);
  254|  45.2k|   } else {
  255|      0|      m_default_outbuf += hdr;
  256|      0|      m_default_outbuf += std::make_pair(rep, length);
  257|      0|   }
  258|       |
  259|  45.2k|   return (*this);
  260|  45.2k|}
der_enc.cpp:_ZN5Botan12_GLOBAL__N_110encode_tagERNSt3__16vectorIhNS1_9allocatorIhEEEENS_9ASN1_TypeENS_10ASN1_ClassE:
   25|  45.2k|void encode_tag(std::vector<uint8_t>& encoded_tag, ASN1_Type type_tag_e, ASN1_Class class_tag_e) {
   26|  45.2k|   const uint32_t type_tag = static_cast<uint32_t>(type_tag_e);
   27|  45.2k|   const uint32_t class_tag = static_cast<uint32_t>(class_tag_e);
   28|       |
   29|  45.2k|   if((class_tag | 0xE0) != 0xE0) {
  ------------------
  |  Branch (29:7): [True: 0, False: 45.2k]
  ------------------
   30|      0|      throw Encoding_Error(fmt("DER_Encoder: Invalid class tag {}", std::to_string(class_tag)));
   31|      0|   }
   32|       |
   33|  45.2k|   if(type_tag <= 30) {
  ------------------
  |  Branch (33:7): [True: 45.2k, False: 0]
  ------------------
   34|  45.2k|      encoded_tag.push_back(static_cast<uint8_t>(type_tag | class_tag));
   35|  45.2k|   } else {
   36|      0|      size_t blocks = high_bit(static_cast<uint32_t>(type_tag)) + 6;
   37|      0|      blocks = (blocks - (blocks % 7)) / 7;
   38|       |
   39|      0|      BOTAN_ASSERT_NOMSG(blocks > 0);
  ------------------
  |  |   77|      0|   do {                                                                     \
  |  |   78|      0|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|      0|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|      0|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
   40|       |
   41|      0|      encoded_tag.push_back(static_cast<uint8_t>(class_tag | 0x1F));
   42|      0|      for(size_t i = 0; i != blocks - 1; ++i) {
  ------------------
  |  Branch (42:25): [True: 0, False: 0]
  ------------------
   43|      0|         encoded_tag.push_back(0x80 | ((type_tag >> 7 * (blocks - i - 1)) & 0x7F));
   44|      0|      }
   45|      0|      encoded_tag.push_back(type_tag & 0x7F);
   46|      0|   }
   47|  45.2k|}
der_enc.cpp:_ZN5Botan12_GLOBAL__N_113encode_lengthERNSt3__16vectorIhNS1_9allocatorIhEEEEm:
   52|  45.2k|void encode_length(std::vector<uint8_t>& encoded_length, size_t length) {
   53|  45.2k|   if(length <= 127) {
  ------------------
  |  Branch (53:7): [True: 45.2k, False: 61]
  ------------------
   54|  45.2k|      encoded_length.push_back(static_cast<uint8_t>(length));
   55|  45.2k|   } else {
   56|     61|      const size_t bytes_needed = significant_bytes(length);
   57|       |
   58|     61|      encoded_length.push_back(static_cast<uint8_t>(0x80 | bytes_needed));
   59|       |
   60|    165|      for(size_t i = sizeof(length) - bytes_needed; i < sizeof(length); ++i) {
  ------------------
  |  Branch (60:53): [True: 104, False: 61]
  ------------------
   61|    104|         encoded_length.push_back(get_byte_var(i, length));
   62|    104|      }
   63|     61|   }
   64|  45.2k|}
der_enc.cpp:_ZZN5Botan11DER_EncoderC1ERNSt3__16vectorIhNS1_9allocatorIhEEEEENK3$_0clEPKhm:
   73|  90.5k|   m_append_output = [&vec](const uint8_t b[], size_t l) { vec.insert(vec.end(), b, b + l); };

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

_ZN5Botan19next_utf8_codepointENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEERm:
   53|  26.6k|uint32_t next_utf8_codepoint(std::string_view utf8, size_t& pos) {
   54|  26.6k|   auto read_continuation = [&]() -> uint32_t {
   55|  26.6k|      if(pos >= utf8.size()) {
   56|  26.6k|         throw Decoding_Error("Invalid UTF-8 sequence");
   57|  26.6k|      }
   58|  26.6k|      const uint8_t b = static_cast<uint8_t>(utf8[pos++]);
   59|  26.6k|      if((b & 0xC0) != 0x80) {
   60|  26.6k|         throw Decoding_Error("Invalid UTF-8 sequence");
   61|  26.6k|      }
   62|  26.6k|      return b & 0x3F;
   63|  26.6k|   };
   64|       |
   65|  26.6k|   const uint8_t lead = static_cast<uint8_t>(utf8[pos++]);
   66|  26.6k|   uint32_t c = 0;
   67|       |
   68|  26.6k|   if(lead <= 0x7F) {
  ------------------
  |  Branch (68:7): [True: 24.2k, False: 2.41k]
  ------------------
   69|  24.2k|      c = lead;
   70|  24.2k|   } else if((lead & 0xE0) == 0xC0) {
  ------------------
  |  Branch (70:14): [True: 1.55k, False: 860]
  ------------------
   71|  1.55k|      c = (lead & 0x1F) << 6;
   72|  1.55k|      c |= read_continuation();
   73|  1.55k|      if(c < 0x80) {
  ------------------
  |  Branch (73:10): [True: 2, False: 1.55k]
  ------------------
   74|      2|         throw Decoding_Error("Overlong UTF-8 sequence");
   75|      2|      }
   76|  1.55k|   } else if((lead & 0xF0) == 0xE0) {
  ------------------
  |  Branch (76:14): [True: 500, False: 360]
  ------------------
   77|    500|      c = (lead & 0x0F) << 12;
   78|    500|      c |= read_continuation() << 6;
   79|    500|      c |= read_continuation();
   80|    500|      if(c < 0x800) {
  ------------------
  |  Branch (80:10): [True: 9, False: 491]
  ------------------
   81|      9|         throw Decoding_Error("Overlong UTF-8 sequence");
   82|      9|      }
   83|    500|   } else if((lead & 0xF8) == 0xF0) {
  ------------------
  |  Branch (83:14): [True: 332, False: 28]
  ------------------
   84|    332|      c = (lead & 0x07) << 18;
   85|    332|      c |= read_continuation() << 12;
   86|    332|      c |= read_continuation() << 6;
   87|    332|      c |= read_continuation();
   88|    332|      if(c < 0x10000) {
  ------------------
  |  Branch (88:10): [True: 5, False: 327]
  ------------------
   89|      5|         throw Decoding_Error("Overlong UTF-8 sequence");
   90|      5|      }
   91|    332|   } else {
   92|     28|      throw Decoding_Error("Invalid UTF-8 sequence");
   93|     28|   }
   94|       |
   95|  26.6k|   if(c > 0x10FFFF) {
  ------------------
  |  Branch (95:7): [True: 5, False: 26.6k]
  ------------------
   96|      5|      throw Decoding_Error("UTF-8 sequence encodes value outside Unicode range");
   97|      5|   }
   98|  26.6k|   if(c >= 0xD800 && c < 0xE000) {
  ------------------
  |  Branch (98:7): [True: 678, False: 25.9k]
  |  Branch (98:22): [True: 15, False: 663]
  ------------------
   99|     15|      throw Decoding_Error("UTF-8 sequence encodes surrogate code point");
  100|     15|   }
  101|       |
  102|  26.5k|   return c;
  103|  26.6k|}
_ZN5Botan13is_valid_utf8ENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  105|  3.98k|bool is_valid_utf8(std::string_view utf8) {
  106|  3.98k|   try {
  107|  3.98k|      size_t pos = 0;
  108|  30.6k|      while(pos < utf8.size()) {
  ------------------
  |  Branch (108:13): [True: 26.6k, False: 3.98k]
  ------------------
  109|  26.6k|         const uint32_t c = next_utf8_codepoint(utf8, pos);
  110|  26.6k|         BOTAN_UNUSED(c);
  ------------------
  |  |  144|  26.6k|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
  111|  26.6k|      }
  112|  3.98k|   } catch(Decoding_Error&) {
  113|     87|      return false;
  114|     87|   }
  115|  3.89k|   return true;
  116|  3.98k|}
_ZN5Botan12ucs2_to_utf8ENSt3__14spanIKhLm18446744073709551615EEE:
  118|  1.34k|std::string ucs2_to_utf8(std::span<const uint8_t> ucs2) {
  119|  1.34k|   if(ucs2.size() % 2 != 0) {
  ------------------
  |  Branch (119:7): [True: 2, False: 1.34k]
  ------------------
  120|      2|      throw Decoding_Error("Invalid length for UCS-2 string");
  121|      2|   }
  122|       |
  123|  1.34k|   const size_t chars = ucs2.size() / 2;
  124|       |
  125|  1.34k|   std::string s;
  126|  30.7k|   for(size_t i = 0; i != chars; ++i) {
  ------------------
  |  Branch (126:22): [True: 29.3k, False: 1.34k]
  ------------------
  127|  29.3k|      const uint32_t c = load_be<uint16_t>(ucs2.data(), i);
  128|  29.3k|      append_utf8_for(s, c);
  129|  29.3k|   }
  130|       |
  131|  1.34k|   return s;
  132|  1.34k|}
_ZN5Botan12ucs4_to_utf8ENSt3__14spanIKhLm18446744073709551615EEE:
  152|  5.26k|std::string ucs4_to_utf8(std::span<const uint8_t> ucs4) {
  153|  5.26k|   if(ucs4.size() % 4 != 0) {
  ------------------
  |  Branch (153:7): [True: 3, False: 5.25k]
  ------------------
  154|      3|      throw Decoding_Error("Invalid length for UCS-4 string");
  155|      3|   }
  156|       |
  157|  5.25k|   const size_t chars = ucs4.size() / 4;
  158|       |
  159|  5.25k|   std::string s;
  160|  8.98k|   for(size_t i = 0; i != chars; ++i) {
  ------------------
  |  Branch (160:22): [True: 3.72k, False: 5.25k]
  ------------------
  161|  3.72k|      const uint32_t c = load_be<uint32_t>(ucs4.data(), i);
  162|  3.72k|      append_utf8_for(s, c);
  163|  3.72k|   }
  164|       |
  165|  5.25k|   return s;
  166|  5.26k|}
_ZN5Botan14latin1_to_utf8ENSt3__14spanIKhLm18446744073709551615EEE:
  187|  14.9k|std::string latin1_to_utf8(std::span<const uint8_t> chars) {
  188|  14.9k|   std::string s;
  189|   281k|   for(const uint8_t b : chars) {
  ------------------
  |  Branch (189:24): [True: 281k, False: 14.9k]
  ------------------
  190|   281k|      append_utf8_for(s, static_cast<uint32_t>(b));
  191|   281k|   }
  192|  14.9k|   return s;
  193|  14.9k|}
charset.cpp:_ZZN5Botan19next_utf8_codepointENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEERmENK3$_0clEv:
   54|  3.53k|   auto read_continuation = [&]() -> uint32_t {
   55|  3.53k|      if(pos >= utf8.size()) {
  ------------------
  |  Branch (55:10): [True: 4, False: 3.53k]
  ------------------
   56|      4|         throw Decoding_Error("Invalid UTF-8 sequence");
   57|      4|      }
   58|  3.53k|      const uint8_t b = static_cast<uint8_t>(utf8[pos++]);
   59|  3.53k|      if((b & 0xC0) != 0x80) {
  ------------------
  |  Branch (59:10): [True: 19, False: 3.51k]
  ------------------
   60|     19|         throw Decoding_Error("Invalid UTF-8 sequence");
   61|     19|      }
   62|  3.51k|      return b & 0x3F;
   63|  3.53k|   };
charset.cpp:_ZN5Botan12_GLOBAL__N_115append_utf8_forERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEj:
   17|   314k|void append_utf8_for(std::string& s, uint32_t c) {
   18|   314k|   if(c >= 0xD800 && c < 0xE000) {
  ------------------
  |  Branch (18:7): [True: 5.93k, False: 308k]
  |  Branch (18:22): [True: 19, False: 5.92k]
  ------------------
   19|     19|      throw Decoding_Error("Invalid Unicode character");
   20|     19|   }
   21|       |
   22|   314k|   if(c <= 0x7F) {
  ------------------
  |  Branch (22:7): [True: 203k, False: 110k]
  ------------------
   23|   203k|      const uint8_t b0 = static_cast<uint8_t>(c);
   24|   203k|      s.push_back(static_cast<char>(b0));
   25|   203k|   } else if(c <= 0x7FF) {
  ------------------
  |  Branch (25:14): [True: 93.0k, False: 17.3k]
  ------------------
   26|  93.0k|      const uint8_t b0 = 0xC0 | static_cast<uint8_t>(c >> 6);
   27|  93.0k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   28|  93.0k|      s.push_back(static_cast<char>(b0));
   29|  93.0k|      s.push_back(static_cast<char>(b1));
   30|  93.0k|   } else if(c <= 0xFFFF) {
  ------------------
  |  Branch (30:14): [True: 14.1k, False: 3.16k]
  ------------------
   31|  14.1k|      const uint8_t b0 = 0xE0 | static_cast<uint8_t>(c >> 12);
   32|  14.1k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>((c >> 6) & 0x3F);
   33|  14.1k|      const uint8_t b2 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   34|  14.1k|      s.push_back(static_cast<char>(b0));
   35|  14.1k|      s.push_back(static_cast<char>(b1));
   36|  14.1k|      s.push_back(static_cast<char>(b2));
   37|  14.1k|   } else if(c <= 0x10FFFF) {
  ------------------
  |  Branch (37:14): [True: 3.09k, False: 67]
  ------------------
   38|  3.09k|      const uint8_t b0 = 0xF0 | static_cast<uint8_t>(c >> 18);
   39|  3.09k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>((c >> 12) & 0x3F);
   40|  3.09k|      const uint8_t b2 = 0x80 | static_cast<uint8_t>((c >> 6) & 0x3F);
   41|  3.09k|      const uint8_t b3 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   42|  3.09k|      s.push_back(static_cast<char>(b0));
   43|  3.09k|      s.push_back(static_cast<char>(b1));
   44|  3.09k|      s.push_back(static_cast<char>(b2));
   45|  3.09k|      s.push_back(static_cast<char>(b3));
   46|  3.09k|   } else {
   47|     67|      throw Decoding_Error("Invalid Unicode character");
   48|     67|   }
   49|   314k|}

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

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

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

_ZN5BotaneqERKNS_7X509_DNES2_:
  303|    491|bool operator==(const X509_DN& dn1, const X509_DN& dn2) {
  304|    491|   return dn1._canonical_bytes() == dn2._canonical_bytes();
  305|    491|}
_ZN5BotanltERKNS_7X509_DNES2_:
  318|    982|bool operator<(const X509_DN& dn1, const X509_DN& dn2) {
  319|    982|   return dn1._canonical_bytes() < dn2._canonical_bytes();
  320|    982|}
_ZN5Botan7X509_DN11decode_fromERNS_11BER_DecoderE:
  372|  4.67k|void X509_DN::decode_from(BER_Decoder& source) {
  373|  4.67k|   std::vector<uint8_t> bits;
  374|       |
  375|  4.67k|   source.start_sequence().raw_bytes(bits).end_cons();
  376|       |
  377|  4.67k|   BER_Decoder sequence(bits, source.limits());
  378|       |
  379|  4.67k|   std::vector<std::vector<std::pair<OID, ASN1_String>>> rdns;
  380|       |
  381|       |   // Cap AVAs per RDN to bound work for downstream set-based matching.
  382|       |   // No legitimate cert has anywhere near this many AVAs in a single RDN.
  383|  4.67k|   constexpr size_t MAX_AVAS_PER_RDN = 32;
  384|       |
  385|  17.3k|   while(sequence.more_items()) {
  ------------------
  |  Branch (385:10): [True: 12.6k, False: 4.64k]
  ------------------
  386|  12.6k|      BER_Decoder rdn_decoder = sequence.start_set();
  387|       |
  388|  12.6k|      std::vector<std::pair<OID, ASN1_String>> rdn;
  389|  61.8k|      while(rdn_decoder.more_items()) {
  ------------------
  |  Branch (389:13): [True: 49.1k, False: 12.6k]
  ------------------
  390|  49.1k|         OID oid;
  391|  49.1k|         ASN1_String str;
  392|       |
  393|  49.1k|         rdn_decoder.start_sequence()
  394|  49.1k|            .decode(oid)
  395|  49.1k|            .decode(str)  // TODO support Any
  396|  49.1k|            .end_cons();
  397|       |
  398|  49.1k|         rdn.emplace_back(std::move(oid), std::move(str));
  399|       |
  400|  49.1k|         if(rdn.size() > MAX_AVAS_PER_RDN) {
  ------------------
  |  Branch (400:13): [True: 7, False: 49.1k]
  ------------------
  401|      7|            throw Decoding_Error("X.500 RDN has too many attribute-value assertions");
  402|      7|         }
  403|  49.1k|      }
  404|       |
  405|       |      /*
  406|       |      RFC 5280 4.1.2.4:
  407|       |         RelativeDistinguishedName ::=
  408|       |           SET SIZE (1..MAX) OF AttributeTypeAndValue
  409|       |      */
  410|  12.6k|      if(rdn.empty()) {
  ------------------
  |  Branch (410:10): [True: 16, False: 12.6k]
  ------------------
  411|     16|         throw Decoding_Error("X.500 RDN must contain at least one attribute-value assertion");
  412|     16|      }
  413|  12.6k|      rdns.push_back(std::move(rdn));
  414|  12.6k|   }
  415|       |
  416|  4.64k|   auto canonical_bits = canonicalize_dn(rdns);
  417|       |
  418|  4.64k|   m_rdn = std::move(rdns);
  419|  4.64k|   m_dn_bits = std::move(bits);
  420|  4.64k|   m_canonical_dn_bits = std::move(canonical_bits);
  421|  4.64k|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_115canonicalize_dnERKNSt3__16vectorINS2_INS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEENS7_IS9_EEEE:
  275|  2.07k|std::vector<uint8_t> canonicalize_dn(const std::vector<std::vector<std::pair<OID, ASN1_String>>>& rdns) {
  276|  2.07k|   auto append_canonical_data = []<typename T>(std::vector<uint8_t>& out, const T& data) {
  277|  2.07k|      const std::array<uint8_t, 8> data_len = store_le(static_cast<uint64_t>(data.size()));
  278|  2.07k|      out.insert(out.end(), data_len.begin(), data_len.end());
  279|  2.07k|      out.insert(out.end(), data.begin(), data.end());
  280|  2.07k|   };
  281|       |
  282|  2.07k|   std::vector<uint8_t> canonical_bits;
  283|       |
  284|  10.3k|   for(const auto& rdn : rdns) {
  ------------------
  |  Branch (284:24): [True: 10.3k, False: 2.07k]
  ------------------
  285|  10.3k|      std::vector<uint8_t> rdn_bits;
  286|       |
  287|  45.2k|      for(const auto& [oid, value] : canonicalize_rdn(rdn)) {
  ------------------
  |  Branch (287:36): [True: 45.2k, False: 10.3k]
  ------------------
  288|  45.2k|         append_canonical_data(rdn_bits, oid.BER_encode());
  289|  45.2k|         append_canonical_data(rdn_bits, value);
  290|  45.2k|      }
  291|       |
  292|  10.3k|      append_canonical_data(canonical_bits, rdn_bits);
  293|  10.3k|   }
  294|       |
  295|  2.07k|   return canonical_bits;
  296|  2.07k|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_116canonicalize_rdnERKNSt3__16vectorINS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEE:
  263|  10.3k|std::vector<std::pair<OID, std::string>> canonicalize_rdn(const std::vector<std::pair<OID, ASN1_String>>& rdn) {
  264|  10.3k|   std::vector<std::pair<OID, std::string>> result;
  265|  10.3k|   result.reserve(rdn.size());
  266|  45.2k|   for(const auto& ava : rdn) {
  ------------------
  |  Branch (266:24): [True: 45.2k, False: 10.3k]
  ------------------
  267|  45.2k|      result.emplace_back(ava.first, X500_Char_Iterator::canonicalize(ava.second.value()));
  268|  45.2k|   }
  269|  10.3k|   if(result.size() != 1) {
  ------------------
  |  Branch (269:7): [True: 5.57k, False: 4.74k]
  ------------------
  270|  5.57k|      std::sort(result.begin(), result.end());
  271|  5.57k|   }
  272|  10.3k|   return result;
  273|  10.3k|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_118X500_Char_Iterator12canonicalizeENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   79|  45.2k|      static std::string canonicalize(std::string_view name) {
   80|  45.2k|         std::string result;
   81|  45.2k|         result.reserve(name.size());
   82|       |
   83|  45.2k|         X500_Char_Iterator it(name);
   84|   428k|         while(auto c = it.next()) {
  ------------------
  |  Branch (84:21): [True: 383k, False: 45.2k]
  ------------------
   85|   383k|            result += *c;
   86|   383k|         }
   87|       |
   88|  45.2k|         return result;
   89|  45.2k|      }
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_118X500_Char_IteratorC2ENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   46|  45.2k|      explicit X500_Char_Iterator(std::string_view s) : m_str(s), m_pos(0) {
   47|       |         // Skip leading whitespace
   48|  47.2k|         while(m_pos < m_str.size() && is_space(m_str[m_pos])) {
  ------------------
  |  Branch (48:16): [True: 12.1k, False: 35.0k]
  |  Branch (48:40): [True: 1.92k, False: 10.2k]
  ------------------
   49|  1.92k|            ++m_pos;
   50|  1.92k|         }
   51|  45.2k|      }
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_118X500_Char_Iterator4nextEv:
   54|   428k|      std::optional<char> next() {
   55|   428k|         if(m_pos >= m_str.size()) {
  ------------------
  |  Branch (55:13): [True: 45.1k, False: 383k]
  ------------------
   56|  45.1k|            return std::nullopt;
   57|  45.1k|         }
   58|       |
   59|   383k|         if(is_space(m_str[m_pos])) {
  ------------------
  |  Branch (59:13): [True: 5.52k, False: 378k]
  ------------------
   60|       |            // Skip the entire whitespace run
   61|  32.9k|            while(m_pos < m_str.size() && is_space(m_str[m_pos])) {
  ------------------
  |  Branch (61:19): [True: 32.8k, False: 102]
  |  Branch (61:43): [True: 27.4k, False: 5.42k]
  ------------------
   62|  27.4k|               ++m_pos;
   63|  27.4k|            }
   64|       |            // Emit a single space only if more content follows (strip trailing ws)
   65|  5.52k|            if(m_pos < m_str.size()) {
  ------------------
  |  Branch (65:16): [True: 5.42k, False: 102]
  ------------------
   66|  5.42k|               return ' ';
   67|  5.42k|            }
   68|    102|            return std::nullopt;
   69|  5.52k|         }
   70|       |
   71|   378k|         const char c = m_str[m_pos++];
   72|       |         // Locale-independent ASCII fold; RFC 5280 DN matching does not depend on libc locale
   73|   378k|         if(c >= 'A' && c <= 'Z') {
  ------------------
  |  Branch (73:13): [True: 11.8k, False: 366k]
  |  Branch (73:25): [True: 4.68k, False: 7.19k]
  ------------------
   74|  4.68k|            return static_cast<char>(c + ('a' - 'A'));
   75|  4.68k|         }
   76|   373k|         return c;
   77|   378k|      }
x509_dn.cpp:_ZZN5Botan12_GLOBAL__N_115canonicalize_dnERKNSt3__16vectorINS2_INS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEENS7_IS9_EEEEENK3$_0clINS2_IhNS7_IhEEEEEEDaRSH_RKT_:
  276|  55.6k|   auto append_canonical_data = []<typename T>(std::vector<uint8_t>& out, const T& data) {
  277|  55.6k|      const std::array<uint8_t, 8> data_len = store_le(static_cast<uint64_t>(data.size()));
  278|  55.6k|      out.insert(out.end(), data_len.begin(), data_len.end());
  279|  55.6k|      out.insert(out.end(), data.begin(), data.end());
  280|  55.6k|   };
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_:
  276|  45.2k|   auto append_canonical_data = []<typename T>(std::vector<uint8_t>& out, const T& data) {
  277|  45.2k|      const std::array<uint8_t, 8> data_len = store_le(static_cast<uint64_t>(data.size()));
  278|  45.2k|      out.insert(out.end(), data_len.begin(), data_len.end());
  279|  45.2k|      out.insert(out.end(), data.begin(), data.end());
  280|  45.2k|   };
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_18is_spaceEc:
   25|   428k|bool is_space(char c) {
   26|   428k|   return c == ' ' || c == '\t';
  ------------------
  |  Branch (26:11): [True: 16.8k, False: 411k]
  |  Branch (26:23): [True: 18.0k, False: 393k]
  ------------------
   27|   428k|}

