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

_ZN5Botan13reverse_bytesITkNSt3__117unsigned_integralEtQooooooeqstT_Li1EeqstS2_Li2EeqstS2_Li4EeqstS2_Li8EEES2_S2_:
   27|  25.1k|inline constexpr T reverse_bytes(T x) {
   28|       |   if constexpr(sizeof(T) == 1) {
   29|       |      return x;
   30|  25.1k|   } else if constexpr(sizeof(T) == 2) {
   31|  25.1k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap16)
   32|  25.1k|      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|  25.1k|}
_ZN5Botan13reverse_bytesITkNSt3__117unsigned_integralEjQooooooeqstT_Li1EeqstS2_Li2EeqstS2_Li4EeqstS2_Li8EEES2_S2_:
   27|  2.45k|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|  2.45k|   } else if constexpr(sizeof(T) == 4) {
   37|  2.45k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap32)
   38|  2.45k|      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|  2.45k|}

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

_ZN5Botan10fmt_detail6do_fmtERNSt3__119basic_ostringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EE:
   20|  3.10k|inline void do_fmt(std::ostringstream& oss, std::string_view format) {
   21|  3.10k|   oss << format;
   22|  3.10k|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   53|  2.71k|std::string fmt(std::string_view format, const T&... args) {
   54|  2.71k|   std::ostringstream oss;
   55|  2.71k|   oss.imbue(std::locale::classic());
   56|  2.71k|   fmt_detail::do_fmt(oss, format, args...);
   57|  2.71k|   return oss.str();
   58|  2.71k|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   25|  2.71k|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|  2.71k|   size_t i = 0;
   27|       |
   28|  16.2k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 16.2k, False: 0]
  ------------------
   29|  16.2k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 2.71k, False: 13.5k]
  |  Branch (29:30): [True: 2.71k, False: 0]
  |  Branch (29:59): [True: 2.71k, False: 0]
  ------------------
   30|  2.71k|         oss << val;
   31|  2.71k|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  13.5k|      } else {
   33|  13.5k|         oss << format[i];
   34|  13.5k|      }
   35|       |
   36|  13.5k|      i += 1;
   37|  13.5k|   }
   38|  2.71k|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEjEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   53|    117|std::string fmt(std::string_view format, const T&... args) {
   54|    117|   std::ostringstream oss;
   55|    117|   oss.imbue(std::locale::classic());
   56|    117|   fmt_detail::do_fmt(oss, format, args...);
   57|    117|   return oss.str();
   58|    117|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJjEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   25|    117|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    117|   size_t i = 0;
   27|       |
   28|    117|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 117, False: 0]
  ------------------
   29|    117|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 117, False: 0]
  |  Branch (29:30): [True: 117, False: 0]
  |  Branch (29:59): [True: 117, False: 0]
  ------------------
   30|    117|         oss << val;
   31|    117|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|    117|      } else {
   33|      0|         oss << format[i];
   34|      0|      }
   35|       |
   36|      0|      i += 1;
   37|      0|   }
   38|    117|}
_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|    717|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 717, False: 0]
  ------------------
   29|    717|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 300, False: 417]
  |  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|    417|      } else {
   33|    417|         oss << format[i];
   34|    417|      }
   35|       |
   36|    417|      i += 1;
   37|    417|   }
   38|    300|}
_ZN5Botan3fmtIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEES7_NS1_17basic_string_viewIcS4_EEDpRKT_:
   53|     91|std::string fmt(std::string_view format, const T&... args) {
   54|     91|   std::ostringstream oss;
   55|     91|   oss.imbue(std::locale::classic());
   56|     91|   fmt_detail::do_fmt(oss, format, args...);
   57|     91|   return oss.str();
   58|     91|}
_ZN5Botan10fmt_detail6do_fmtINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_S7_EENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|     91|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|     91|   size_t i = 0;
   27|       |
   28|  2.00k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 2.00k, False: 0]
  ------------------
   29|  2.00k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 91, False: 1.91k]
  |  Branch (29:30): [True: 91, False: 0]
  |  Branch (29:59): [True: 91, False: 0]
  ------------------
   30|     91|         oss << val;
   31|     91|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  1.91k|      } else {
   33|  1.91k|         oss << format[i];
   34|  1.91k|      }
   35|       |
   36|  1.91k|      i += 1;
   37|  1.91k|   }
   38|     91|}
_ZN5Botan3fmtIJjjEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EEDpRKT_:
   53|    183|std::string fmt(std::string_view format, const T&... args) {
   54|    183|   std::ostringstream oss;
   55|    183|   oss.imbue(std::locale::classic());
   56|    183|   fmt_detail::do_fmt(oss, format, args...);
   57|    183|   return oss.str();
   58|    183|}
_ZN5Botan10fmt_detail6do_fmtIjJjEEEvRNSt3__119basic_ostringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    183|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    183|   size_t i = 0;
   27|       |
   28|  6.22k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 6.22k, False: 0]
  ------------------
   29|  6.22k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 183, False: 6.03k]
  |  Branch (29:30): [True: 183, False: 0]
  |  Branch (29:59): [True: 183, False: 0]
  ------------------
   30|    183|         oss << val;
   31|    183|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  6.03k|      } else {
   33|  6.03k|         oss << format[i];
   34|  6.03k|      }
   35|       |
   36|  6.03k|      i += 1;
   37|  6.03k|   }
   38|    183|}

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

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

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

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

_ZN5Botan11ASN1_ObjectC2Ev:
  146|   140k|      ASN1_Object() = default;
_ZN5Botan11ASN1_ObjectD2Ev:
  168|   506k|      virtual ~ASN1_Object() = default;
_ZNK5Botan10BER_Object6is_setEv:
  267|   509k|      bool is_set() const { return m_type_tag != ASN1_Type::NoObject; }
_ZNK5Botan10BER_Object7taggingEv:
  272|   277k|      uint32_t tagging() const { return type_tag() | class_tag(); }
_ZNK5Botan10BER_Object8type_tagEv:
  277|   277k|      ASN1_Type type_tag() const { return m_type_tag; }
_ZNK5Botan10BER_Object9class_tagEv:
  282|   277k|      ASN1_Class class_tag() const { return m_class_tag; }
_ZNK5Botan10BER_Object4typeEv:
  287|   130k|      ASN1_Type type() const { return m_type_tag; }
_ZNK5Botan10BER_Object9get_classEv:
  292|  65.3k|      ASN1_Class get_class() const { return m_class_tag; }
_ZNK5Botan10BER_Object4bitsEv:
  298|  2.30M|      const uint8_t* bits() const { return m_value.data(); }
_ZNK5Botan10BER_Object6lengthEv:
  303|  5.01M|      size_t length() const { return m_value.size(); }
_ZNK5Botan10BER_Object4dataEv:
  308|   108k|      std::span<const uint8_t> data() const { return std::span{m_value}; }
_ZN5Botan10BER_Object12mutable_bitsEm:
  344|   211k|      uint8_t* mutable_bits(size_t length) {
  345|   211k|         m_value.resize(length);
  346|   211k|         return m_value.data();
  347|   211k|      }
_ZNK5Botan3OID14get_componentsEv:
  530|   621k|      const std::vector<uint32_t>& get_components() const {
  531|   621k|         return m_id;
  532|   621k|      }
_ZNK5Botan11ASN1_String5valueEv:
  590|  61.7k|      const std::string& value() const { return m_utf8_str; }
_ZN5BotanorENS_10ASN1_ClassES0_:
   91|  82.4k|inline ASN1_Class operator|(ASN1_Class x, ASN1_Class y) {
   92|  82.4k|   return static_cast<ASN1_Class>(static_cast<uint32_t>(x) | static_cast<uint32_t>(y));
   93|  82.4k|}
_ZN5BotanorENS_9ASN1_TypeENS_10ASN1_ClassE:
   98|   277k|inline uint32_t operator|(ASN1_Type x, ASN1_Class y) {
   99|   277k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
  100|   277k|}
_ZN5BotanorENS_10ASN1_ClassENS_9ASN1_TypeE:
  105|  65.3k|inline uint32_t operator|(ASN1_Class x, ASN1_Type y) {
  106|  65.3k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
  107|  65.3k|}
_ZN5Botan10BER_ObjectC2Ev:
  239|   300k|      BER_Object() = default;
_ZN5Botan10BER_ObjectC2EOS0_:
  249|  80.8k|      BER_Object(BER_Object&& other) = default;
_ZN5Botan11ASN1_ObjectC2ERKS0_:
  151|  61.7k|      ASN1_Object(const ASN1_Object&) = default;
_ZN5Botan11ASN1_ObjectC2EOS0_:
  161|   303k|      ASN1_Object(ASN1_Object&&) = default;
_ZN5Botan11ASN1_ObjectaSEOS0_:
  166|   117k|      ASN1_Object& operator=(ASN1_Object&&) = default;
_ZN5Botan3OIDC2Ev:
  423|  65.5k|      explicit OID() = default;

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

_ZN5Botan11BER_Decoder6Limits3BEREm:
   49|  3.22k|            static Limits BER(size_t max_nested_indef = 16) {
   50|  3.22k|               return Limits(true, max_nested_indef, false, DefaultMaxObjectSize, false);
   51|  3.22k|            }
_ZN5Botan11BER_Decoder6LimitsC2EbmbNSt3__18optionalImEEb:
  133|  3.22k|                  m_allow_ber(allow_ber),
  134|  3.22k|                  m_max_nested_indef(max_nested_indef),
  135|  3.22k|                  m_allow_standalone_eoc(allow_standalone_eoc),
  136|  3.22k|                  m_max_object_size(max_object_size),
  137|  3.22k|                  m_reject_default_value_encoding(reject_default_value_encoding) {}
_ZNK5Botan11BER_Decoder6Limits18allow_ber_encodingEv:
   56|   505k|            bool allow_ber_encoding() const { return m_allow_ber; }
_ZNK5Botan11BER_Decoder6Limits20require_der_encodingEv:
   61|   293k|            bool require_der_encoding() const { return !allow_ber_encoding(); }
_ZNK5Botan11BER_Decoder6Limits28max_nested_indefinite_lengthEv:
   66|   212k|            size_t max_nested_indefinite_length() const { return m_max_nested_indef; }
_ZNK5Botan11BER_Decoder6Limits20allow_standalone_eocEv:
   74|     91|            bool allow_standalone_eoc() const { return m_allow_standalone_eoc; }
_ZNK5Botan11BER_Decoder6Limits15max_object_sizeEv:
   80|   211k|            std::optional<size_t> max_object_size() const { return m_max_object_size; }
_ZNK5Botan11BER_Decoder6limitsEv:
  197|  83.6k|      Limits limits() const { return m_limits; }
_ZN5Botan11BER_Decoder14start_sequenceEv:
  275|  70.7k|      BER_Decoder start_sequence() { return start_cons(ASN1_Type::Sequence, ASN1_Class::Universal); }
_ZN5Botan11BER_Decoder9start_setEv:
  281|  12.6k|      BER_Decoder start_set() { return start_cons(ASN1_Type::Set, ASN1_Class::Universal); }
_ZN5Botan11BER_Decoder9raw_bytesINSt3__19allocatorIhEEEERS0_RNS2_6vectorIhT_EE:
  338|  2.83k|      BER_Decoder& raw_bytes(std::vector<uint8_t, Alloc>& out) {
  339|  2.83k|         out.clear();
  340|  1.19M|         for(;;) {
  341|  1.19M|            if(auto next = this->read_next_byte()) {
  ------------------
  |  Branch (341:21): [True: 1.19M, False: 2.83k]
  ------------------
  342|  1.19M|               out.push_back(*next);
  343|  1.19M|            } else {
  344|  2.83k|               break;
  345|  2.83k|            }
  346|  1.19M|         }
  347|  2.83k|         return (*this);
  348|  2.83k|      }

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

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

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

_ZN5Botan7X509_DNC2Ev:
  159|  9.68k|      X509_DN() = default;
_ZNK5Botan7X509_DN16_canonical_bytesEv:
  274|  4.53k|      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|   267k|{
  101|   267k|   const std::span s0{r0};
  102|       |
  103|   267k|   if constexpr(statically_spanable_range<R0>) {
  104|   267k|      constexpr size_t expected_size = s0.size_bytes();
  105|   267k|      (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|   267k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__15arrayImLm1EEEEEvRKT0_:
   77|   267k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|   267k|   const std::span s{r};
   79|   267k|   if constexpr(statically_spanable_range<R>) {
   80|   267k|      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|   267k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__15arrayIhLm8EEEEEmRKT_:
   59|   133k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|   133k|   return std::span{r}.size_bytes();
   61|   133k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__16vectorIhNS2_9allocatorIhEEEEEEmRKT_:
   59|   381k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|   381k|   return std::span{r}.size_bytes();
   61|   381k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm2ETkNS0_14spanable_rangeENSt3__14spanIKhLm2EEEEEvRKT0_:
   77|  50.2k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  50.2k|   const std::span s{r};
   79|  50.2k|   if constexpr(statically_spanable_range<R>) {
   80|  50.2k|      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|  50.2k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanItLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm2EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  25.1k|{
  101|  25.1k|   const std::span s0{r0};
  102|       |
  103|  25.1k|   if constexpr(statically_spanable_range<R0>) {
  104|  25.1k|      constexpr size_t expected_size = s0.size_bytes();
  105|  25.1k|      (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|  25.1k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanItLm1EEEEEmRKT_:
   59|  25.1k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  25.1k|   return std::span{r}.size_bytes();
   61|  25.1k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm4ETkNS0_14spanable_rangeENSt3__14spanIKhLm4EEEEEvRKT0_:
   77|  4.90k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  4.90k|   const std::span s{r};
   79|  4.90k|   if constexpr(statically_spanable_range<R>) {
   80|  4.90k|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   81|       |   } else {
   82|       |      if(s.size_bytes() != expected) {
   83|       |         memory_region_size_violation();
   84|       |      }
   85|       |   }
   86|  4.90k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIjLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm4EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  2.45k|{
  101|  2.45k|   const std::span s0{r0};
  102|       |
  103|  2.45k|   if constexpr(statically_spanable_range<R0>) {
  104|  2.45k|      constexpr size_t expected_size = s0.size_bytes();
  105|  2.45k|      (assert_exact_byte_length<expected_size>(rs), ...);
  106|       |   } else {
  107|       |      const size_t expected_size = s0.size_bytes();
  108|       |      const bool correct_size =
  109|       |         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|       |      if(!correct_size) {
  112|       |         memory_region_size_violation();
  113|       |      }
  114|       |   }
  115|  2.45k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIjLm1EEEEEmRKT_:
   59|  2.45k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  2.45k|   return std::span{r}.size_bytes();
   61|  2.45k|}

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

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

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

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

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

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

_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEENS_9ASN1_TypeE:
  135|  65.5k|ASN1_String::ASN1_String(std::string_view str, ASN1_Type t) : m_utf8_str(str), m_tag(t) {
  136|  65.5k|   if(!is_utf8_subset_string_type(m_tag)) {
  ------------------
  |  Branch (136:7): [True: 0, False: 65.5k]
  ------------------
  137|      0|      throw Invalid_Argument("ASN1_String only supports encoding to UTF-8 or a UTF-8 subset");
  138|      0|   }
  139|       |
  140|  65.5k|   if(!is_valid_asn1_string_content(m_utf8_str, m_tag)) {
  ------------------
  |  Branch (140:7): [True: 0, False: 65.5k]
  ------------------
  141|      0|      throw Invalid_Argument(fmt("ASN1_String: Invalid {} encoding", asn1_tag_to_string(m_tag)));
  142|      0|   }
  143|  65.5k|}
_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  145|  65.5k|ASN1_String::ASN1_String(std::string_view str) : ASN1_String(str, choose_encoding(str)) {}
_ZN5Botan11ASN1_String11decode_fromERNS_11BER_DecoderE:
  162|  65.1k|void ASN1_String::decode_from(BER_Decoder& source) {
  163|  65.1k|   const BER_Object obj = source.get_next_object();
  164|       |
  165|  65.1k|   if(obj.get_class() != ASN1_Class::Universal || !is_asn1_string_type(obj.type())) {
  ------------------
  |  Branch (165:7): [True: 106, False: 65.0k]
  |  Branch (165:51): [True: 87, False: 65.0k]
  ------------------
  166|    183|      auto typ = static_cast<uint32_t>(obj.type());
  167|    183|      auto cls = static_cast<uint32_t>(obj.get_class());
  168|    183|      throw Decoding_Error(fmt("ASN1_String: Unknown string type {}/{}", typ, cls));
  169|    183|   }
  170|       |
  171|  65.0k|   m_tag = obj.type();
  172|  65.0k|   m_data.assign(obj.bits(), obj.bits() + obj.length());
  173|       |
  174|  65.0k|   if(m_tag == ASN1_Type::BmpString) {
  ------------------
  |  Branch (174:7): [True: 4.09k, False: 60.9k]
  ------------------
  175|  4.09k|      m_utf8_str = ucs2_to_utf8(m_data);
  176|  60.9k|   } else if(m_tag == ASN1_Type::UniversalString) {
  ------------------
  |  Branch (176:14): [True: 4.47k, False: 56.4k]
  ------------------
  177|  4.47k|      m_utf8_str = ucs4_to_utf8(m_data);
  178|  56.4k|   } else if(m_tag == ASN1_Type::TeletexString) {
  ------------------
  |  Branch (178:14): [True: 13.6k, False: 42.8k]
  ------------------
  179|       |      /*
  180|       |      TeletexString is nominally ITU T.61 not ISO-8859-1 but it seems
  181|       |      the majority of implementations actually used that charset here.
  182|       |      */
  183|  13.6k|      m_utf8_str = latin1_to_utf8(m_data);
  184|  42.8k|   } else {
  185|       |      // All other supported string types are UTF-8 or some subset thereof
  186|  42.8k|      m_utf8_str = ASN1::to_string(obj);
  187|       |
  188|  42.8k|      if(!is_valid_asn1_string_content(m_utf8_str, m_tag)) {
  ------------------
  |  Branch (188:10): [True: 91, False: 42.7k]
  ------------------
  189|     91|         throw Decoding_Error(fmt("ASN1_String: Invalid {} encoding", asn1_tag_to_string(m_tag)));
  190|     91|      }
  191|  42.8k|   }
  192|  65.0k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_119is_asn1_string_typeENS_9ASN1_TypeE:
   99|  65.0k|bool is_asn1_string_type(ASN1_Type tag) {
  100|  65.0k|   return (is_utf8_subset_string_type(tag) || tag == ASN1_Type::TeletexString || tag == ASN1_Type::BmpString ||
  ------------------
  |  Branch (100:12): [True: 42.8k, False: 22.2k]
  |  Branch (100:47): [True: 13.6k, False: 8.65k]
  |  Branch (100:82): [True: 4.09k, False: 4.56k]
  ------------------
  101|  4.56k|           tag == ASN1_Type::UniversalString);
  ------------------
  |  Branch (101:12): [True: 4.47k, False: 87]
  ------------------
  102|  65.0k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_126is_utf8_subset_string_typeENS_9ASN1_TypeE:
   94|   238k|bool is_utf8_subset_string_type(ASN1_Type tag) {
   95|   238k|   return (tag == ASN1_Type::NumericString || tag == ASN1_Type::PrintableString || tag == ASN1_Type::VisibleString ||
  ------------------
  |  Branch (95:12): [True: 2.87k, False: 236k]
  |  Branch (95:47): [True: 196k, False: 39.4k]
  |  Branch (95:84): [True: 2.74k, False: 36.7k]
  ------------------
   96|  36.7k|           tag == ASN1_Type::Ia5String || tag == ASN1_Type::Utf8String);
  ------------------
  |  Branch (96:12): [True: 6.32k, False: 30.3k]
  |  Branch (96:43): [True: 8.12k, False: 22.2k]
  ------------------
   97|   238k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_128is_valid_asn1_string_contentERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_9ASN1_TypeE:
  104|   108k|bool is_valid_asn1_string_content(const std::string& str, ASN1_Type tag) {
  105|   108k|   BOTAN_ASSERT_NOMSG(is_utf8_subset_string_type(tag));
  ------------------
  |  |   77|   108k|   do {                                                                     \
  |  |   78|   108k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|   108k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 108k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|   108k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 108k]
  |  |  ------------------
  ------------------
  106|       |
  107|   108k|   switch(tag) {
  108|  4.06k|      case ASN1_Type::Utf8String:
  ------------------
  |  Branch (108:7): [True: 4.06k, False: 104k]
  ------------------
  109|  4.06k|         return is_valid_utf8(str);
  110|  1.43k|      case ASN1_Type::NumericString:
  ------------------
  |  Branch (110:7): [True: 1.43k, False: 106k]
  ------------------
  111|  99.7k|      case ASN1_Type::PrintableString:
  ------------------
  |  Branch (111:7): [True: 98.3k, False: 10.0k]
  ------------------
  112|   102k|      case ASN1_Type::Ia5String:
  ------------------
  |  Branch (112:7): [True: 3.16k, False: 105k]
  ------------------
  113|   104k|      case ASN1_Type::VisibleString:
  ------------------
  |  Branch (113:7): [True: 1.37k, False: 106k]
  ------------------
  114|   104k|         return g_char_validator.valid_encoding(str, tag);
  115|      0|      default:
  ------------------
  |  Branch (115:7): [True: 0, False: 108k]
  ------------------
  116|      0|         return false;
  117|   108k|   }
  118|   108k|}
asn1_str.cpp:_ZNK5Botan12_GLOBAL__N_131ASN1_String_Codepoint_Validator14valid_encodingENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_9ASN1_TypeE:
   25|   169k|      constexpr bool valid_encoding(std::string_view str, ASN1_Type tag) const {
   26|   169k|         const uint8_t mask = mask_for(tag);
   27|   169k|         for(const char c : str) {
  ------------------
  |  Branch (27:27): [True: 6.12k, False: 169k]
  ------------------
   28|  6.12k|            const uint8_t codepoint = static_cast<uint8_t>(c);
   29|  6.12k|            const bool is_valid = (m_table[codepoint] & mask) != 0;
   30|       |
   31|  6.12k|            if(!is_valid) {
  ------------------
  |  Branch (31:16): [True: 24, False: 6.10k]
  ------------------
   32|     24|               return false;
   33|     24|            }
   34|  6.12k|         }
   35|       |
   36|   169k|         return true;
   37|   169k|      }
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_131ASN1_String_Codepoint_Validator8mask_forENS_9ASN1_TypeE:
   45|   169k|      static constexpr uint8_t mask_for(ASN1_Type tag) {
   46|   169k|         switch(tag) {
   47|  1.43k|            case ASN1_Type::NumericString:
  ------------------
  |  Branch (47:13): [True: 1.43k, False: 168k]
  ------------------
   48|  1.43k|               return Numeric_String;
   49|   163k|            case ASN1_Type::PrintableString:
  ------------------
  |  Branch (49:13): [True: 163k, False: 5.97k]
  ------------------
   50|   163k|               return Printable_String;
   51|  3.16k|            case ASN1_Type::Ia5String:
  ------------------
  |  Branch (51:13): [True: 3.16k, False: 166k]
  ------------------
   52|  3.16k|               return IA5_String;
   53|  1.37k|            case ASN1_Type::VisibleString:
  ------------------
  |  Branch (53:13): [True: 1.37k, False: 168k]
  ------------------
   54|  1.37k|               return Visible_String;
   55|      0|            default:
  ------------------
  |  Branch (55:13): [True: 0, False: 169k]
  ------------------
   56|      0|               return 0;
   57|   169k|         }
   58|   169k|      }
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_115choose_encodingENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  120|  65.5k|ASN1_Type choose_encoding(std::string_view str) {
  121|  65.5k|   if(g_char_validator.valid_encoding(str, ASN1_Type::PrintableString)) {
  ------------------
  |  Branch (121:7): [True: 65.5k, False: 0]
  ------------------
  122|  65.5k|      return ASN1_Type::PrintableString;
  123|  65.5k|   } else {
  124|      0|      return ASN1_Type::Utf8String;
  125|      0|   }
  126|  65.5k|}

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

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

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

_ZN5Botan19next_utf8_codepointENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEERm:
   53|  24.7k|uint32_t next_utf8_codepoint(std::string_view utf8, size_t& pos) {
   54|  24.7k|   auto read_continuation = [&]() -> uint32_t {
   55|  24.7k|      if(pos >= utf8.size()) {
   56|  24.7k|         throw Decoding_Error("Invalid UTF-8 sequence");
   57|  24.7k|      }
   58|  24.7k|      const uint8_t b = static_cast<uint8_t>(utf8[pos++]);
   59|  24.7k|      if((b & 0xC0) != 0x80) {
   60|  24.7k|         throw Decoding_Error("Invalid UTF-8 sequence");
   61|  24.7k|      }
   62|  24.7k|      return b & 0x3F;
   63|  24.7k|   };
   64|       |
   65|  24.7k|   if(pos >= utf8.size()) {
  ------------------
  |  Branch (65:7): [True: 0, False: 24.7k]
  ------------------
   66|      0|      throw Decoding_Error("Invalid UTF-8 sequence");
   67|      0|   }
   68|  24.7k|   const uint8_t lead = static_cast<uint8_t>(utf8[pos++]);
   69|  24.7k|   uint32_t c = 0;
   70|       |
   71|  24.7k|   if(lead <= 0x7F) {
  ------------------
  |  Branch (71:7): [True: 22.0k, False: 2.62k]
  ------------------
   72|  22.0k|      c = lead;
   73|  22.0k|   } else if((lead & 0xE0) == 0xC0) {
  ------------------
  |  Branch (73:14): [True: 1.50k, False: 1.12k]
  ------------------
   74|  1.50k|      c = (lead & 0x1F) << 6;
   75|  1.50k|      c |= read_continuation();
   76|  1.50k|      if(c < 0x80) {
  ------------------
  |  Branch (76:10): [True: 2, False: 1.49k]
  ------------------
   77|      2|         throw Decoding_Error("Overlong UTF-8 sequence");
   78|      2|      }
   79|  1.50k|   } else if((lead & 0xF0) == 0xE0) {
  ------------------
  |  Branch (79:14): [True: 589, False: 534]
  ------------------
   80|    589|      c = (lead & 0x0F) << 12;
   81|    589|      c |= read_continuation() << 6;
   82|    589|      c |= read_continuation();
   83|    589|      if(c < 0x800) {
  ------------------
  |  Branch (83:10): [True: 6, False: 583]
  ------------------
   84|      6|         throw Decoding_Error("Overlong UTF-8 sequence");
   85|      6|      }
   86|    589|   } else if((lead & 0xF8) == 0xF0) {
  ------------------
  |  Branch (86:14): [True: 517, False: 17]
  ------------------
   87|    517|      c = (lead & 0x07) << 18;
   88|    517|      c |= read_continuation() << 12;
   89|    517|      c |= read_continuation() << 6;
   90|    517|      c |= read_continuation();
   91|    517|      if(c < 0x10000) {
  ------------------
  |  Branch (91:10): [True: 5, False: 512]
  ------------------
   92|      5|         throw Decoding_Error("Overlong UTF-8 sequence");
   93|      5|      }
   94|    517|   } else {
   95|     17|      throw Decoding_Error("Invalid UTF-8 sequence");
   96|     17|   }
   97|       |
   98|  24.6k|   if(c > 0x10FFFF) {
  ------------------
  |  Branch (98:7): [True: 4, False: 24.6k]
  ------------------
   99|      4|      throw Decoding_Error("UTF-8 sequence encodes value outside Unicode range");
  100|      4|   }
  101|  24.6k|   if(c >= 0xD800 && c < 0xE000) {
  ------------------
  |  Branch (101:7): [True: 1.00k, False: 23.6k]
  |  Branch (101:22): [True: 15, False: 986]
  ------------------
  102|     15|      throw Decoding_Error("UTF-8 sequence encodes surrogate code point");
  103|     15|   }
  104|       |
  105|  24.6k|   return c;
  106|  24.6k|}
_ZN5Botan13is_valid_utf8ENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  108|  4.06k|bool is_valid_utf8(std::string_view utf8) {
  109|  4.06k|   try {
  110|  4.06k|      size_t pos = 0;
  111|  28.7k|      while(pos < utf8.size()) {
  ------------------
  |  Branch (111:13): [True: 24.7k, False: 4.06k]
  ------------------
  112|  24.7k|         const uint32_t c = next_utf8_codepoint(utf8, pos);
  113|  24.7k|         BOTAN_UNUSED(c);
  ------------------
  |  |  144|  24.7k|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
  114|  24.7k|      }
  115|  4.06k|   } catch(Decoding_Error&) {
  116|     67|      return false;
  117|     67|   }
  118|  3.99k|   return true;
  119|  4.06k|}
_ZN5Botan12ucs2_to_utf8ENSt3__14spanIKhLm18446744073709551615EEE:
  121|  4.09k|std::string ucs2_to_utf8(std::span<const uint8_t> ucs2) {
  122|  4.09k|   if(ucs2.size() % 2 != 0) {
  ------------------
  |  Branch (122:7): [True: 2, False: 4.09k]
  ------------------
  123|      2|      throw Decoding_Error("Invalid length for UCS-2 string");
  124|      2|   }
  125|       |
  126|  4.09k|   const size_t chars = ucs2.size() / 2;
  127|       |
  128|  4.09k|   std::string s;
  129|  29.2k|   for(size_t i = 0; i != chars; ++i) {
  ------------------
  |  Branch (129:22): [True: 25.1k, False: 4.09k]
  ------------------
  130|  25.1k|      const uint32_t c = load_be<uint16_t>(ucs2.data(), i);
  131|  25.1k|      append_utf8_for(s, c);
  132|  25.1k|   }
  133|       |
  134|  4.09k|   return s;
  135|  4.09k|}
_ZN5Botan12ucs4_to_utf8ENSt3__14spanIKhLm18446744073709551615EEE:
  155|  4.47k|std::string ucs4_to_utf8(std::span<const uint8_t> ucs4) {
  156|  4.47k|   if(ucs4.size() % 4 != 0) {
  ------------------
  |  Branch (156:7): [True: 3, False: 4.47k]
  ------------------
  157|      3|      throw Decoding_Error("Invalid length for UCS-4 string");
  158|      3|   }
  159|       |
  160|  4.47k|   const size_t chars = ucs4.size() / 4;
  161|       |
  162|  4.47k|   std::string s;
  163|  6.92k|   for(size_t i = 0; i != chars; ++i) {
  ------------------
  |  Branch (163:22): [True: 2.45k, False: 4.47k]
  ------------------
  164|  2.45k|      const uint32_t c = load_be<uint32_t>(ucs4.data(), i);
  165|  2.45k|      append_utf8_for(s, c);
  166|  2.45k|   }
  167|       |
  168|  4.47k|   return s;
  169|  4.47k|}
_ZN5Botan14latin1_to_utf8ENSt3__14spanIKhLm18446744073709551615EEE:
  190|  13.6k|std::string latin1_to_utf8(std::span<const uint8_t> chars) {
  191|  13.6k|   std::string s;
  192|   265k|   for(const uint8_t b : chars) {
  ------------------
  |  Branch (192:24): [True: 265k, False: 13.6k]
  ------------------
  193|   265k|      append_utf8_for(s, static_cast<uint32_t>(b));
  194|   265k|   }
  195|  13.6k|   return s;
  196|  13.6k|}
charset.cpp:_ZZN5Botan19next_utf8_codepointENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEERmENK3$_0clEv:
   54|  4.21k|   auto read_continuation = [&]() -> uint32_t {
   55|  4.21k|      if(pos >= utf8.size()) {
  ------------------
  |  Branch (55:10): [True: 7, False: 4.21k]
  ------------------
   56|      7|         throw Decoding_Error("Invalid UTF-8 sequence");
   57|      7|      }
   58|  4.21k|      const uint8_t b = static_cast<uint8_t>(utf8[pos++]);
   59|  4.21k|      if((b & 0xC0) != 0x80) {
  ------------------
  |  Branch (59:10): [True: 11, False: 4.20k]
  ------------------
   60|     11|         throw Decoding_Error("Invalid UTF-8 sequence");
   61|     11|      }
   62|  4.20k|      return b & 0x3F;
   63|  4.21k|   };
charset.cpp:_ZN5Botan12_GLOBAL__N_115append_utf8_forERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEj:
   17|   293k|void append_utf8_for(std::string& s, uint32_t c) {
   18|   293k|   if(c >= 0xD800 && c < 0xE000) {
  ------------------
  |  Branch (18:7): [True: 6.34k, False: 287k]
  |  Branch (18:22): [True: 16, False: 6.33k]
  ------------------
   19|     16|      throw Decoding_Error("Invalid Unicode character");
   20|     16|   }
   21|       |
   22|   293k|   if(c <= 0x7F) {
  ------------------
  |  Branch (22:7): [True: 145k, False: 147k]
  ------------------
   23|   145k|      const uint8_t b0 = static_cast<uint8_t>(c);
   24|   145k|      s.push_back(static_cast<char>(b0));
   25|   147k|   } else if(c <= 0x7FF) {
  ------------------
  |  Branch (25:14): [True: 130k, False: 17.2k]
  ------------------
   26|   130k|      const uint8_t b0 = 0xC0 | static_cast<uint8_t>(c >> 6);
   27|   130k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   28|   130k|      s.push_back(static_cast<char>(b0));
   29|   130k|      s.push_back(static_cast<char>(b1));
   30|   130k|   } else if(c <= 0xFFFF) {
  ------------------
  |  Branch (30:14): [True: 15.1k, False: 2.08k]
  ------------------
   31|  15.1k|      const uint8_t b0 = 0xE0 | static_cast<uint8_t>(c >> 12);
   32|  15.1k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>((c >> 6) & 0x3F);
   33|  15.1k|      const uint8_t b2 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   34|  15.1k|      s.push_back(static_cast<char>(b0));
   35|  15.1k|      s.push_back(static_cast<char>(b1));
   36|  15.1k|      s.push_back(static_cast<char>(b2));
   37|  15.1k|   } else if(c <= 0x10FFFF) {
  ------------------
  |  Branch (37:14): [True: 2.04k, False: 49]
  ------------------
   38|  2.04k|      const uint8_t b0 = 0xF0 | static_cast<uint8_t>(c >> 18);
   39|  2.04k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>((c >> 12) & 0x3F);
   40|  2.04k|      const uint8_t b2 = 0x80 | static_cast<uint8_t>((c >> 6) & 0x3F);
   41|  2.04k|      const uint8_t b3 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   42|  2.04k|      s.push_back(static_cast<char>(b0));
   43|  2.04k|      s.push_back(static_cast<char>(b1));
   44|  2.04k|      s.push_back(static_cast<char>(b2));
   45|  2.04k|      s.push_back(static_cast<char>(b3));
   46|  2.04k|   } else {
   47|     49|      throw Decoding_Error("Invalid Unicode character");
   48|     49|   }
   49|   293k|}

_ZN5Botan10DataSource9read_byteERh:
   27|  1.41M|size_t DataSource::read_byte(uint8_t& out) {
   28|  1.41M|   return read(&out, 1);
   29|  1.41M|}
_ZN5Botan10DataSource9read_byteEv:
   34|   215k|std::optional<uint8_t> DataSource::read_byte() {
   35|   215k|   uint8_t b = 0;
   36|   215k|   if(this->read(&b, 1) == 1) {
  ------------------
  |  Branch (36:7): [True: 213k, False: 1.46k]
  ------------------
   37|   213k|      return b;
   38|   213k|   } else {
   39|  1.46k|      return {};
   40|  1.46k|   }
   41|   215k|}
_ZN5Botan17DataSource_Memory4readEPhm:
   73|  64.7k|size_t DataSource_Memory::read(uint8_t out[], size_t length) {
   74|  64.7k|   const size_t got = std::min<size_t>(m_source.size() - m_offset, length);
   75|  64.7k|   copy_mem(out, m_source.data() + m_offset, got);
   76|  64.7k|   m_offset += got;
   77|  64.7k|   return got;
   78|  64.7k|}
_ZN5Botan17DataSource_Memory15check_availableEm:
   80|  15.8k|bool DataSource_Memory::check_available(size_t n) {
   81|  15.8k|   return (n <= (m_source.size() - m_offset));
   82|  15.8k|}
_ZNK5Botan17DataSource_Memory4peekEPhmm:
   87|  1.00M|size_t DataSource_Memory::peek(uint8_t out[], size_t length, size_t peek_offset) const {
   88|  1.00M|   const size_t bytes_left = m_source.size() - m_offset;
   89|  1.00M|   if(peek_offset >= bytes_left) {
  ------------------
  |  Branch (89:7): [True: 288, False: 1.00M]
  ------------------
   90|    288|      return 0;
   91|    288|   }
   92|       |
   93|  1.00M|   const size_t got = std::min(bytes_left - peek_offset, length);
   94|  1.00M|   copy_mem(out, &m_source[m_offset + peek_offset], got);
   95|  1.00M|   return got;
   96|  1.00M|}
_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|  3.21k|Exception::Exception(std::string_view msg) : m_msg(msg) {}
_ZN5Botan14Decoding_ErrorC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  125|  3.21k|Decoding_Error::Decoding_Error(std::string_view name) : Exception(name) {}

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

_ZN5BotaneqERKNS_7X509_DNES2_:
  339|    252|bool operator==(const X509_DN& dn1, const X509_DN& dn2) {
  340|    252|   return dn1._canonical_bytes() == dn2._canonical_bytes();
  341|    252|}
_ZN5BotanltERKNS_7X509_DNES2_:
  354|  2.01k|bool operator<(const X509_DN& dn1, const X509_DN& dn2) {
  355|  2.01k|   return dn1._canonical_bytes() < dn2._canonical_bytes();
  356|  2.01k|}
_ZN5Botan7X509_DN11decode_fromERNS_11BER_DecoderE:
  408|  5.22k|void X509_DN::decode_from(BER_Decoder& source) {
  409|  5.22k|   std::vector<uint8_t> bits;
  410|       |
  411|  5.22k|   source.start_sequence().raw_bytes(bits).end_cons();
  412|       |
  413|  5.22k|   BER_Decoder sequence(bits, source.limits());
  414|       |
  415|  5.22k|   std::vector<std::vector<std::pair<OID, ASN1_String>>> rdns;
  416|       |
  417|       |   // Cap AVAs per RDN to bound work for downstream set-based matching.
  418|       |   // No legitimate cert has anywhere near this many AVAs in a single RDN.
  419|  5.22k|   constexpr size_t MAX_AVAS_PER_RDN = 32;
  420|       |
  421|  17.8k|   while(sequence.more_items()) {
  ------------------
  |  Branch (421:10): [True: 12.6k, False: 5.20k]
  ------------------
  422|  12.6k|      BER_Decoder rdn_decoder = sequence.start_set();
  423|       |
  424|  12.6k|      std::vector<std::pair<OID, ASN1_String>> rdn;
  425|  78.1k|      while(rdn_decoder.more_items()) {
  ------------------
  |  Branch (425:13): [True: 65.5k, False: 12.6k]
  ------------------
  426|  65.5k|         OID oid;
  427|  65.5k|         ASN1_String str;
  428|       |
  429|  65.5k|         rdn_decoder.start_sequence()
  430|  65.5k|            .decode(oid)
  431|  65.5k|            .decode(str)  // TODO support Any
  432|  65.5k|            .end_cons();
  433|       |
  434|  65.5k|         rdn.emplace_back(std::move(oid), std::move(str));
  435|       |
  436|  65.5k|         if(rdn.size() > MAX_AVAS_PER_RDN) {
  ------------------
  |  Branch (436:13): [True: 7, False: 65.5k]
  ------------------
  437|      7|            throw Decoding_Error("X.500 RDN has too many attribute-value assertions");
  438|      7|         }
  439|  65.5k|      }
  440|       |
  441|       |      /*
  442|       |      RFC 5280 4.1.2.4:
  443|       |         RelativeDistinguishedName ::=
  444|       |           SET SIZE (1..MAX) OF AttributeTypeAndValue
  445|       |      */
  446|  12.6k|      if(rdn.empty()) {
  ------------------
  |  Branch (446:10): [True: 5, False: 12.6k]
  ------------------
  447|      5|         throw Decoding_Error("X.500 RDN must contain at least one attribute-value assertion");
  448|      5|      }
  449|  12.6k|      rdns.push_back(std::move(rdn));
  450|  12.6k|   }
  451|       |
  452|  5.20k|   auto canonical_bits = canonicalize_dn(rdns);
  453|       |
  454|  5.20k|   m_rdn = std::move(rdns);
  455|  5.20k|   m_dn_bits = std::move(bits);
  456|  5.20k|   m_canonical_dn_bits = std::move(canonical_bits);
  457|  5.20k|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_115canonicalize_dnERKNSt3__16vectorINS2_INS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEENS7_IS9_EEEE:
  311|  2.07k|std::vector<uint8_t> canonicalize_dn(const std::vector<std::vector<std::pair<OID, ASN1_String>>>& rdns) {
  312|  2.07k|   auto append_canonical_data = []<typename T>(std::vector<uint8_t>& out, const T& data) {
  313|  2.07k|      const std::array<uint8_t, 8> data_len = store_le(static_cast<uint64_t>(data.size()));
  314|  2.07k|      out.insert(out.end(), data_len.begin(), data_len.end());
  315|  2.07k|      out.insert(out.end(), data.begin(), data.end());
  316|  2.07k|   };
  317|       |
  318|  2.07k|   std::vector<uint8_t> canonical_bits;
  319|       |
  320|  10.4k|   for(const auto& rdn : rdns) {
  ------------------
  |  Branch (320:24): [True: 10.4k, False: 2.07k]
  ------------------
  321|  10.4k|      std::vector<uint8_t> rdn_bits;
  322|       |
  323|  61.7k|      for(const auto& [oid, value] : canonicalize_rdn(rdn)) {
  ------------------
  |  Branch (323:36): [True: 61.7k, False: 10.4k]
  ------------------
  324|  61.7k|         append_canonical_data(rdn_bits, oid.BER_encode());
  325|  61.7k|         append_canonical_data(rdn_bits, value);
  326|  61.7k|      }
  327|       |
  328|  10.4k|      append_canonical_data(canonical_bits, rdn_bits);
  329|  10.4k|   }
  330|       |
  331|  2.07k|   return canonical_bits;
  332|  2.07k|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_116canonicalize_rdnERKNSt3__16vectorINS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEE:
  299|  10.4k|std::vector<std::pair<OID, std::string>> canonicalize_rdn(const std::vector<std::pair<OID, ASN1_String>>& rdn) {
  300|  10.4k|   std::vector<std::pair<OID, std::string>> result;
  301|  10.4k|   result.reserve(rdn.size());
  302|  61.7k|   for(const auto& ava : rdn) {
  ------------------
  |  Branch (302:24): [True: 61.7k, False: 10.4k]
  ------------------
  303|  61.7k|      result.emplace_back(ava.first, X500_Char_Iterator::canonicalize(ava.second.value()));
  304|  61.7k|   }
  305|  10.4k|   if(result.size() != 1) {
  ------------------
  |  Branch (305:7): [True: 6.70k, False: 3.76k]
  ------------------
  306|  6.70k|      std::sort(result.begin(), result.end());
  307|  6.70k|   }
  308|  10.4k|   return result;
  309|  10.4k|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_118X500_Char_Iterator12canonicalizeENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  115|  61.7k|      static std::string canonicalize(std::string_view name) {
  116|  61.7k|         std::string result;
  117|  61.7k|         result.reserve(name.size());
  118|       |
  119|  61.7k|         X500_Char_Iterator it(name);
  120|   510k|         while(auto c = it.next()) {
  ------------------
  |  Branch (120:21): [True: 449k, False: 61.7k]
  ------------------
  121|   449k|            result += *c;
  122|   449k|         }
  123|       |
  124|  61.7k|         return result;
  125|  61.7k|      }
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_118X500_Char_IteratorC2ENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   82|  61.7k|      explicit X500_Char_Iterator(std::string_view s) : m_str(s), m_pos(0) {
   83|       |         // Skip leading whitespace
   84|  63.1k|         while(m_pos < m_str.size() && is_space(m_str[m_pos])) {
  ------------------
  |  Branch (84:16): [True: 13.6k, False: 49.5k]
  |  Branch (84:40): [True: 1.46k, False: 12.1k]
  ------------------
   85|  1.46k|            ++m_pos;
   86|  1.46k|         }
   87|  61.7k|      }
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_118X500_Char_Iterator4nextEv:
   90|   510k|      std::optional<char> next() {
   91|   510k|         if(m_pos >= m_str.size()) {
  ------------------
  |  Branch (91:13): [True: 61.3k, False: 449k]
  ------------------
   92|  61.3k|            return std::nullopt;
   93|  61.3k|         }
   94|       |
   95|   449k|         if(is_space(m_str[m_pos])) {
  ------------------
  |  Branch (95:13): [True: 3.37k, False: 445k]
  ------------------
   96|       |            // Skip the entire whitespace run
   97|  10.2k|            while(m_pos < m_str.size() && is_space(m_str[m_pos])) {
  ------------------
  |  Branch (97:19): [True: 9.94k, False: 337]
  |  Branch (97:43): [True: 6.90k, False: 3.04k]
  ------------------
   98|  6.90k|               ++m_pos;
   99|  6.90k|            }
  100|       |            // Emit a single space only if more content follows (strip trailing ws)
  101|  3.37k|            if(m_pos < m_str.size()) {
  ------------------
  |  Branch (101:16): [True: 3.04k, False: 337]
  ------------------
  102|  3.04k|               return ' ';
  103|  3.04k|            }
  104|    337|            return std::nullopt;
  105|  3.37k|         }
  106|       |
  107|   445k|         const char c = m_str[m_pos++];
  108|       |         // Locale-independent ASCII fold; RFC 5280 DN matching does not depend on libc locale
  109|   445k|         if(c >= 'A' && c <= 'Z') {
  ------------------
  |  Branch (109:13): [True: 12.0k, False: 433k]
  |  Branch (109:25): [True: 7.18k, False: 4.91k]
  ------------------
  110|  7.18k|            return static_cast<char>(c + ('a' - 'A'));
  111|  7.18k|         }
  112|   438k|         return c;
  113|   445k|      }
x509_dn.cpp:_ZZN5Botan12_GLOBAL__N_115canonicalize_dnERKNSt3__16vectorINS2_INS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEENS7_IS9_EEEEENK3$_0clINS2_IhNS7_IhEEEEEEDaRSH_RKT_:
  312|  72.1k|   auto append_canonical_data = []<typename T>(std::vector<uint8_t>& out, const T& data) {
  313|  72.1k|      const std::array<uint8_t, 8> data_len = store_le(static_cast<uint64_t>(data.size()));
  314|  72.1k|      out.insert(out.end(), data_len.begin(), data_len.end());
  315|  72.1k|      out.insert(out.end(), data.begin(), data.end());
  316|  72.1k|   };
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_:
  312|  61.7k|   auto append_canonical_data = []<typename T>(std::vector<uint8_t>& out, const T& data) {
  313|  61.7k|      const std::array<uint8_t, 8> data_len = store_le(static_cast<uint64_t>(data.size()));
  314|  61.7k|      out.insert(out.end(), data_len.begin(), data_len.end());
  315|  61.7k|      out.insert(out.end(), data.begin(), data.end());
  316|  61.7k|   };
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_18is_spaceEc:
   27|   472k|bool is_space(char c) {
   28|   472k|   return c == ' ' || c == '\t';
  ------------------
  |  Branch (28:11): [True: 6.27k, False: 466k]
  |  Branch (28:23): [True: 5.47k, False: 461k]
  ------------------
   29|   472k|}

