_ZN5Botan17ct_expand_top_bitITkNSt3__117unsigned_integralEmEET_S2_:
   28|  37.9k|BOTAN_FORCE_INLINE constexpr T ct_expand_top_bit(T a) {
   29|  37.9k|   const T top = CT::value_barrier<T>(a >> (sizeof(T) * 8 - 1));
   30|  37.9k|   return static_cast<T>(0) - top;
   31|  37.9k|}
_ZN5Botan6chooseITkNSt3__117unsigned_integralEmEET_S2_S2_S2_:
  217|  21.4k|BOTAN_FORCE_INLINE constexpr T choose(T mask, T a, T b) {
  218|       |   //return (mask & a) | (~mask & b);
  219|  21.4k|   return (b ^ (mask & (a ^ b)));
  220|  21.4k|}
_ZN5Botan10ct_is_zeroITkNSt3__117unsigned_integralEmEET_S2_:
   37|  24.9k|BOTAN_FORCE_INLINE constexpr T ct_is_zero(T x) {
   38|  24.9k|   return ct_expand_top_bit<T>(~x & (x - 1));
   39|  24.9k|}
_ZN5Botan13ceil_divisionITkNSt3__117unsigned_integralEmEET_S2_S2_:
  167|    660|BOTAN_FORCE_INLINE constexpr T ceil_division(T a, T b) {
  168|       |   // Same as `(a + b - 1) / b` but avoids possible overflow
  169|    660|   return a / b + ((a % b != 0) ? 1 : 0);
  ------------------
  |  Branch (169:20): [True: 645, False: 15]
  ------------------
  170|    660|}

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

_ZN5Botan2CT4MaskImE8is_equalEmm:
  442|  13.0k|      static constexpr Mask<T> is_equal(T x, T y) {
  443|  13.0k|         const T diff = value_barrier(x) ^ value_barrier(y);
  444|  13.0k|         return Mask<T>::is_zero(diff);
  445|  13.0k|      }
_ZN5Botan2CT4MaskImE5is_ltEmm:
  450|  13.0k|      static constexpr Mask<T> is_lt(T x, T y) {
  451|  13.0k|         T u = x ^ ((x ^ y) | ((x - y) ^ x));
  452|  13.0k|         return Mask<T>::expand_top_bit(u);
  453|  13.0k|      }
_ZN5Botan2CT4MaskImE14expand_top_bitEm:
  415|  13.0k|      static constexpr Mask<T> expand_top_bit(T v) { return Mask<T>(ct_expand_top_bit<T>(v)); }
_ZN5Botan2CT4MaskImEC2Em:
  637|  32.6k|      constexpr explicit Mask(T m) : m_mask(m) {}
_ZNK5Botan2CT4MaskImE6selectEmm:
  548|  21.4k|      constexpr T select(T x, T y) const { return choose(value(), x, y); }
_ZNK5Botan2CT4MaskImE5valueEv:
  630|  32.6k|      constexpr T value() const { return value_barrier<T>(m_mask); }
_ZN5Botan2CT4MaskImE7is_zeroEm:
  437|  14.1k|      static constexpr Mask<T> is_zero(T x) { return Mask<T>(ct_is_zero<T>(value_barrier<T>(x))); }
_ZN5Botan2CT8unpoisonITkNSt3__18integralEmEEvRKT_:
  112|  3.78k|constexpr void unpoison(const T& p) {
  113|  3.78k|   unpoison(&p, 1);
  114|  3.78k|}
_ZN5Botan2CT8unpoisonImEEvPKT_m:
   67|  5.10k|constexpr inline void unpoison(const T* p, size_t n) {
   68|       |#if defined(BOTAN_HAS_VALGRIND)
   69|       |   if(!std::is_constant_evaluated()) {
   70|       |      VALGRIND_MAKE_MEM_DEFINED(p, n * sizeof(T));
   71|       |   }
   72|       |#endif
   73|       |
   74|  5.10k|   BOTAN_UNUSED(p, n);
  ------------------
  |  |  151|  5.10k|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
   75|  5.10k|}
_ZNK5Botan2CT4MaskImEcoEv:
  533|    610|      constexpr Mask<T> operator~() const { return Mask<T>(~value()); }
_ZN5Botan2CT4MaskImE6expandEm:
  392|    610|      static constexpr Mask<T> expand(T v) { return ~Mask<T>::is_zero(value_barrier<T>(v)); }
_ZNK5Botan2CT4MaskImE16unpoisoned_valueEv:
  598|    915|      constexpr T unpoisoned_value() const {
  599|    915|         T r = value();
  600|    915|         CT::unpoison(r);
  601|    915|         return r;
  602|    915|      }
_ZNK5Botan2CT4MaskImE7as_boolEv:
  614|    915|      constexpr bool as_bool() const { return unpoisoned_value() != 0; }
_ZNK5Botan2CT4MaskImE11select_maskES2_S2_:
  559|  4.88k|      Mask<T> select_mask(Mask<T> x, Mask<T> y) const { return Mask<T>(select(x.value(), y.value())); }

_ZN5Botan11checked_mulITkNSt3__117unsigned_integralEmEENS1_8optionalIT_EES3_S3_:
   46|  1.32k|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|  1.32k|   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|  1.32k|   if(a != 0 && r / a != b) {
  ------------------
  |  Branch (53:7): [True: 1.32k, False: 0]
  |  Branch (53:17): [True: 0, False: 1.32k]
  ------------------
   54|      0|      return {};
   55|      0|   }
   56|  1.32k|   return r;
   57|  1.32k|}

_ZN5Botan7load_beImJNSt3__14spanIKhLm8EEEEEEDaDpOT0_:
  504|    527|inline constexpr auto load_be(ParamTs&&... params) {
  505|    527|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|    527|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|    527|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|    527|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|    527|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|    527|   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|    527|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|    527|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|    527|      } else {
  289|    527|         const std::span in{in_range};
  290|    527|         if constexpr(sizeof(OutT) == 1) {
  291|    527|            return static_cast<OutT>(in[0]);
  292|    527|         } else if constexpr(endianness == std::endian::native) {
  293|    527|            return typecast_copy<OutT>(in);
  294|    527|         } else {
  295|    527|            static_assert(opposite(endianness) == std::endian::native);
  296|    527|            return reverse_bytes(typecast_copy<OutT>(in));
  297|    527|         }
  298|    527|      }
  299|    527|   }());
  300|    527|}
_ZN5Botan6detail24wrap_strong_type_or_enumITkNS0_20unsigned_integralishEmTkNSt3__117unsigned_integralEmEEDaT0_:
  200|  1.00k|constexpr auto wrap_strong_type_or_enum(T t) {
  201|       |   if constexpr(std::is_enum_v<OutT>) {
  202|       |      return static_cast<OutT>(t);
  203|  1.00k|   } else {
  204|  1.00k|      return Botan::wrap_strong_type<OutT>(t);
  205|  1.00k|   }
  206|  1.00k|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|    527|   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|    527|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 527]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|    527|      } else {
  289|    527|         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|    527|         } else {
  295|    527|            static_assert(opposite(endianness) == std::endian::native);
  296|    527|            return reverse_bytes(typecast_copy<OutT>(in));
  297|    527|         }
  298|    527|      }
  299|    527|   }());
_ZN5Botan7load_beImJRNSt3__15arrayIhLm8EEEEEEDaDpOT0_:
  504|    482|inline constexpr auto load_be(ParamTs&&... params) {
  505|    482|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|    482|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEERNS2_5arrayIhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|    482|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|    482|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|    482|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|    482|   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|    482|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|    482|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|    482|      } else {
  289|    482|         const std::span in{in_range};
  290|    482|         if constexpr(sizeof(OutT) == 1) {
  291|    482|            return static_cast<OutT>(in[0]);
  292|    482|         } else if constexpr(endianness == std::endian::native) {
  293|    482|            return typecast_copy<OutT>(in);
  294|    482|         } else {
  295|    482|            static_assert(opposite(endianness) == std::endian::native);
  296|    482|            return reverse_bytes(typecast_copy<OutT>(in));
  297|    482|         }
  298|    482|      }
  299|    482|   }());
  300|    482|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEERNS2_5arrayIhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|    482|   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|    482|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 482]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|    482|      } else {
  289|    482|         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|    482|         } else {
  295|    482|            static_assert(opposite(endianness) == std::endian::native);
  296|    482|            return reverse_bytes(typecast_copy<OutT>(in));
  297|    482|         }
  298|    482|      }
  299|    482|   }());

_ZN5Botan10word8_add3ITkNS_8WordTypeEmEET_PS1_PKS1_S4_S1_:
  304|      2|inline constexpr auto word8_add3(W z[8], const W x[8], const W y[8], W carry) -> W {
  305|      2|#if defined(BOTAN_MP_USE_X86_64_ASM)
  306|      2|   if constexpr(std::same_as<W, uint64_t>) {
  307|      2|      if(!std::is_constant_evaluated()) {
  ------------------
  |  Branch (307:10): [True: 2, Folded]
  ------------------
  308|      2|         asm volatile(ADD_OR_SUBTRACT(DO_8_TIMES(ADDSUB3_OP, "adcq"))
  309|      2|                      : [carry] "=r"(carry)
  310|      2|                      : [x] "r"(x), [y] "r"(y), [z] "r"(z), "0"(carry)
  311|      2|                      : "cc", "memory");
  312|      2|         return carry;
  313|      2|      }
  314|      2|   }
  315|      0|#endif
  316|       |
  317|      0|   z[0] = word_add(x[0], y[0], &carry);
  318|      2|   z[1] = word_add(x[1], y[1], &carry);
  319|      2|   z[2] = word_add(x[2], y[2], &carry);
  320|      2|   z[3] = word_add(x[3], y[3], &carry);
  321|      2|   z[4] = word_add(x[4], y[4], &carry);
  322|      2|   z[5] = word_add(x[5], y[5], &carry);
  323|      2|   z[6] = word_add(x[6], y[6], &carry);
  324|      2|   z[7] = word_add(x[7], y[7], &carry);
  325|      2|   return carry;
  326|      2|}
_ZN5Botan8word_addITkNS_8WordTypeEmEET_S1_S1_PS1_:
  239|    176|inline constexpr auto word_add(W x, W y, W* carry) -> W {
  240|    176|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_addc)
  241|    176|   if(!std::is_constant_evaluated()) {
  ------------------
  |  Branch (241:7): [True: 176, Folded]
  ------------------
  242|       |      if constexpr(std::same_as<W, unsigned int>) {
  243|       |         return __builtin_addc(x, y, *carry & 1, carry);
  244|    176|      } else if constexpr(std::same_as<W, unsigned long>) {
  245|    176|         return __builtin_addcl(x, y, *carry & 1, carry);
  246|       |      } else if constexpr(std::same_as<W, unsigned long long>) {
  247|       |         return __builtin_addcll(x, y, *carry & 1, carry);
  248|       |      }
  249|    176|   }
  250|      0|#endif
  251|       |
  252|       |   if constexpr(WordInfo<W>::dword_is_native && use_dword_for_word_add) {
  253|       |      /*
  254|       |      TODO(Botan4) this is largely a performance hack for GCCs that don't
  255|       |      support __builtin_addc, if we increase the minimum supported version of
  256|       |      GCC to GCC 14 then we can remove this and not worry about it
  257|       |      */
  258|       |      const W cb = *carry & 1;
  259|       |      const auto s = typename WordInfo<W>::dword(x) + y + cb;
  260|       |      *carry = static_cast<W>(s >> WordInfo<W>::bits);
  261|       |      return static_cast<W>(s);
  262|    176|   } else {
  263|    176|      const W cb = *carry & 1;
  264|    176|      W z = x + y;
  265|    176|      W c1 = (z < x);
  266|    176|      z += cb;
  267|    176|      *carry = c1 | (z < cb);
  268|    176|      return z;
  269|    176|   }
  270|    176|}
_ZN5Botan10word8_sub3ITkNS_8WordTypeEmEET_PS1_PKS1_S4_S1_:
  385|      2|inline constexpr auto word8_sub3(W z[8], const W x[8], const W y[8], W carry) -> W {
  386|      2|#if defined(BOTAN_MP_USE_X86_64_ASM)
  387|      2|   if constexpr(std::same_as<W, uint64_t>) {
  388|      2|      if(!std::is_constant_evaluated()) {
  ------------------
  |  Branch (388:10): [True: 2, Folded]
  ------------------
  389|      2|         asm volatile(ADD_OR_SUBTRACT(DO_8_TIMES(ADDSUB3_OP, "sbbq"))
  390|      2|                      : [carry] "=r"(carry)
  391|      2|                      : [x] "r"(x), [y] "r"(y), [z] "r"(z), "0"(carry)
  392|      2|                      : "cc", "memory");
  393|      2|         return carry;
  394|      2|      }
  395|      2|   }
  396|      0|#endif
  397|       |
  398|      0|   z[0] = word_sub(x[0], y[0], &carry);
  399|      2|   z[1] = word_sub(x[1], y[1], &carry);
  400|      2|   z[2] = word_sub(x[2], y[2], &carry);
  401|      2|   z[3] = word_sub(x[3], y[3], &carry);
  402|      2|   z[4] = word_sub(x[4], y[4], &carry);
  403|      2|   z[5] = word_sub(x[5], y[5], &carry);
  404|      2|   z[6] = word_sub(x[6], y[6], &carry);
  405|      2|   z[7] = word_sub(x[7], y[7], &carry);
  406|      2|   return carry;
  407|      2|}
_ZN5Botan8word_subITkNS_8WordTypeEmEET_S1_S1_PS1_:
  332|    808|inline constexpr auto word_sub(W x, W y, W* carry) -> W {
  333|    808|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_subc)
  334|    808|   if(!std::is_constant_evaluated()) {
  ------------------
  |  Branch (334:7): [True: 808, Folded]
  ------------------
  335|       |      if constexpr(std::same_as<W, unsigned int>) {
  336|       |         return __builtin_subc(x, y, *carry & 1, carry);
  337|    808|      } else if constexpr(std::same_as<W, unsigned long>) {
  338|    808|         return __builtin_subcl(x, y, *carry & 1, carry);
  339|       |      } else if constexpr(std::same_as<W, unsigned long long>) {
  340|       |         return __builtin_subcll(x, y, *carry & 1, carry);
  341|       |      }
  342|    808|   }
  343|      0|#endif
  344|       |
  345|      0|   const W cb = *carry & 1;
  346|    808|   W t0 = x - y;
  347|    808|   W c1 = (t0 > x);
  348|    808|   W z = t0 - cb;
  349|    808|   *carry = c1 | (z > t0);
  350|    808|   return z;
  351|    808|}

_ZN5Botan11bigint_add3ITkNS_8WordTypeEmEET_PS1_PKS1_mS4_m:
  123|     61|inline constexpr auto bigint_add3(W z[], const W x[], size_t x_size, const W y[], size_t y_size) -> W {
  124|     61|   if(x_size < y_size) {
  ------------------
  |  Branch (124:7): [True: 11, False: 50]
  ------------------
  125|     11|      return bigint_add3(z, y, y_size, x, x_size);
  126|     11|   }
  127|       |
  128|     50|   W carry = 0;
  129|       |
  130|     50|   const size_t blocks = y_size - (y_size % 8);
  131|       |
  132|     52|   for(size_t i = 0; i != blocks; i += 8) {
  ------------------
  |  Branch (132:22): [True: 2, False: 50]
  ------------------
  133|      2|      carry = word8_add3(z + i, x + i, y + i, carry);
  134|      2|   }
  135|       |
  136|    176|   for(size_t i = blocks; i != y_size; ++i) {
  ------------------
  |  Branch (136:27): [True: 126, False: 50]
  ------------------
  137|    126|      z[i] = word_add(x[i], y[i], &carry);
  138|    126|   }
  139|       |
  140|    100|   for(size_t i = y_size; i != x_size; ++i) {
  ------------------
  |  Branch (140:27): [True: 50, False: 50]
  ------------------
  141|     50|      z[i] = word_add(x[i], static_cast<W>(0), &carry);
  142|     50|   }
  143|       |
  144|     50|   return carry;
  145|     61|}
_ZN5Botan10bigint_cmpITkNS_8WordTypeEmEEiPKT_mS3_m:
  462|  1.55k|inline constexpr int32_t bigint_cmp(const W x[], size_t x_size, const W y[], size_t y_size) {
  463|  1.55k|   static_assert(sizeof(W) >= sizeof(uint32_t), "Size assumption");
  464|       |
  465|  1.55k|   const W LT = static_cast<W>(-1);
  466|  1.55k|   const W EQ = 0;
  467|  1.55k|   const W GT = 1;
  468|       |
  469|  1.55k|   const size_t common_elems = std::min(x_size, y_size);
  470|       |
  471|  1.55k|   W result = EQ;  // until found otherwise
  472|       |
  473|  9.67k|   for(size_t i = 0; i != common_elems; i++) {
  ------------------
  |  Branch (473:22): [True: 8.12k, False: 1.55k]
  ------------------
  474|  8.12k|      const auto is_eq = CT::Mask<W>::is_equal(x[i], y[i]);
  475|  8.12k|      const auto is_lt = CT::Mask<W>::is_lt(x[i], y[i]);
  476|       |
  477|  8.12k|      result = is_eq.select(result, is_lt.select(LT, GT));
  478|  8.12k|   }
  479|       |
  480|  1.55k|   if(x_size < y_size) {
  ------------------
  |  Branch (480:7): [True: 139, False: 1.41k]
  ------------------
  481|    139|      W mask = 0;
  482|    312|      for(size_t i = x_size; i != y_size; i++) {
  ------------------
  |  Branch (482:30): [True: 173, False: 139]
  ------------------
  483|    173|         mask |= y[i];
  484|    173|      }
  485|       |
  486|       |      // If any bits were set in high part of y, then x < y
  487|    139|      result = CT::Mask<W>::is_zero(mask).select(result, LT);
  488|  1.41k|   } else if(y_size < x_size) {
  ------------------
  |  Branch (488:14): [True: 139, False: 1.27k]
  ------------------
  489|    139|      W mask = 0;
  490|    312|      for(size_t i = y_size; i != x_size; i++) {
  ------------------
  |  Branch (490:30): [True: 173, False: 139]
  ------------------
  491|    173|         mask |= x[i];
  492|    173|      }
  493|       |
  494|       |      // If any bits were set in high part of x, then x > y
  495|    139|      result = CT::Mask<W>::is_zero(mask).select(result, GT);
  496|    139|   }
  497|       |
  498|  1.55k|   CT::unpoison(result);
  499|  1.55k|   BOTAN_DEBUG_ASSERT(result == LT || result == GT || result == EQ);
  ------------------
  |  |  137|  1.55k|      do { /* NOLINT(*-avoid-do-while) */ \
  |  |  138|  1.55k|      } while(0)
  |  |  ------------------
  |  |  |  Branch (138:15): [Folded, False: 1.55k]
  |  |  ------------------
  ------------------
  500|  1.55k|   return static_cast<int32_t>(result);
  501|  1.55k|}
_ZN5Botan11bigint_sub3ITkNS_8WordTypeEmEET_PS1_PKS1_mS4_m:
  195|    604|inline constexpr auto bigint_sub3(W z[], const W x[], size_t x_size, const W y[], size_t y_size) -> W {
  196|    604|   W borrow = 0;
  197|       |
  198|    604|   BOTAN_ASSERT(x_size >= y_size, "Expected sizes");
  ------------------
  |  |   71|    604|   do {                                                                                 \
  |  |   72|    604|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                     \
  |  |   73|    604|      if(!(expr)) {                                                                     \
  |  |  ------------------
  |  |  |  Branch (73:10): [True: 0, False: 604]
  |  |  ------------------
  |  |   74|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                            \
  |  |   75|      0|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   76|      0|      }                                                                                 \
  |  |   77|    604|   } while(0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 604]
  |  |  ------------------
  ------------------
  199|       |
  200|    604|   const size_t blocks = y_size - (y_size % 8);
  201|       |
  202|    606|   for(size_t i = 0; i != blocks; i += 8) {
  ------------------
  |  Branch (202:22): [True: 2, False: 604]
  ------------------
  203|      2|      borrow = word8_sub3(z + i, x + i, y + i, borrow);
  204|      2|   }
  205|       |
  206|  1.06k|   for(size_t i = blocks; i != y_size; ++i) {
  ------------------
  |  Branch (206:27): [True: 462, False: 604]
  ------------------
  207|    462|      z[i] = word_sub(x[i], y[i], &borrow);
  208|    462|   }
  209|       |
  210|    950|   for(size_t i = y_size; i != x_size; ++i) {
  ------------------
  |  Branch (210:27): [True: 346, False: 604]
  ------------------
  211|    346|      z[i] = word_sub(x[i], static_cast<W>(0), &borrow);
  212|    346|   }
  213|       |
  214|    604|   return borrow;
  215|    604|}
_ZN5Botan15bigint_ct_is_eqITkNS_8WordTypeEmEENS_2CT4MaskIT_EEPKS3_mS6_m:
  542|    305|inline constexpr auto bigint_ct_is_eq(const W x[], size_t x_size, const W y[], size_t y_size) -> CT::Mask<W> {
  543|    305|   const size_t common_elems = std::min(x_size, y_size);
  544|       |
  545|    305|   W diff = 0;
  546|       |
  547|  2.74k|   for(size_t i = 0; i != common_elems; i++) {
  ------------------
  |  Branch (547:22): [True: 2.44k, False: 305]
  ------------------
  548|  2.44k|      diff |= (x[i] ^ y[i]);
  549|  2.44k|   }
  550|       |
  551|       |   // If any bits were set in high part of x/y, then they are not equal
  552|    305|   if(x_size < y_size) {
  ------------------
  |  Branch (552:7): [True: 0, False: 305]
  ------------------
  553|      0|      for(size_t i = x_size; i != y_size; i++) {
  ------------------
  |  Branch (553:30): [True: 0, False: 0]
  ------------------
  554|      0|         diff |= y[i];
  555|      0|      }
  556|    305|   } else if(y_size < x_size) {
  ------------------
  |  Branch (556:14): [True: 0, False: 305]
  ------------------
  557|      0|      for(size_t i = y_size; i != x_size; i++) {
  ------------------
  |  Branch (557:30): [True: 0, False: 0]
  ------------------
  558|      0|         diff |= x[i];
  559|      0|      }
  560|      0|   }
  561|       |
  562|    305|   return CT::Mask<W>::is_zero(diff);
  563|    305|}
_ZN5Botan15bigint_ct_is_ltITkNS_8WordTypeEmEENS_2CT4MaskIT_EEPKS3_mS6_mb:
  510|    610|   -> CT::Mask<W> {
  511|    610|   const size_t common_elems = std::min(x_size, y_size);
  512|       |
  513|    610|   auto is_lt = CT::Mask<W>::expand(lt_or_equal);
  514|       |
  515|  5.49k|   for(size_t i = 0; i != common_elems; i++) {
  ------------------
  |  Branch (515:22): [True: 4.88k, False: 610]
  ------------------
  516|  4.88k|      const auto eq = CT::Mask<W>::is_equal(x[i], y[i]);
  517|  4.88k|      const auto lt = CT::Mask<W>::is_lt(x[i], y[i]);
  518|  4.88k|      is_lt = eq.select_mask(is_lt, lt);
  519|  4.88k|   }
  520|       |
  521|    610|   if(x_size < y_size) {
  ------------------
  |  Branch (521:7): [True: 0, False: 610]
  ------------------
  522|      0|      W mask = 0;
  523|      0|      for(size_t i = x_size; i != y_size; i++) {
  ------------------
  |  Branch (523:30): [True: 0, False: 0]
  ------------------
  524|      0|         mask |= y[i];
  525|      0|      }
  526|       |      // If any bits were set in high part of y, then is_lt should be forced true
  527|      0|      is_lt |= CT::Mask<W>::expand(mask);
  528|    610|   } else if(y_size < x_size) {
  ------------------
  |  Branch (528:14): [True: 0, False: 610]
  ------------------
  529|      0|      W mask = 0;
  530|      0|      for(size_t i = y_size; i != x_size; i++) {
  ------------------
  |  Branch (530:30): [True: 0, False: 0]
  ------------------
  531|      0|         mask |= x[i];
  532|      0|      }
  533|       |
  534|       |      // If any bits were set in high part of x, then is_lt should be false
  535|      0|      is_lt &= CT::Mask<W>::is_zero(mask);
  536|      0|   }
  537|       |
  538|    610|   return is_lt;
  539|    610|}

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

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

_ZN5Botan6BigInt9flip_signEv:
  657|    330|      BOTAN_DEPRECATED("Deprecated no replacement") void flip_sign() { set_sign(reverse_sign()); }
_ZN5Botan6BigInt8set_signENS0_4SignE:
  663|    984|      void set_sign(Sign sign) {
  664|    984|         if(sign == Negative && is_zero()) {
  ------------------
  |  Branch (664:13): [True: 657, False: 327]
  |  Branch (664:33): [True: 29, False: 628]
  ------------------
  665|     29|            sign = Positive;
  666|     29|         }
  667|       |
  668|    984|         m_signedness = sign;
  669|    984|      }
_ZNK5Botan6BigInt12reverse_signEv:
  647|    990|      Sign reverse_sign() const {
  648|    990|         if(sign() == Positive) {
  ------------------
  |  Branch (648:13): [True: 689, False: 301]
  ------------------
  649|    689|            return Negative;
  650|    689|         }
  651|    301|         return Positive;
  652|    990|      }
_ZNK5Botan6BigInt4signEv:
  641|  8.82k|      Sign sign() const { return (m_signedness); }
_ZN5BotanmiERKNS_6BigIntES2_:
 1219|    660|inline BigInt operator-(const BigInt& x, const BigInt& y) {
 1220|    660|   return BigInt::add2(x, y._data(), y.sig_words(), y.reverse_sign());
 1221|    660|}
_ZNK5Botan6BigInt5_dataEv:
 1033|  4.42k|      const word* _data() const { return m_data.const_data(); }
_ZNK5Botan6BigInt4Data10const_dataEv:
 1088|  6.95k|            const word* const_data() const { return m_reg.data(); }
_ZNK5Botan6BigInt9sig_wordsEv:
  687|  8.97k|      size_t sig_words() const { return m_data.sig_words(); }
_ZNK5Botan6BigInt4Data9sig_wordsEv:
 1163|  8.97k|            size_t sig_words() const {
 1164|  8.97k|               if(m_sig_words == sig_words_npos) {
  ------------------
  |  Branch (1164:19): [True: 1.32k, False: 7.65k]
  ------------------
 1165|  1.32k|                  m_sig_words = calc_sig_words();
 1166|  1.32k|               }
 1167|  8.97k|               return m_sig_words;
 1168|  8.97k|            }
_ZN5BotaneqERKNS_6BigIntES2_:
 1313|    330|inline bool operator==(const BigInt& a, const BigInt& b) {
 1314|    330|   return a.is_equal(b);
 1315|    330|}
_ZN5BotanltERKNS_6BigIntES2_:
 1353|    330|inline bool operator<(const BigInt& a, const BigInt& b) {
 1354|    330|   return a.is_less_than(b);
 1355|    330|}
_ZN5BotangtERKNS_6BigIntES2_:
 1363|    330|inline bool operator>(const BigInt& a, const BigInt& b) {
 1364|    330|   return b.is_less_than(a);
 1365|    330|}
_ZN5BotanleERKNS_6BigIntES2_:
 1333|    330|inline bool operator<=(const BigInt& a, const BigInt& b) {
 1334|    330|   return (a.cmp(b) <= 0);
 1335|    330|}
_ZN5BotangeERKNS_6BigIntES2_:
 1343|    330|inline bool operator>=(const BigInt& a, const BigInt& b) {
 1344|    330|   return (a.cmp(b) >= 0);
 1345|    330|}
_ZNK5Botan6BigInt7is_zeroEv:
  510|    663|      bool is_zero() const { return sig_words() == 0; }
_ZNK5Botan6BigInt6signumEv:
  493|  6.98k|      int signum() const {
  494|  6.98k|         if(sig_words() == 0) {
  ------------------
  |  Branch (494:13): [True: 825, False: 6.16k]
  ------------------
  495|    825|            return 0;
  496|    825|         }
  497|  6.16k|         return (sign() == Negative) ? -1 : 1;
  ------------------
  |  Branch (497:17): [True: 3.53k, False: 2.62k]
  ------------------
  498|  6.98k|      }
_ZN5Botan6BigIntD2Ev:
  185|  1.32k|      ~BigInt() { _const_time_unpoison(); }
_ZN5Botan6BigInt5clearEv:
  441|    660|      void clear() {
  442|    660|         m_data.set_to_zero();
  443|    660|         m_signedness = Positive;
  444|    660|      }
_ZNK5Botan6BigInt4sizeEv:
  681|  3.71k|      size_t size() const { return m_data.size(); }
_ZN5Botan6BigInt12mutable_dataEv:
  712|    704|      BOTAN_DEPRECATED("Deprecated no replacement") word* mutable_data() { return m_data.mutable_data(); }
_ZNK5Botan6BigInt4dataEv:
  718|  1.21k|      BOTAN_DEPRECATED("Deprecated no replacement") const word* data() const { return m_data.const_data(); }
_ZNK5Botan6BigInt7grow_toEm:
  738|    660|      BOTAN_DEPRECATED("Deprecated no replacement") void grow_to(size_t n) const { m_data.grow_to(n); }
_ZN5Botan6BigInt4Data12mutable_dataEv:
 1083|    704|            word* mutable_data() {
 1084|    704|               invalidate_sig_words();
 1085|    704|               return m_reg.data();
 1086|    704|            }
_ZNK5Botan6BigInt4Data7grow_toEm:
 1126|    660|            void grow_to(size_t n) const {
 1127|    660|               if(n > size()) {
  ------------------
  |  Branch (1127:19): [True: 660, False: 0]
  ------------------
 1128|    660|                  if(n <= m_reg.capacity()) {
  ------------------
  |  Branch (1128:22): [True: 0, False: 660]
  ------------------
 1129|      0|                     m_reg.resize(n);
 1130|    660|                  } else {
 1131|    660|                     m_reg.resize(n + (8 - (n % 8)));
 1132|    660|                  }
 1133|    660|               }
 1134|    660|            }
_ZNK5Botan6BigInt4Data4sizeEv:
 1136|  5.69k|            size_t size() const { return m_reg.size(); }
_ZN5Botan6BigInt4Data4swapERNSt3__16vectorImNS_16secure_allocatorImEEEE:
 1156|    660|            void swap(secure_vector<word>& reg) noexcept {
 1157|    660|               m_reg.swap(reg);
 1158|    660|               invalidate_sig_words();
 1159|    660|            }
_ZNK5Botan6BigInt4Data20invalidate_sig_wordsEv:
 1161|  1.36k|            void invalidate_sig_words() const noexcept { m_sig_words = sig_words_npos; }
_ZN5Botan6BigIntC2Ev:
   45|  1.32k|      BigInt() = default;

_ZN5Botan11clear_bytesEPvm:
  101|    660|inline constexpr void clear_bytes(void* ptr, size_t bytes) {
  102|    660|   if(bytes > 0) {
  ------------------
  |  Branch (102:7): [True: 0, False: 660]
  ------------------
  103|      0|      std::memset(ptr, 0, bytes);
  104|      0|   }
  105|    660|}
_ZN5Botan9clear_memImEEvPT_m:
  118|    660|inline constexpr void clear_mem(T* ptr, size_t n) {
  119|    660|   clear_bytes(ptr, sizeof(T) * n);
  120|    660|}
_ZN5Botan13typecast_copyImTkNS_6ranges16contiguous_rangeENSt3__14spanIKhLm8EEEQaaaasr3stdE26is_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|    527|inline constexpr ToT typecast_copy(const FromR& src) {
  211|    527|   ToT dst;  // NOLINT(*-member-init)
  212|    527|   typecast_copy(dst, src);
  213|    527|   return dst;
  214|    527|}
_ZN5Botan13typecast_copyImTkNS_6ranges16contiguous_rangeENSt3__14spanIKhLm8EEEQaaaasr3stdE23is_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|    527|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|    527|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|    527|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeENSt3__14spanImLm1EEETkNS1_16contiguous_rangeENS3_IKhLm8EEEQaasr3stdE23is_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|    527|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|    527|   ranges::assert_equal_byte_lengths(out, in);
  178|    527|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|    527|}
_ZN5Botan8copy_memITkNS_6ranges23contiguous_output_rangeENSt3__14spanIhLm18446744073709551615EEETkNS1_16contiguous_rangeENS3_IKhLm18446744073709551615EEEQaasr3stdE9is_same_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISE_EESF_E4type10value_typeENS7_IXsr21__is_primary_templateINS8_Iu14__remove_cvrefIDTclL_ZNSA_5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENSG_ISO_EESP_E4type10value_typeEEsr3stdE23is_trivially_copyable_vIST_EEEvOSB_RKSL_:
  160|    482|inline constexpr void copy_mem(OutR&& out /* NOLINT(*-std-forward) */, const InR& in) {
  161|    482|   ranges::assert_equal_byte_lengths(out, in);
  162|    482|   if(std::is_constant_evaluated()) {
  ------------------
  |  Branch (162:7): [Folded, False: 482]
  ------------------
  163|      0|      std::copy(std::ranges::begin(in), std::ranges::end(in), std::ranges::begin(out));
  164|    482|   } else if(ranges::size_bytes(out) > 0) {
  ------------------
  |  Branch (164:14): [True: 482, False: 0]
  ------------------
  165|    482|      std::memmove(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  166|    482|   }
  167|    482|}
_ZN5Botan13typecast_copyImTkNS_6ranges16contiguous_rangeENSt3__14spanIhLm8EEEQaaaasr3stdE26is_default_constructible_vIT_Esr3stdE23is_trivially_copyable_vIS5_Esr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISD_EESE_E4type10value_typeEEEES5_RKSA_:
  210|    482|inline constexpr ToT typecast_copy(const FromR& src) {
  211|    482|   ToT dst;  // NOLINT(*-member-init)
  212|    482|   typecast_copy(dst, src);
  213|    482|   return dst;
  214|    482|}
_ZN5Botan13typecast_copyImTkNS_6ranges16contiguous_rangeENSt3__14spanIhLm8EEEQaaaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISC_EESD_E4type10value_typeEEsr3stdE23is_trivially_copyable_vIT_Entsr3std6rangesE5rangeISJ_EEEvRSJ_RKS9_:
  188|    482|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|    482|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|    482|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeENSt3__14spanImLm1EEETkNS1_16contiguous_rangeENS3_IhLm8EEEQaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISD_EESE_E4type10value_typeEEsr3stdE23is_trivially_copyable_vINS6_IXsr21__is_primary_templateINS7_Iu14__remove_cvrefIDTclL_ZNS9_5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENSF_ISN_EESO_E4type10value_typeEEEEvOSK_RKSA_:
  176|    482|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|    482|   ranges::assert_equal_byte_lengths(out, in);
  178|    482|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|    482|}

_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIhLm18446744073709551615EEETpTkNS0_14spanable_rangeEJNS3_IKhLm18446744073709551615EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|    482|{
  101|    482|   const std::span s0{r0};
  102|       |
  103|       |   if constexpr(statically_spanable_range<R0>) {
  104|       |      constexpr size_t expected_size = s0.size_bytes();
  105|       |      (assert_exact_byte_length<expected_size>(rs), ...);
  106|    482|   } else {
  107|    482|      const size_t expected_size = s0.size_bytes();
  108|    482|      const bool correct_size =
  109|    482|         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|    482|      if(!correct_size) {
  ------------------
  |  Branch (111:10): [True: 0, False: 482]
  ------------------
  112|      0|         memory_region_size_violation();
  113|      0|      }
  114|    482|   }
  115|    482|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__14spanIhLm8EEEEEvRKT0_:
   77|    482|inline constexpr void assert_exact_byte_length(const R& r) {
   78|    482|   const std::span s{r};
   79|    482|   if constexpr(statically_spanable_range<R>) {
   80|    482|      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|    482|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__14spanIKhLm8EEEEEvRKT0_:
   77|  1.05k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  1.05k|   const std::span s{r};
   79|  1.05k|   if constexpr(statically_spanable_range<R>) {
   80|  1.05k|      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|  1.05k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanImLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm8EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|    527|{
  101|    527|   const std::span s0{r0};
  102|       |
  103|    527|   if constexpr(statically_spanable_range<R0>) {
  104|    527|      constexpr size_t expected_size = s0.size_bytes();
  105|    527|      (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|    527|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanImLm1EEEEEmRKT_:
   59|  1.00k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  1.00k|   return std::span{r}.size_bytes();
   61|  1.00k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIhLm18446744073709551615EEEEEmRKT_:
   59|    964|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|    964|   return std::span{r}.size_bytes();
   61|    964|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__15arrayIhLm8EEEEEvRKT0_:
   77|    482|inline constexpr void assert_exact_byte_length(const R& r) {
   78|    482|   const std::span s{r};
   79|    482|   if constexpr(statically_spanable_range<R>) {
   80|    482|      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|    482|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanImLm1EEETpTkNS0_14spanable_rangeEJNS3_IhLm8EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|    482|{
  101|    482|   const std::span s0{r0};
  102|       |
  103|    482|   if constexpr(statically_spanable_range<R0>) {
  104|    482|      constexpr size_t expected_size = s0.size_bytes();
  105|    482|      (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|    482|}

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

_ZN5Botan16wrap_strong_typeImRmQoosr3stdE18constructible_fromIT_T0_Eaasr8conceptsE11strong_typeIS2_Esr3stdE18constructible_fromINS2_12wrapped_typeES3_EEEDcOS3_:
  144|  1.00k|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  145|  1.00k|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  146|       |      // Noop, if the parameter type already is the desired return type.
  147|  1.00k|      return std::forward<ParamT>(t);
  148|       |   } else if constexpr(std::constructible_from<T, ParamT>) {
  149|       |      // Implicit conversion from the parameter type to the return type.
  150|       |      return T{std::forward<ParamT>(t)};
  151|       |   } else {
  152|       |      // Explicitly calling the wrapped type's constructor to support
  153|       |      // implicit conversions on types that mark their constructors as explicit.
  154|       |      static_assert(concepts::strong_type<T> && std::constructible_from<typename T::wrapped_type, ParamT>);
  155|       |      return T{typename T::wrapped_type{std::forward<ParamT>(t)}};
  156|       |   }
  157|  1.00k|}

_Z4fuzzNSt3__14spanIKhLm18446744073709551615EEE:
   11|    361|void fuzz(const std::span<const uint8_t> in) {
   12|    361|   const size_t max_bits = 512;
   13|       |
   14|    361|   if(in.size() < 3 || in.size() > 1 + 2 * (max_bits / 8)) {
  ------------------
  |  Branch (14:7): [True: 2, False: 359]
  |  Branch (14:24): [True: 29, False: 330]
  ------------------
   15|     31|      return;
   16|     31|   }
   17|       |
   18|    330|   const uint8_t signs = in[0];
   19|    330|   const size_t x_len = (in.size() - 1) / 2;
   20|       |
   21|    330|   Botan::BigInt x = Botan::BigInt::from_bytes(in.subspan(1, x_len));
   22|    330|   Botan::BigInt y = Botan::BigInt::from_bytes(in.subspan(1 + x_len, in.size() - x_len - 1));
   23|       |
   24|    330|   if((signs & 1) != 0) {
  ------------------
  |  Branch (24:7): [True: 177, False: 153]
  ------------------
   25|    177|      x.flip_sign();
   26|    177|   }
   27|    330|   if((signs & 2) != 0) {
  ------------------
  |  Branch (27:7): [True: 153, False: 177]
  ------------------
   28|    153|      y.flip_sign();
   29|    153|   }
   30|       |
   31|    330|   const Botan::BigInt d1 = x - y;
   32|    330|   const Botan::BigInt d2 = y - x;
   33|       |
   34|    330|   FUZZER_ASSERT_TRUE(d1.cmp(d2, false) == 0);
  ------------------
  |  |   89|    330|   do {                                                               \
  |  |   90|    330|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    330|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 330]
  |  |  ------------------
  |  |   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|    330|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 330]
  |  |  ------------------
  ------------------
   35|       |
   36|    330|   const bool is_eq = (x == y);
   37|    330|   const bool is_lt = (x < y);
   38|    330|   const bool is_gt = (x > y);
   39|    330|   const bool is_lte = (x <= y);
   40|    330|   const bool is_gte = (x >= y);
   41|       |
   42|    330|   if(is_eq) {
  ------------------
  |  Branch (42:7): [True: 3, False: 327]
  ------------------
   43|      3|      FUZZER_ASSERT_TRUE(d1.is_zero());
  ------------------
  |  |   89|      3|   do {                                                               \
  |  |   90|      3|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|      3|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 3]
  |  |  ------------------
  |  |   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|      3|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 3]
  |  |  ------------------
  ------------------
   44|      3|      FUZZER_ASSERT_TRUE(d2.is_zero());
  ------------------
  |  |   89|      3|   do {                                                               \
  |  |   90|      3|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|      3|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 3]
  |  |  ------------------
  |  |   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|      3|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 3]
  |  |  ------------------
  ------------------
   45|      3|   }
   46|       |
   47|    330|   if(is_lte) {
  ------------------
  |  Branch (47:7): [True: 185, False: 145]
  ------------------
   48|    185|      FUZZER_ASSERT_TRUE(is_lt || is_eq);
  ------------------
  |  |   89|    185|   do {                                                               \
  |  |   90|    185|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    188|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:12): [True: 182, False: 3]
  |  |  |  Branch (91:12): [True: 3, 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|    185|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 185]
  |  |  ------------------
  ------------------
   49|    185|   }
   50|       |
   51|    330|   if(is_gte) {
  ------------------
  |  Branch (51:7): [True: 148, False: 182]
  ------------------
   52|    148|      FUZZER_ASSERT_TRUE(is_gt || is_eq);
  ------------------
  |  |   89|    148|   do {                                                               \
  |  |   90|    148|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    151|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:12): [True: 145, False: 3]
  |  |  |  Branch (91:12): [True: 3, 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|    148|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 148]
  |  |  ------------------
  ------------------
   53|    148|   }
   54|       |
   55|    330|   if(is_lt) {
  ------------------
  |  Branch (55:7): [True: 182, False: 148]
  ------------------
   56|    182|      FUZZER_ASSERT_TRUE(!is_gt);
  ------------------
  |  |   89|    182|   do {                                                               \
  |  |   90|    182|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    182|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 182]
  |  |  ------------------
  |  |   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|    182|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 182]
  |  |  ------------------
  ------------------
   57|    182|      FUZZER_ASSERT_TRUE(d1.signum() != 0);
  ------------------
  |  |   89|    182|   do {                                                               \
  |  |   90|    182|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    182|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 182]
  |  |  ------------------
  |  |   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|    182|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 182]
  |  |  ------------------
  ------------------
   58|    182|      FUZZER_ASSERT_TRUE(d2.signum() != 0);
  ------------------
  |  |   89|    182|   do {                                                               \
  |  |   90|    182|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    182|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 182]
  |  |  ------------------
  |  |   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|    182|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 182]
  |  |  ------------------
  ------------------
   59|    182|      FUZZER_ASSERT_TRUE(d1.signum() < 0);
  ------------------
  |  |   89|    182|   do {                                                               \
  |  |   90|    182|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    182|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 182]
  |  |  ------------------
  |  |   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|    182|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 182]
  |  |  ------------------
  ------------------
   60|    182|      FUZZER_ASSERT_TRUE(d2.signum() > 0);
  ------------------
  |  |   89|    182|   do {                                                               \
  |  |   90|    182|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    182|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 182]
  |  |  ------------------
  |  |   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|    182|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 182]
  |  |  ------------------
  ------------------
   61|    182|   }
   62|       |
   63|    330|   if(is_gt) {
  ------------------
  |  Branch (63:7): [True: 145, False: 185]
  ------------------
   64|    145|      FUZZER_ASSERT_TRUE(!is_lt);
  ------------------
  |  |   89|    145|   do {                                                               \
  |  |   90|    145|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    145|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 145]
  |  |  ------------------
  |  |   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|    145|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 145]
  |  |  ------------------
  ------------------
   65|    145|      FUZZER_ASSERT_TRUE(d1.signum() != 0);
  ------------------
  |  |   89|    145|   do {                                                               \
  |  |   90|    145|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    145|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 145]
  |  |  ------------------
  |  |   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|    145|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 145]
  |  |  ------------------
  ------------------
   66|    145|      FUZZER_ASSERT_TRUE(d2.signum() != 0);
  ------------------
  |  |   89|    145|   do {                                                               \
  |  |   90|    145|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    145|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 145]
  |  |  ------------------
  |  |   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|    145|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 145]
  |  |  ------------------
  ------------------
   67|    145|      FUZZER_ASSERT_TRUE(d1.signum() > 0);
  ------------------
  |  |   89|    145|   do {                                                               \
  |  |   90|    145|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    145|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 145]
  |  |  ------------------
  |  |   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|    145|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 145]
  |  |  ------------------
  ------------------
   68|    145|      FUZZER_ASSERT_TRUE(d2.signum() < 0);
  ------------------
  |  |   89|    145|   do {                                                               \
  |  |   90|    145|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    145|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 145]
  |  |  ------------------
  |  |   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|    145|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 145]
  |  |  ------------------
  ------------------
   69|    145|   }
   70|    330|}

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

_ZN5Botan6BigInt4add2ERKS0_PKmmNS0_4SignE:
   20|    660|BigInt BigInt::add2(const BigInt& x, const word y[], size_t y_size, BigInt::Sign y_sign) {
   21|    660|   const size_t x_sw = x.sig_words();
   22|       |
   23|    660|   BigInt z = BigInt::with_capacity(std::max(x_sw, y_size) + 1);
   24|       |
   25|    660|   if(x.sign() == y_sign) {
  ------------------
  |  Branch (25:7): [True: 50, False: 610]
  ------------------
   26|     50|      const word carry = bigint_add3(z.mutable_data(), x._data(), x_sw, y, y_size);
   27|     50|      z.mutable_data()[std::max(x_sw, y_size)] += carry;
   28|     50|      z.set_sign(x.sign());
   29|    610|   } else {
   30|    610|      const int32_t relative_size = bigint_cmp(x.data(), x_sw, y, y_size);
   31|       |
   32|    610|      if(relative_size < 0) {
  ------------------
  |  Branch (32:10): [True: 302, False: 308]
  ------------------
   33|       |         // x < y so z = abs(y - x)
   34|       |         // NOLINTNEXTLINE(*-suspicious-call-argument) intentionally swapping x and y here
   35|    302|         bigint_sub3(z.mutable_data(), y, y_size, x.data(), x_sw);
   36|    302|         z.set_sign(y_sign);
   37|    308|      } else if(relative_size == 0) {
  ------------------
  |  Branch (37:17): [True: 6, False: 302]
  ------------------
   38|       |         // Positive zero (nothing to do in this case)
   39|    302|      } else {
   40|       |         /*
   41|       |         * We know at this point that x >= y so if y_size is larger than
   42|       |         * x_sw, we are guaranteed they are just leading zeros which can
   43|       |         * be ignored
   44|       |         */
   45|    302|         y_size = std::min(x_sw, y_size);
   46|    302|         bigint_sub3(z.mutable_data(), x.data(), x_sw, y, y_size);
   47|    302|         z.set_sign(x.sign());
   48|    302|      }
   49|    610|   }
   50|       |
   51|    660|   return z;
   52|    660|}

_ZN5Botan6BigInt13with_capacityEm:
   49|    660|BigInt BigInt::with_capacity(size_t size) {
   50|    660|   BigInt bn;
   51|    660|   bn.grow_to(size);
   52|    660|   return bn;
   53|    660|}
_ZN5Botan6BigInt10from_bytesENSt3__14spanIKhLm18446744073709551615EEE:
   81|    660|BigInt BigInt::from_bytes(std::span<const uint8_t> input) {
   82|    660|   BigInt r;
   83|    660|   r.assign_from_bytes(input);
   84|    660|   return r;
   85|    660|}
_ZNK5Botan6BigInt3cmpERKS0_b:
  136|    990|int32_t BigInt::cmp(const BigInt& other, bool check_signs) const {
  137|    990|   if(check_signs) {
  ------------------
  |  Branch (137:7): [True: 660, False: 330]
  ------------------
  138|    660|      if(other.signum() >= 0 && this->signum() < 0) {
  ------------------
  |  Branch (138:10): [True: 360, False: 300]
  |  Branch (138:33): [True: 26, False: 334]
  ------------------
  139|     26|         return -1;
  140|     26|      }
  141|       |
  142|    634|      if(other.signum() < 0 && this->signum() >= 0) {
  ------------------
  |  Branch (142:10): [True: 300, False: 334]
  |  Branch (142:32): [True: 24, False: 276]
  ------------------
  143|     24|         return 1;
  144|     24|      }
  145|       |
  146|    610|      if(other.signum() < 0 && this->signum() < 0) {
  ------------------
  |  Branch (146:10): [True: 276, False: 334]
  |  Branch (146:32): [True: 276, False: 0]
  ------------------
  147|    276|         return (-bigint_cmp(this->_data(), this->size(), other._data(), other.size()));
  148|    276|      }
  149|    610|   }
  150|       |
  151|    664|   return bigint_cmp(this->_data(), this->size(), other._data(), other.size());
  152|    990|}
_ZNK5Botan6BigInt8is_equalERKS0_:
  154|    330|bool BigInt::is_equal(const BigInt& other) const {
  155|    330|   if(this->sign() != other.sign()) {
  ------------------
  |  Branch (155:7): [True: 25, False: 305]
  ------------------
  156|     25|      return false;
  157|     25|   }
  158|       |
  159|    305|   return bigint_ct_is_eq(this->_data(), this->size(), other._data(), other.size()).as_bool();
  160|    330|}
_ZNK5Botan6BigInt12is_less_thanERKS0_:
  162|    660|bool BigInt::is_less_than(const BigInt& other) const {
  163|    660|   if(this->signum() < 0 && other.signum() >= 0) {
  ------------------
  |  Branch (163:7): [True: 301, False: 359]
  |  Branch (163:29): [True: 25, False: 276]
  ------------------
  164|     25|      return true;
  165|     25|   }
  166|       |
  167|    635|   if(this->signum() >= 0 && other.signum() < 0) {
  ------------------
  |  Branch (167:7): [True: 359, False: 276]
  |  Branch (167:30): [True: 25, False: 334]
  ------------------
  168|     25|      return false;
  169|     25|   }
  170|       |
  171|    610|   if(other.signum() < 0 && this->signum() < 0) {
  ------------------
  |  Branch (171:7): [True: 276, False: 334]
  |  Branch (171:29): [True: 276, False: 0]
  ------------------
  172|    276|      return bigint_ct_is_lt(other._data(), other.size(), this->_data(), this->size()).as_bool();
  173|    276|   }
  174|       |
  175|    334|   return bigint_ct_is_lt(this->_data(), this->size(), other._data(), other.size()).as_bool();
  176|    610|}
_ZN5Botan6BigInt4Data11set_to_zeroEv:
  189|    660|void BigInt::Data::set_to_zero() {
  190|    660|   m_reg.resize(m_reg.capacity());
  191|    660|   clear_mem(m_reg.data(), m_reg.size());
  192|    660|   m_sig_words = 0;
  193|    660|}
_ZNK5Botan6BigInt4Data14calc_sig_wordsEv:
  213|  1.32k|size_t BigInt::Data::calc_sig_words() const {
  214|  1.32k|   const size_t sz = m_reg.size();
  215|  1.32k|   size_t sig = sz;
  216|       |
  217|  1.32k|   word sub = 1;
  218|       |
  219|  12.1k|   for(size_t i = 0; i != sz; ++i) {
  ------------------
  |  Branch (219:22): [True: 10.8k, False: 1.32k]
  ------------------
  220|  10.8k|      const word w = m_reg[sz - i - 1];
  221|  10.8k|      sub &= ct_is_zero(w);
  222|  10.8k|      sig -= sub;
  223|  10.8k|   }
  224|       |
  225|       |   /*
  226|       |   * This depends on the data so is poisoned, but unpoison it here as
  227|       |   * later conditionals are made on the size.
  228|       |   */
  229|  1.32k|   CT::unpoison(sig);
  230|       |
  231|  1.32k|   return sig;
  232|  1.32k|}
_ZN5Botan6BigInt17assign_from_bytesENSt3__14spanIKhLm18446744073709551615EEE:
  423|    660|void BigInt::assign_from_bytes(std::span<const uint8_t> bytes) {
  424|    660|   clear();
  425|       |
  426|    660|   const size_t length = bytes.size();
  427|    660|   const size_t full_words = length / sizeof(word);
  428|    660|   const size_t extra_bytes = length % sizeof(word);
  429|       |
  430|    660|   const size_t total_words = full_words + (extra_bytes > 0 ? 1 : 0);
  ------------------
  |  Branch (430:45): [True: 482, False: 178]
  ------------------
  431|       |
  432|    660|   secure_vector<word> reg(8 * ceil_division<size_t>(total_words, 8));
  433|       |
  434|  1.18k|   for(size_t i = 0; i != full_words; ++i) {
  ------------------
  |  Branch (434:22): [True: 527, False: 660]
  ------------------
  435|    527|      reg[i] = load_be<word>(bytes.last<sizeof(word)>());
  436|    527|      bytes = bytes.first(bytes.size() - sizeof(word));
  437|    527|   }
  438|       |
  439|    660|   if(!bytes.empty()) {
  ------------------
  |  Branch (439:7): [True: 482, False: 178]
  ------------------
  440|    482|      BOTAN_ASSERT_NOMSG(extra_bytes == bytes.size());
  ------------------
  |  |   84|    482|   do {                                                                     \
  |  |   85|    482|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|    482|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 482]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|    482|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 482]
  |  |  ------------------
  ------------------
  441|    482|      std::array<uint8_t, sizeof(word)> last_partial_word = {0};
  442|    482|      copy_mem(std::span{last_partial_word}.last(extra_bytes), bytes);
  443|    482|      reg[full_words] = load_be<word>(last_partial_word);
  444|    482|   }
  445|       |
  446|    660|   m_data.swap(reg);
  447|    660|}
_ZNK5Botan6BigInt20_const_time_unpoisonEv:
  559|  1.32k|void BigInt::_const_time_unpoison() const {
  560|  1.32k|   CT::unpoison(m_data.const_data(), m_data.size());
  561|  1.32k|}

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

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

