_ZN5Botan17ct_expand_top_bitITkNSt3__117unsigned_integralEmEET_S2_:
   28|  38.1k|BOTAN_FORCE_INLINE constexpr T ct_expand_top_bit(T a) {
   29|  38.1k|   const T top = CT::value_barrier<T>(a >> (sizeof(T) * 8 - 1));
   30|  38.1k|   return static_cast<T>(0) - top;
   31|  38.1k|}
_ZN5Botan6chooseITkNSt3__117unsigned_integralEmEET_S2_S2_S2_:
  216|  21.6k|BOTAN_FORCE_INLINE constexpr T choose(T mask, T a, T b) {
  217|       |   //return (mask & a) | (~mask & b);
  218|  21.6k|   return (b ^ (mask & (a ^ b)));
  219|  21.6k|}
_ZN5Botan10ct_is_zeroITkNSt3__117unsigned_integralEmEET_S2_:
   37|  25.0k|BOTAN_FORCE_INLINE constexpr T ct_is_zero(T x) {
   38|  25.0k|   return ct_expand_top_bit<T>(~x & (x - 1));
   39|  25.0k|}

_ZN5Botan13reverse_bytesITkNSt3__117unsigned_integralEmQooooooeqstT_Li1EeqstS2_Li2EeqstS2_Li4EeqstS2_Li8EEES2_S2_:
   27|  1.02k|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|       |   } 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|  1.02k|   } else if constexpr(sizeof(T) == 8) {
   45|  1.02k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap64)
   46|  1.02k|      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|  1.02k|   }
   57|  1.02k|}

_ZN5Botan2CT4MaskImE8is_equalEmm:
  442|  13.1k|      static constexpr Mask<T> is_equal(T x, T y) {
  443|  13.1k|         const T diff = value_barrier(x) ^ value_barrier(y);
  444|  13.1k|         return Mask<T>::is_zero(diff);
  445|  13.1k|      }
_ZN5Botan2CT4MaskImE5is_ltEmm:
  450|  13.1k|      static constexpr Mask<T> is_lt(T x, T y) {
  451|  13.1k|         T u = x ^ ((x ^ y) | ((x - y) ^ x));
  452|  13.1k|         return Mask<T>::expand_top_bit(u);
  453|  13.1k|      }
_ZN5Botan2CT4MaskImE14expand_top_bitEm:
  415|  13.1k|      static constexpr Mask<T> expand_top_bit(T v) { return Mask<T>(ct_expand_top_bit<T>(v)); }
_ZN5Botan2CT4MaskImEC2Em:
  637|  32.9k|      constexpr explicit Mask(T m) : m_mask(m) {}
_ZNK5Botan2CT4MaskImE6selectEmm:
  548|  21.6k|      constexpr T select(T x, T y) const { return choose(value(), x, y); }
_ZNK5Botan2CT4MaskImE5valueEv:
  630|  32.9k|      constexpr T value() const { return value_barrier<T>(m_mask); }
_ZN5Botan2CT4MaskImE7is_zeroEm:
  437|  14.3k|      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);
  ------------------
  |  |  144|  5.10k|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
   75|  5.10k|}
_ZN5Botan2CT4MaskImE6expandEm:
  392|    614|      static constexpr Mask<T> expand(T v) { return ~Mask<T>::is_zero(value_barrier<T>(v)); }
_ZNK5Botan2CT4MaskImEcoEv:
  533|    614|      constexpr Mask<T> operator~() const { return Mask<T>(~value()); }
_ZNK5Botan2CT4MaskImE7as_boolEv:
  614|    921|      constexpr bool as_bool() const { return unpoisoned_value() != 0; }
_ZNK5Botan2CT4MaskImE16unpoisoned_valueEv:
  598|    921|      constexpr T unpoisoned_value() const {
  599|    921|         T r = value();
  600|    921|         CT::unpoison(r);
  601|    921|         return r;
  602|    921|      }
_ZNK5Botan2CT4MaskImE11select_maskES2_S2_:
  559|  4.91k|      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.31k|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.31k|   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.31k|   if(a != 0 && r / a != b) {
  ------------------
  |  Branch (53:7): [True: 1.31k, False: 0]
  |  Branch (53:17): [True: 0, False: 1.31k]
  ------------------
   54|      0|      return {};
   55|      0|   }
   56|  1.31k|   return r;
   57|  1.31k|}

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

_ZN5Botan10word8_add3ITkNS_8WordTypeEmEET_PS1_PKS1_S4_S1_:
  294|      2|inline constexpr auto word8_add3(W z[8], const W x[8], const W y[8], W carry) -> W {
  295|      2|#if defined(BOTAN_MP_USE_X86_64_ASM)
  296|      2|   if(std::same_as<W, uint64_t> && !std::is_constant_evaluated()) {
  ------------------
  |  Branch (296:7): [True: 0, Folded]
  |  Branch (296:36): [True: 0, Folded]
  ------------------
  297|      2|      asm volatile(ADD_OR_SUBTRACT(DO_8_TIMES(ADDSUB3_OP, "adcq"))
  298|      2|                   : [carry] "=r"(carry)
  299|      2|                   : [x] "r"(x), [y] "r"(y), [z] "r"(z), "0"(carry)
  300|      2|                   : "cc", "memory");
  301|      2|      return carry;
  302|      2|   }
  303|      0|#endif
  304|       |
  305|      0|   z[0] = word_add(x[0], y[0], &carry);
  306|      0|   z[1] = word_add(x[1], y[1], &carry);
  307|      0|   z[2] = word_add(x[2], y[2], &carry);
  308|      0|   z[3] = word_add(x[3], y[3], &carry);
  309|      0|   z[4] = word_add(x[4], y[4], &carry);
  310|      0|   z[5] = word_add(x[5], y[5], &carry);
  311|      0|   z[6] = word_add(x[6], y[6], &carry);
  312|      0|   z[7] = word_add(x[7], y[7], &carry);
  313|      0|   return carry;
  314|      2|}
_ZN5Botan8word_addITkNS_8WordTypeEmEET_S1_S1_PS1_:
  231|    134|inline constexpr auto word_add(W x, W y, W* carry) -> W {
  232|    134|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_addc)
  233|    134|   if(!std::is_constant_evaluated()) {
  ------------------
  |  Branch (233:7): [True: 134, Folded]
  ------------------
  234|       |      if constexpr(std::same_as<W, unsigned int>) {
  235|       |         return __builtin_addc(x, y, *carry & 1, carry);
  236|    134|      } else if constexpr(std::same_as<W, unsigned long>) {
  237|    134|         return __builtin_addcl(x, y, *carry & 1, carry);
  238|       |      } else if constexpr(std::same_as<W, unsigned long long>) {
  239|       |         return __builtin_addcll(x, y, *carry & 1, carry);
  240|       |      }
  241|    134|   }
  242|      0|#endif
  243|       |
  244|       |   if constexpr(WordInfo<W>::dword_is_native && use_dword_for_word_add) {
  245|       |      /*
  246|       |      TODO(Botan4) this is largely a performance hack for GCCs that don't
  247|       |      support __builtin_addc, if we increase the minimum supported version of
  248|       |      GCC to GCC 14 then we can remove this and not worry about it
  249|       |      */
  250|       |      const W cb = *carry & 1;
  251|       |      const auto s = typename WordInfo<W>::dword(x) + y + cb;
  252|       |      *carry = static_cast<W>(s >> WordInfo<W>::bits);
  253|       |      return static_cast<W>(s);
  254|    134|   } else {
  255|    134|      const W cb = *carry & 1;
  256|    134|      W z = x + y;
  257|    134|      W c1 = (z < x);
  258|    134|      z += cb;
  259|    134|      *carry = c1 | (z < cb);
  260|    134|      return z;
  261|    134|   }
  262|    134|}
_ZN5Botan10word8_sub3ITkNS_8WordTypeEmEET_PS1_PKS1_S4_S1_:
  371|      2|inline constexpr auto word8_sub3(W z[8], const W x[8], const W y[8], W carry) -> W {
  372|      2|#if defined(BOTAN_MP_USE_X86_64_ASM)
  373|      2|   if(std::same_as<W, uint64_t> && !std::is_constant_evaluated()) {
  ------------------
  |  Branch (373:7): [True: 0, Folded]
  |  Branch (373:36): [True: 0, Folded]
  ------------------
  374|      2|      asm volatile(ADD_OR_SUBTRACT(DO_8_TIMES(ADDSUB3_OP, "sbbq"))
  375|      2|                   : [carry] "=r"(carry)
  376|      2|                   : [x] "r"(x), [y] "r"(y), [z] "r"(z), "0"(carry)
  377|      2|                   : "cc", "memory");
  378|      2|      return carry;
  379|      2|   }
  380|      0|#endif
  381|       |
  382|      0|   z[0] = word_sub(x[0], y[0], &carry);
  383|      0|   z[1] = word_sub(x[1], y[1], &carry);
  384|      0|   z[2] = word_sub(x[2], y[2], &carry);
  385|      0|   z[3] = word_sub(x[3], y[3], &carry);
  386|      0|   z[4] = word_sub(x[4], y[4], &carry);
  387|      0|   z[5] = word_sub(x[5], y[5], &carry);
  388|      0|   z[6] = word_sub(x[6], y[6], &carry);
  389|      0|   z[7] = word_sub(x[7], y[7], &carry);
  390|      0|   return carry;
  391|      2|}
_ZN5Botan8word_subITkNS_8WordTypeEmEET_S1_S1_PS1_:
  320|    840|inline constexpr auto word_sub(W x, W y, W* carry) -> W {
  321|    840|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_subc)
  322|    840|   if(!std::is_constant_evaluated()) {
  ------------------
  |  Branch (322:7): [True: 840, Folded]
  ------------------
  323|       |      if constexpr(std::same_as<W, unsigned int>) {
  324|       |         return __builtin_subc(x, y, *carry & 1, carry);
  325|    840|      } else if constexpr(std::same_as<W, unsigned long>) {
  326|    840|         return __builtin_subcl(x, y, *carry & 1, carry);
  327|       |      } else if constexpr(std::same_as<W, unsigned long long>) {
  328|       |         return __builtin_subcll(x, y, *carry & 1, carry);
  329|       |      }
  330|    840|   }
  331|      0|#endif
  332|       |
  333|      0|   const W cb = *carry & 1;
  334|    840|   W t0 = x - y;
  335|    840|   W c1 = (t0 > x);
  336|    840|   W z = t0 - cb;
  337|    840|   *carry = c1 | (z > t0);
  338|    840|   return z;
  339|    840|}

_ZN5Botan11bigint_add3ITkNS_8WordTypeEmEET_PS1_PKS1_mS4_m:
  120|     51|inline constexpr auto bigint_add3(W z[], const W x[], size_t x_size, const W y[], size_t y_size) -> W {
  121|     51|   if(x_size < y_size) {
  ------------------
  |  Branch (121:7): [True: 9, False: 42]
  ------------------
  122|      9|      return bigint_add3(z, y, y_size, x, x_size);
  123|      9|   }
  124|       |
  125|     42|   W carry = 0;
  126|       |
  127|     42|   const size_t blocks = y_size - (y_size % 8);
  128|       |
  129|     44|   for(size_t i = 0; i != blocks; i += 8) {
  ------------------
  |  Branch (129:22): [True: 2, False: 42]
  ------------------
  130|      2|      carry = word8_add3(z + i, x + i, y + i, carry);
  131|      2|   }
  132|       |
  133|    144|   for(size_t i = blocks; i != y_size; ++i) {
  ------------------
  |  Branch (133:27): [True: 102, False: 42]
  ------------------
  134|    102|      z[i] = word_add(x[i], y[i], &carry);
  135|    102|   }
  136|       |
  137|     74|   for(size_t i = y_size; i != x_size; ++i) {
  ------------------
  |  Branch (137:27): [True: 32, False: 42]
  ------------------
  138|     32|      z[i] = word_add(x[i], static_cast<W>(0), &carry);
  139|     32|   }
  140|       |
  141|     42|   return carry;
  142|     51|}
_ZN5Botan10bigint_cmpITkNS_8WordTypeEmEEiPKT_mS3_m:
  439|  1.55k|inline constexpr int32_t bigint_cmp(const W x[], size_t x_size, const W y[], size_t y_size) {
  440|  1.55k|   static_assert(sizeof(W) >= sizeof(uint32_t), "Size assumption");
  441|       |
  442|  1.55k|   const W LT = static_cast<W>(-1);
  443|  1.55k|   const W EQ = 0;
  444|  1.55k|   const W GT = 1;
  445|       |
  446|  1.55k|   const size_t common_elems = std::min(x_size, y_size);
  447|       |
  448|  1.55k|   W result = EQ;  // until found otherwise
  449|       |
  450|  9.76k|   for(size_t i = 0; i != common_elems; i++) {
  ------------------
  |  Branch (450:22): [True: 8.21k, False: 1.55k]
  ------------------
  451|  8.21k|      const auto is_eq = CT::Mask<W>::is_equal(x[i], y[i]);
  452|  8.21k|      const auto is_lt = CT::Mask<W>::is_lt(x[i], y[i]);
  453|       |
  454|  8.21k|      result = is_eq.select(result, is_lt.select(LT, GT));
  455|  8.21k|   }
  456|       |
  457|  1.55k|   if(x_size < y_size) {
  ------------------
  |  Branch (457:7): [True: 139, False: 1.41k]
  ------------------
  458|    139|      W mask = 0;
  459|    308|      for(size_t i = x_size; i != y_size; i++) {
  ------------------
  |  Branch (459:30): [True: 169, False: 139]
  ------------------
  460|    169|         mask |= y[i];
  461|    169|      }
  462|       |
  463|       |      // If any bits were set in high part of y, then x < y
  464|    139|      result = CT::Mask<W>::is_zero(mask).select(result, LT);
  465|  1.41k|   } else if(y_size < x_size) {
  ------------------
  |  Branch (465:14): [True: 139, False: 1.27k]
  ------------------
  466|    139|      W mask = 0;
  467|    308|      for(size_t i = y_size; i != x_size; i++) {
  ------------------
  |  Branch (467:30): [True: 169, False: 139]
  ------------------
  468|    169|         mask |= x[i];
  469|    169|      }
  470|       |
  471|       |      // If any bits were set in high part of x, then x > y
  472|    139|      result = CT::Mask<W>::is_zero(mask).select(result, GT);
  473|    139|   }
  474|       |
  475|  1.55k|   CT::unpoison(result);
  476|  1.55k|   BOTAN_DEBUG_ASSERT(result == LT || result == GT || result == EQ);
  ------------------
  |  |  130|  1.55k|      do { /* NOLINT(*-avoid-do-while) */ \
  |  |  131|  1.55k|      } while(0)
  |  |  ------------------
  |  |  |  Branch (131:15): [Folded, False: 1.55k]
  |  |  ------------------
  ------------------
  477|  1.55k|   return static_cast<int32_t>(result);
  478|  1.55k|}
_ZN5Botan11bigint_sub3ITkNS_8WordTypeEmEET_PS1_PKS1_mS4_m:
  192|    606|inline constexpr auto bigint_sub3(W z[], const W x[], size_t x_size, const W y[], size_t y_size) -> W {
  193|    606|   W borrow = 0;
  194|       |
  195|    606|   BOTAN_ASSERT(x_size >= y_size, "Expected sizes");
  ------------------
  |  |   64|    606|   do {                                                                                 \
  |  |   65|    606|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                     \
  |  |   66|    606|      if(!(expr)) {                                                                     \
  |  |  ------------------
  |  |  |  Branch (66:10): [True: 0, False: 606]
  |  |  ------------------
  |  |   67|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                            \
  |  |   68|      0|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   69|      0|      }                                                                                 \
  |  |   70|    606|   } while(0)
  |  |  ------------------
  |  |  |  Branch (70:12): [Folded, False: 606]
  |  |  ------------------
  ------------------
  196|       |
  197|    606|   const size_t blocks = y_size - (y_size % 8);
  198|       |
  199|    608|   for(size_t i = 0; i != blocks; i += 8) {
  ------------------
  |  Branch (199:22): [True: 2, False: 606]
  ------------------
  200|      2|      borrow = word8_sub3(z + i, x + i, y + i, borrow);
  201|      2|   }
  202|       |
  203|  1.10k|   for(size_t i = blocks; i != y_size; ++i) {
  ------------------
  |  Branch (203:27): [True: 502, False: 606]
  ------------------
  204|    502|      z[i] = word_sub(x[i], y[i], &borrow);
  205|    502|   }
  206|       |
  207|    944|   for(size_t i = y_size; i != x_size; ++i) {
  ------------------
  |  Branch (207:27): [True: 338, False: 606]
  ------------------
  208|    338|      z[i] = word_sub(x[i], static_cast<W>(0), &borrow);
  209|    338|   }
  210|       |
  211|    606|   return borrow;
  212|    606|}
_ZN5Botan15bigint_ct_is_eqITkNS_8WordTypeEmEENS_2CT4MaskIT_EEPKS3_mS6_m:
  519|    307|inline constexpr auto bigint_ct_is_eq(const W x[], size_t x_size, const W y[], size_t y_size) -> CT::Mask<W> {
  520|    307|   const size_t common_elems = std::min(x_size, y_size);
  521|       |
  522|    307|   W diff = 0;
  523|       |
  524|  2.76k|   for(size_t i = 0; i != common_elems; i++) {
  ------------------
  |  Branch (524:22): [True: 2.45k, False: 307]
  ------------------
  525|  2.45k|      diff |= (x[i] ^ y[i]);
  526|  2.45k|   }
  527|       |
  528|       |   // If any bits were set in high part of x/y, then they are not equal
  529|    307|   if(x_size < y_size) {
  ------------------
  |  Branch (529:7): [True: 0, False: 307]
  ------------------
  530|      0|      for(size_t i = x_size; i != y_size; i++) {
  ------------------
  |  Branch (530:30): [True: 0, False: 0]
  ------------------
  531|      0|         diff |= y[i];
  532|      0|      }
  533|    307|   } else if(y_size < x_size) {
  ------------------
  |  Branch (533:14): [True: 0, False: 307]
  ------------------
  534|      0|      for(size_t i = y_size; i != x_size; i++) {
  ------------------
  |  Branch (534:30): [True: 0, False: 0]
  ------------------
  535|      0|         diff |= x[i];
  536|      0|      }
  537|      0|   }
  538|       |
  539|    307|   return CT::Mask<W>::is_zero(diff);
  540|    307|}
_ZN5Botan15bigint_ct_is_ltITkNS_8WordTypeEmEENS_2CT4MaskIT_EEPKS3_mS6_mb:
  487|    614|   -> CT::Mask<W> {
  488|    614|   const size_t common_elems = std::min(x_size, y_size);
  489|       |
  490|    614|   auto is_lt = CT::Mask<W>::expand(lt_or_equal);
  491|       |
  492|  5.52k|   for(size_t i = 0; i != common_elems; i++) {
  ------------------
  |  Branch (492:22): [True: 4.91k, False: 614]
  ------------------
  493|  4.91k|      const auto eq = CT::Mask<W>::is_equal(x[i], y[i]);
  494|  4.91k|      const auto lt = CT::Mask<W>::is_lt(x[i], y[i]);
  495|  4.91k|      is_lt = eq.select_mask(is_lt, lt);
  496|  4.91k|   }
  497|       |
  498|    614|   if(x_size < y_size) {
  ------------------
  |  Branch (498:7): [True: 0, False: 614]
  ------------------
  499|      0|      W mask = 0;
  500|      0|      for(size_t i = x_size; i != y_size; i++) {
  ------------------
  |  Branch (500:30): [True: 0, False: 0]
  ------------------
  501|      0|         mask |= y[i];
  502|      0|      }
  503|       |      // If any bits were set in high part of y, then is_lt should be forced true
  504|      0|      is_lt |= CT::Mask<W>::expand(mask);
  505|    614|   } else if(y_size < x_size) {
  ------------------
  |  Branch (505:14): [True: 0, False: 614]
  ------------------
  506|      0|      W mask = 0;
  507|      0|      for(size_t i = y_size; i != x_size; i++) {
  ------------------
  |  Branch (507:30): [True: 0, False: 0]
  ------------------
  508|      0|         mask |= x[i];
  509|      0|      }
  510|       |
  511|       |      // If any bits were set in high part of x, then is_lt should be false
  512|      0|      is_lt &= CT::Mask<W>::is_zero(mask);
  513|      0|   }
  514|       |
  515|    614|   return is_lt;
  516|    614|}

_ZN5Botan8round_upEmm:
   26|    656|constexpr inline size_t round_up(size_t n, size_t align_to) {
   27|       |   // Arguably returning n in this case would also be sensible
   28|    656|   BOTAN_ARG_CHECK(align_to != 0, "align_to must not be 0");
  ------------------
  |  |   35|    656|   do {                                                          \
  |  |   36|    656|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    656|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 656]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    656|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 656]
  |  |  ------------------
  ------------------
   29|       |
   30|    656|   if(n % align_to > 0) {
  ------------------
  |  Branch (30:7): [True: 641, False: 15]
  ------------------
   31|    641|      const size_t adj = align_to - (n % align_to);
   32|    641|      BOTAN_ARG_CHECK(n + adj >= n, "Integer overflow during rounding");
  ------------------
  |  |   35|    641|   do {                                                          \
  |  |   36|    641|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    641|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 641]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    641|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 641]
  |  |  ------------------
  ------------------
   33|    641|      n += adj;
   34|    641|   }
   35|    656|   return n;
   36|    656|}

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

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

_ZN5Botan6BigInt9flip_signEv:
  657|    315|      BOTAN_DEPRECATED("Deprecated no replacement") void flip_sign() { set_sign(reverse_sign()); }
_ZN5Botan6BigInt8set_signENS0_4SignE:
  663|    963|      void set_sign(Sign sign) {
  664|    963|         if(sign == Negative && is_zero()) {
  ------------------
  |  Branch (664:13): [True: 639, False: 324]
  |  Branch (664:33): [True: 20, False: 619]
  ------------------
  665|     20|            sign = Positive;
  666|     20|         }
  667|       |
  668|    963|         m_signedness = sign;
  669|    963|      }
_ZNK5Botan6BigInt12reverse_signEv:
  647|    971|      Sign reverse_sign() const {
  648|    971|         if(sign() == Positive) {
  ------------------
  |  Branch (648:13): [True: 676, False: 295]
  ------------------
  649|    676|            return Negative;
  650|    676|         }
  651|    295|         return Positive;
  652|    971|      }
_ZNK5Botan6BigInt4signEv:
  641|  8.78k|      Sign sign() const { return (m_signedness); }
_ZN5BotanmiERKNS_6BigIntES2_:
 1219|    656|inline BigInt operator-(const BigInt& x, const BigInt& y) {
 1220|    656|   return BigInt::add2(x, y._data(), y.sig_words(), y.reverse_sign());
 1221|    656|}
_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.93k|      size_t sig_words() const { return m_data.sig_words(); }
_ZNK5Botan6BigInt4Data9sig_wordsEv:
 1163|  8.93k|            size_t sig_words() const {
 1164|  8.93k|               if(m_sig_words == sig_words_npos) {
  ------------------
  |  Branch (1164:19): [True: 1.31k, False: 7.61k]
  ------------------
 1165|  1.31k|                  m_sig_words = calc_sig_words();
 1166|  1.31k|               }
 1167|  8.93k|               return m_sig_words;
 1168|  8.93k|            }
_ZN5BotaneqERKNS_6BigIntES2_:
 1313|    328|inline bool operator==(const BigInt& a, const BigInt& b) {
 1314|    328|   return a.is_equal(b);
 1315|    328|}
_ZN5BotanltERKNS_6BigIntES2_:
 1353|    328|inline bool operator<(const BigInt& a, const BigInt& b) {
 1354|    328|   return a.is_less_than(b);
 1355|    328|}
_ZN5BotangtERKNS_6BigIntES2_:
 1363|    328|inline bool operator>(const BigInt& a, const BigInt& b) {
 1364|    328|   return b.is_less_than(a);
 1365|    328|}
_ZN5BotanleERKNS_6BigIntES2_:
 1333|    328|inline bool operator<=(const BigInt& a, const BigInt& b) {
 1334|    328|   return (a.cmp(b) <= 0);
 1335|    328|}
_ZN5BotangeERKNS_6BigIntES2_:
 1343|    328|inline bool operator>=(const BigInt& a, const BigInt& b) {
 1344|    328|   return (a.cmp(b) >= 0);
 1345|    328|}
_ZNK5Botan6BigInt7is_zeroEv:
  510|    647|      bool is_zero() const { return sig_words() == 0; }
_ZNK5Botan6BigInt6signumEv:
  493|  6.97k|      int signum() const {
  494|  6.97k|         if(sig_words() == 0) {
  ------------------
  |  Branch (494:13): [True: 811, False: 6.16k]
  ------------------
  495|    811|            return 0;
  496|    811|         }
  497|  6.16k|         return (sign() == Negative) ? -1 : 1;
  ------------------
  |  Branch (497:17): [True: 3.49k, False: 2.66k]
  ------------------
  498|  6.97k|      }
_ZN5Botan6BigIntD2Ev:
  185|  1.31k|      ~BigInt() { _const_time_unpoison(); }
_ZN5Botan6BigInt5clearEv:
  441|    656|      void clear() {
  442|    656|         m_data.set_to_zero();
  443|    656|         m_signedness = Positive;
  444|    656|      }
_ZNK5Botan6BigInt4sizeEv:
  681|  3.72k|      size_t size() const { return m_data.size(); }
_ZN5Botan6BigInt12mutable_dataEv:
  712|    690|      BOTAN_DEPRECATED("Deprecated no replacement") word* mutable_data() { return m_data.mutable_data(); }
_ZNK5Botan6BigInt4dataEv:
  718|  1.22k|      BOTAN_DEPRECATED("Deprecated no replacement") const word* data() const { return m_data.const_data(); }
_ZNK5Botan6BigInt7grow_toEm:
  738|    656|      BOTAN_DEPRECATED("Deprecated no replacement") void grow_to(size_t n) const { m_data.grow_to(n); }
_ZN5Botan6BigInt4Data12mutable_dataEv:
 1083|    690|            word* mutable_data() {
 1084|    690|               invalidate_sig_words();
 1085|    690|               return m_reg.data();
 1086|    690|            }
_ZNK5Botan6BigInt4Data7grow_toEm:
 1126|    656|            void grow_to(size_t n) const {
 1127|    656|               if(n > size()) {
  ------------------
  |  Branch (1127:19): [True: 656, False: 0]
  ------------------
 1128|    656|                  if(n <= m_reg.capacity()) {
  ------------------
  |  Branch (1128:22): [True: 0, False: 656]
  ------------------
 1129|      0|                     m_reg.resize(n);
 1130|    656|                  } else {
 1131|    656|                     m_reg.resize(n + (8 - (n % 8)));
 1132|    656|                  }
 1133|    656|               }
 1134|    656|            }
_ZNK5Botan6BigInt4Data4sizeEv:
 1136|  5.69k|            size_t size() const { return m_reg.size(); }
_ZN5Botan6BigInt4Data4swapERNSt3__16vectorImNS_16secure_allocatorImEEEE:
 1156|    656|            void swap(secure_vector<word>& reg) noexcept {
 1157|    656|               m_reg.swap(reg);
 1158|    656|               invalidate_sig_words();
 1159|    656|            }
_ZNK5Botan6BigInt4Data20invalidate_sig_wordsEv:
 1161|  1.34k|            void invalidate_sig_words() const noexcept { m_sig_words = sig_words_npos; }
_ZN5Botan6BigIntC2Ev:
   45|  1.31k|      BigInt() = default;

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

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

_ZN5Botan16secure_allocatorImE10deallocateEPmm:
  102|  1.31k|      void deallocate(T* p, std::size_t n) { deallocate_memory(p, n, sizeof(T)); }
_ZN5Botan16secure_allocatorImE8allocateEm:
   95|  1.31k|      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_:
  353|  1.02k|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  354|  1.02k|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  355|       |      // Noop, if the parameter type already is the desired return type.
  356|  1.02k|      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|  1.02k|}

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

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

_ZN5Botan6BigInt4add2ERKS0_PKmmNS0_4SignE:
   20|    656|BigInt BigInt::add2(const BigInt& x, const word y[], size_t y_size, BigInt::Sign y_sign) {
   21|    656|   const size_t x_sw = x.sig_words();
   22|       |
   23|    656|   BigInt z = BigInt::with_capacity(std::max(x_sw, y_size) + 1);
   24|       |
   25|    656|   if(x.sign() == y_sign) {
  ------------------
  |  Branch (25:7): [True: 42, False: 614]
  ------------------
   26|     42|      const word carry = bigint_add3(z.mutable_data(), x._data(), x_sw, y, y_size);
   27|     42|      z.mutable_data()[std::max(x_sw, y_size)] += carry;
   28|     42|      z.set_sign(x.sign());
   29|    614|   } else {
   30|    614|      const int32_t relative_size = bigint_cmp(x.data(), x_sw, y, y_size);
   31|       |
   32|    614|      if(relative_size < 0) {
  ------------------
  |  Branch (32:10): [True: 303, False: 311]
  ------------------
   33|       |         // x < y so z = abs(y - x)
   34|       |         // NOLINTNEXTLINE(*-suspicious-call-argument) intentionally swapping x and y here
   35|    303|         bigint_sub3(z.mutable_data(), y, y_size, x.data(), x_sw);
   36|    303|         z.set_sign(y_sign);
   37|    311|      } else if(relative_size == 0) {
  ------------------
  |  Branch (37:17): [True: 8, False: 303]
  ------------------
   38|       |         // Positive zero (nothing to do in this case)
   39|    303|      } 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|    303|         y_size = std::min(x_sw, y_size);
   46|    303|         bigint_sub3(z.mutable_data(), x.data(), x_sw, y, y_size);
   47|    303|         z.set_sign(x.sign());
   48|    303|      }
   49|    614|   }
   50|       |
   51|    656|   return z;
   52|    656|}

_ZN5Botan6BigInt13with_capacityEm:
   51|    656|BigInt BigInt::with_capacity(size_t size) {
   52|    656|   BigInt bn;
   53|    656|   bn.grow_to(size);
   54|    656|   return bn;
   55|    656|}
_ZN5Botan6BigInt10from_bytesENSt3__14spanIKhLm18446744073709551615EEE:
   83|    656|BigInt BigInt::from_bytes(std::span<const uint8_t> input) {
   84|    656|   BigInt r;
   85|    656|   r.assign_from_bytes(input);
   86|    656|   return r;
   87|    656|}
_ZNK5Botan6BigInt3cmpERKS0_b:
  138|    984|int32_t BigInt::cmp(const BigInt& other, bool check_signs) const {
  139|    984|   if(check_signs) {
  ------------------
  |  Branch (139:7): [True: 656, False: 328]
  ------------------
  140|    656|      if(other.signum() >= 0 && this->signum() < 0) {
  ------------------
  |  Branch (140:10): [True: 356, False: 300]
  |  Branch (140:33): [True: 16, False: 340]
  ------------------
  141|     16|         return -1;
  142|     16|      }
  143|       |
  144|    640|      if(other.signum() < 0 && this->signum() >= 0) {
  ------------------
  |  Branch (144:10): [True: 300, False: 340]
  |  Branch (144:32): [True: 26, False: 274]
  ------------------
  145|     26|         return 1;
  146|     26|      }
  147|       |
  148|    614|      if(other.signum() < 0 && this->signum() < 0) {
  ------------------
  |  Branch (148:10): [True: 274, False: 340]
  |  Branch (148:32): [True: 274, False: 0]
  ------------------
  149|    274|         return (-bigint_cmp(this->_data(), this->size(), other._data(), other.size()));
  150|    274|      }
  151|    614|   }
  152|       |
  153|    668|   return bigint_cmp(this->_data(), this->size(), other._data(), other.size());
  154|    984|}
_ZNK5Botan6BigInt8is_equalERKS0_:
  156|    328|bool BigInt::is_equal(const BigInt& other) const {
  157|    328|   if(this->sign() != other.sign()) {
  ------------------
  |  Branch (157:7): [True: 21, False: 307]
  ------------------
  158|     21|      return false;
  159|     21|   }
  160|       |
  161|    307|   return bigint_ct_is_eq(this->_data(), this->size(), other._data(), other.size()).as_bool();
  162|    328|}
_ZNK5Botan6BigInt12is_less_thanERKS0_:
  164|    656|bool BigInt::is_less_than(const BigInt& other) const {
  165|    656|   if(this->signum() < 0 && other.signum() >= 0) {
  ------------------
  |  Branch (165:7): [True: 295, False: 361]
  |  Branch (165:29): [True: 21, False: 274]
  ------------------
  166|     21|      return true;
  167|     21|   }
  168|       |
  169|    635|   if(this->signum() >= 0 && other.signum() < 0) {
  ------------------
  |  Branch (169:7): [True: 361, False: 274]
  |  Branch (169:30): [True: 21, False: 340]
  ------------------
  170|     21|      return false;
  171|     21|   }
  172|       |
  173|    614|   if(other.signum() < 0 && this->signum() < 0) {
  ------------------
  |  Branch (173:7): [True: 274, False: 340]
  |  Branch (173:29): [True: 274, False: 0]
  ------------------
  174|    274|      return bigint_ct_is_lt(other._data(), other.size(), this->_data(), this->size()).as_bool();
  175|    274|   }
  176|       |
  177|    340|   return bigint_ct_is_lt(this->_data(), this->size(), other._data(), other.size()).as_bool();
  178|    614|}
_ZN5Botan6BigInt4Data11set_to_zeroEv:
  191|    656|void BigInt::Data::set_to_zero() {
  192|    656|   m_reg.resize(m_reg.capacity());
  193|    656|   clear_mem(m_reg.data(), m_reg.size());
  194|    656|   m_sig_words = 0;
  195|    656|}
_ZNK5Botan6BigInt4Data14calc_sig_wordsEv:
  215|  1.31k|size_t BigInt::Data::calc_sig_words() const {
  216|  1.31k|   const size_t sz = m_reg.size();
  217|  1.31k|   size_t sig = sz;
  218|       |
  219|  1.31k|   word sub = 1;
  220|       |
  221|  12.0k|   for(size_t i = 0; i != sz; ++i) {
  ------------------
  |  Branch (221:22): [True: 10.7k, False: 1.31k]
  ------------------
  222|  10.7k|      const word w = m_reg[sz - i - 1];
  223|  10.7k|      sub &= ct_is_zero(w);
  224|  10.7k|      sig -= sub;
  225|  10.7k|   }
  226|       |
  227|       |   /*
  228|       |   * This depends on the data so is poisoned, but unpoison it here as
  229|       |   * later conditionals are made on the size.
  230|       |   */
  231|  1.31k|   CT::unpoison(sig);
  232|       |
  233|  1.31k|   return sig;
  234|  1.31k|}
_ZN5Botan6BigInt17assign_from_bytesENSt3__14spanIKhLm18446744073709551615EEE:
  425|    656|void BigInt::assign_from_bytes(std::span<const uint8_t> bytes) {
  426|    656|   clear();
  427|       |
  428|    656|   const size_t length = bytes.size();
  429|    656|   const size_t full_words = length / sizeof(word);
  430|    656|   const size_t extra_bytes = length % sizeof(word);
  431|       |
  432|    656|   secure_vector<word> reg((round_up(full_words + (extra_bytes > 0 ? 1 : 0), 8)));
  ------------------
  |  Branch (432:52): [True: 481, False: 175]
  ------------------
  433|       |
  434|  1.19k|   for(size_t i = 0; i != full_words; ++i) {
  ------------------
  |  Branch (434:22): [True: 539, False: 656]
  ------------------
  435|    539|      reg[i] = load_be<word>(bytes.last<sizeof(word)>());
  436|    539|      bytes = bytes.first(bytes.size() - sizeof(word));
  437|    539|   }
  438|       |
  439|    656|   if(!bytes.empty()) {
  ------------------
  |  Branch (439:7): [True: 481, False: 175]
  ------------------
  440|    481|      BOTAN_ASSERT_NOMSG(extra_bytes == bytes.size());
  ------------------
  |  |   77|    481|   do {                                                                     \
  |  |   78|    481|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|    481|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 481]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|    481|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 481]
  |  |  ------------------
  ------------------
  441|    481|      std::array<uint8_t, sizeof(word)> last_partial_word = {0};
  442|    481|      copy_mem(std::span{last_partial_word}.last(extra_bytes), bytes);
  443|    481|      reg[full_words] = load_be<word>(last_partial_word);
  444|    481|   }
  445|       |
  446|    656|   m_data.swap(reg);
  447|    656|}
_ZNK5Botan6BigInt20_const_time_unpoisonEv:
  559|  1.31k|void BigInt::_const_time_unpoison() const {
  560|  1.31k|   CT::unpoison(m_data.const_data(), m_data.size());
  561|  1.31k|}

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

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

