; LLVM IR from square/subzero :: core/trezor-crypto (ecdsa)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.bignum256 = type { [9 x i32] }
%struct.ecdsa_curve = type { %struct.bignum256, %struct.curve_point, %struct.bignum256, %struct.bignum256, i32, %struct.bignum256, [64 x [8 x %struct.curve_point]] }
%struct.curve_point = type { %struct.bignum256, %struct.bignum256 }
%struct.jacobian_curve_point = type { %struct.bignum256, %struct.bignum256, %struct.bignum256 }

@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@__PRETTY_FUNCTION__.point_jacobian_add = external hidden unnamed_addr constant [90 x i8], align 1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare void @bn_subtractmod(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare void @bn_multiply(ptr noundef, ptr noundef, ptr noundef) #2

declare void @bn_fast_mod(ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare void @bn_mult_k(ptr noundef, i8 noundef zeroext, ptr noundef) #2

declare i32 @bn_is_equal(ptr noundef, ptr noundef) #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @point_jacobian_add(ptr noundef %0, ptr noundef %1, ptr noundef %2) #4 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.bignum256, align 4
  %8 = alloca %struct.bignum256, align 4
  %9 = alloca %struct.bignum256, align 4
  %10 = alloca %struct.bignum256, align 4
  %11 = alloca %struct.bignum256, align 4
  %12 = alloca %struct.bignum256, align 4
  %13 = alloca %struct.bignum256, align 4
  %14 = alloca %struct.bignum256, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 36, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.ecdsa_curve, ptr %18, i32 0, i32 0
  store ptr %19, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.ecdsa_curve, ptr %20, i32 0, i32 4
  %22 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %22, ptr %17, align 4, !tbaa !14
  %23 = load i32, ptr %17, align 4, !tbaa !14
  %24 = icmp sle i32 -3, %23
  br i1 %24, label %25, label %29

25:                                               ; preds = %3
  %26 = load i32, ptr %17, align 4, !tbaa !14
  %27 = icmp sle i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  br label %30

29:                                               ; preds = %25, %3
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 240, ptr noundef @__PRETTY_FUNCTION__.point_jacobian_add) #6
  unreachable

30:                                               ; preds = %28
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.jacobian_curve_point, ptr %31, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %32, i64 36, i1 false), !tbaa.struct !15
  %33 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_multiply(ptr noundef %12, ptr noundef %12, ptr noundef %33)
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.jacobian_curve_point, ptr %34, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %35, i64 36, i1 false), !tbaa.struct !15
  %36 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_multiply(ptr noundef %12, ptr noundef %13, ptr noundef %36)
  %37 = load i32, ptr %17, align 4, !tbaa !14
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %45

39:                                               ; preds = %30
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %12, i64 36, i1 false), !tbaa.struct !15
  %40 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_multiply(ptr noundef %14, ptr noundef %14, ptr noundef %40)
  %41 = load i32, ptr %17, align 4, !tbaa !14
  %42 = sub nsw i32 0, %41
  %43 = trunc i32 %42 to i8
  %44 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_mult_k(ptr noundef %14, i8 noundef zeroext %43, ptr noundef %44)
  br label %45

45:                                               ; preds = %39, %30
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.curve_point, ptr %46, i32 0, i32 0
  %48 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_multiply(ptr noundef %47, ptr noundef %12, ptr noundef %48)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %12, i64 36, i1 false), !tbaa.struct !15
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.jacobian_curve_point, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_subtractmod(ptr noundef %8, ptr noundef %50, ptr noundef %8, ptr noundef %51)
  %52 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_fast_mod(ptr noundef %8, ptr noundef %52)
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.jacobian_curve_point, ptr %53, i32 0, i32 0
  call void @bn_add(ptr noundef %12, ptr noundef %54)
  %55 = load ptr, ptr %16, align 8, !tbaa !5
  %56 = call i32 @bn_is_equal(ptr noundef %8, ptr noundef %55)
  store i32 %56, ptr %15, align 4, !tbaa !14
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.curve_point, ptr %57, i32 0, i32 1
  %59 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_multiply(ptr noundef %58, ptr noundef %13, ptr noundef %59)
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.jacobian_curve_point, ptr %60, i32 0, i32 1
  %62 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_subtractmod(ptr noundef %13, ptr noundef %61, ptr noundef %7, ptr noundef %62)
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.jacobian_curve_point, ptr %63, i32 0, i32 1
  call void @bn_add(ptr noundef %13, ptr noundef %64)
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.jacobian_curve_point, ptr %65, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %66, i64 36, i1 false), !tbaa.struct !15
  %67 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_multiply(ptr noundef %9, ptr noundef %9, ptr noundef %67)
  %68 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_mult_k(ptr noundef %9, i8 noundef zeroext 3, ptr noundef %68)
  %69 = load i32, ptr %17, align 4, !tbaa !14
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %73

71:                                               ; preds = %45
  %72 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_subtractmod(ptr noundef %9, ptr noundef %14, ptr noundef %9, ptr noundef %72)
  br label %73

73:                                               ; preds = %71, %45
  %74 = load i32, ptr %15, align 4, !tbaa !14
  call void @bn_cmov(ptr noundef %7, i32 noundef %74, ptr noundef %9, ptr noundef %7)
  %75 = load i32, ptr %15, align 4, !tbaa !14
  call void @bn_cmov(ptr noundef %8, i32 noundef %75, ptr noundef %13, ptr noundef %8)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %8, i64 36, i1 false), !tbaa.struct !15
  %76 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_multiply(ptr noundef %11, ptr noundef %11, ptr noundef %76)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %8, i64 36, i1 false), !tbaa.struct !15
  %77 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_multiply(ptr noundef %11, ptr noundef %10, ptr noundef %77)
  %78 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_multiply(ptr noundef %12, ptr noundef %11, ptr noundef %78)
  %79 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_multiply(ptr noundef %13, ptr noundef %10, ptr noundef %79)
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.jacobian_curve_point, ptr %80, i32 0, i32 2
  %82 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_multiply(ptr noundef %8, ptr noundef %81, ptr noundef %82)
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.jacobian_curve_point, ptr %83, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %84, ptr align 4 %7, i64 36, i1 false), !tbaa.struct !15
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.jacobian_curve_point, ptr %85, i32 0, i32 0
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.jacobian_curve_point, ptr %87, i32 0, i32 0
  %89 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_multiply(ptr noundef %86, ptr noundef %88, ptr noundef %89)
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.jacobian_curve_point, ptr %90, i32 0, i32 0
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.jacobian_curve_point, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_subtractmod(ptr noundef %91, ptr noundef %11, ptr noundef %93, ptr noundef %94)
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.jacobian_curve_point, ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_fast_mod(ptr noundef %96, ptr noundef %97)
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.jacobian_curve_point, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.jacobian_curve_point, ptr %100, i32 0, i32 1
  %102 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_subtractmod(ptr noundef %11, ptr noundef %99, ptr noundef %101, ptr noundef %102)
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.jacobian_curve_point, ptr %103, i32 0, i32 1
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.jacobian_curve_point, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.jacobian_curve_point, ptr %107, i32 0, i32 1
  %109 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_subtractmod(ptr noundef %104, ptr noundef %106, ptr noundef %108, ptr noundef %109)
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.jacobian_curve_point, ptr %110, i32 0, i32 1
  %112 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_multiply(ptr noundef %7, ptr noundef %111, ptr noundef %112)
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.jacobian_curve_point, ptr %113, i32 0, i32 1
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.jacobian_curve_point, ptr %115, i32 0, i32 1
  %117 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_subtractmod(ptr noundef %114, ptr noundef %10, ptr noundef %116, ptr noundef %117)
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.jacobian_curve_point, ptr %118, i32 0, i32 1
  %120 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_mult_half(ptr noundef %119, ptr noundef %120)
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.jacobian_curve_point, ptr %121, i32 0, i32 1
  %123 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bn_fast_mod(ptr noundef %122, ptr noundef %123)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %7) #5
  ret void
}

declare void @bn_add(ptr noundef, ptr noundef) #2

declare void @bn_cmov(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare void @bn_mult_half(ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !13, i64 180}
!10 = !{!"", !11, i64 0, !12, i64 36, !11, i64 108, !11, i64 144, !13, i64 180, !11, i64 184, !7, i64 220}
!11 = !{!"", !7, i64 0}
!12 = !{!"", !11, i64 0, !11, i64 36}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{i64 0, i64 36, !16}
!16 = !{!7, !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.bignum256 = type { [9 x i32] }

@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@__PRETTY_FUNCTION__.point_jacobian_add = external hidden unnamed_addr constant [90 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare void @bn_subtractmod(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @bn_multiply(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @bn_fast_mod(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare void @bn_mult_k(ptr noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #2

declare i32 @bn_is_equal(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @point_jacobian_add(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #4 {
  %4 = alloca %struct.bignum256, align 4
  %5 = alloca %struct.bignum256, align 4
  %6 = alloca %struct.bignum256, align 4
  %7 = alloca %struct.bignum256, align 4
  %8 = alloca %struct.bignum256, align 4
  %9 = alloca %struct.bignum256, align 4
  %10 = alloca %struct.bignum256, align 4
  %11 = alloca %struct.bignum256, align 4
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %11) #5
  %12 = getelementptr inbounds i8, ptr %2, i64 180
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = add i32 %13, 3
  %or.cond = icmp ult i32 %14, 4
  br i1 %or.cond, label %16, label %15

15:                                               ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 240, ptr noundef nonnull @__PRETTY_FUNCTION__.point_jacobian_add) #6
  unreachable

16:                                               ; preds = %3
  %17 = getelementptr inbounds i8, ptr %1, i64 72
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %9, ptr noundef nonnull align 4 dereferenceable(36) %17, i64 36, i1 false), !tbaa.struct !12
  call void @bn_multiply(ptr noundef nonnull %9, ptr noundef nonnull %9, ptr noundef nonnull %2) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %10, ptr noundef nonnull align 4 dereferenceable(36) %17, i64 36, i1 false), !tbaa.struct !12
  call void @bn_multiply(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %2) #5
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %21, label %18

18:                                               ; preds = %16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %11, ptr noundef nonnull align 4 dereferenceable(36) %9, i64 36, i1 false), !tbaa.struct !12
  call void @bn_multiply(ptr noundef nonnull %11, ptr noundef nonnull %11, ptr noundef nonnull %2) #5
  %19 = trunc i32 %13 to i8
  %20 = sub nsw i8 0, %19
  call void @bn_mult_k(ptr noundef nonnull %11, i8 noundef zeroext %20, ptr noundef nonnull %2) #5
  br label %21

21:                                               ; preds = %18, %16
  call void @bn_multiply(ptr noundef %0, ptr noundef nonnull %9, ptr noundef nonnull %2) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %5, ptr noundef nonnull align 4 dereferenceable(36) %9, i64 36, i1 false), !tbaa.struct !12
  call void @bn_subtractmod(ptr noundef nonnull %5, ptr noundef nonnull %1, ptr noundef nonnull %5, ptr noundef nonnull %2) #5
  call void @bn_fast_mod(ptr noundef nonnull %5, ptr noundef nonnull %2) #5
  call void @bn_add(ptr noundef nonnull %9, ptr noundef nonnull %1) #5
  %22 = call i32 @bn_is_equal(ptr noundef nonnull %5, ptr noundef nonnull %2) #5
  %23 = getelementptr inbounds i8, ptr %0, i64 36
  call void @bn_multiply(ptr noundef nonnull %23, ptr noundef nonnull %10, ptr noundef nonnull %2) #5
  %24 = getelementptr inbounds i8, ptr %1, i64 36
  call void @bn_subtractmod(ptr noundef nonnull %10, ptr noundef nonnull %24, ptr noundef nonnull %4, ptr noundef nonnull %2) #5
  call void @bn_add(ptr noundef nonnull %10, ptr noundef nonnull %24) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %6, ptr noundef nonnull align 4 dereferenceable(36) %1, i64 36, i1 false), !tbaa.struct !12
  call void @bn_multiply(ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %2) #5
  call void @bn_mult_k(ptr noundef nonnull %6, i8 noundef zeroext 3, ptr noundef nonnull %2) #5
  br i1 %.not, label %26, label %25

25:                                               ; preds = %21
  call void @bn_subtractmod(ptr noundef nonnull %6, ptr noundef nonnull %11, ptr noundef nonnull %6, ptr noundef nonnull %2) #5
  br label %26

26:                                               ; preds = %25, %21
  call void @bn_cmov(ptr noundef nonnull %4, i32 noundef %22, ptr noundef nonnull %6, ptr noundef nonnull %4) #5
  call void @bn_cmov(ptr noundef nonnull %5, i32 noundef %22, ptr noundef nonnull %10, ptr noundef nonnull %5) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %8, ptr noundef nonnull align 4 dereferenceable(36) %5, i64 36, i1 false), !tbaa.struct !12
  call void @bn_multiply(ptr noundef nonnull %8, ptr noundef nonnull %8, ptr noundef nonnull %2) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %7, ptr noundef nonnull align 4 dereferenceable(36) %5, i64 36, i1 false), !tbaa.struct !12
  call void @bn_multiply(ptr noundef nonnull %8, ptr noundef nonnull %7, ptr noundef nonnull %2) #5
  call void @bn_multiply(ptr noundef nonnull %9, ptr noundef nonnull %8, ptr noundef nonnull %2) #5
  call void @bn_multiply(ptr noundef nonnull %10, ptr noundef nonnull %7, ptr noundef nonnull %2) #5
  call void @bn_multiply(ptr noundef nonnull %5, ptr noundef nonnull %17, ptr noundef nonnull %2) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %1, ptr noundef nonnull align 4 dereferenceable(36) %4, i64 36, i1 false), !tbaa.struct !12
  call void @bn_multiply(ptr noundef nonnull %1, ptr noundef nonnull %1, ptr noundef nonnull %2) #5
  call void @bn_subtractmod(ptr noundef nonnull %1, ptr noundef nonnull %8, ptr noundef nonnull %1, ptr noundef nonnull %2) #5
  call void @bn_fast_mod(ptr noundef nonnull %1, ptr noundef nonnull %2) #5
  call void @bn_subtractmod(ptr noundef nonnull %8, ptr noundef nonnull %1, ptr noundef nonnull %24, ptr noundef nonnull %2) #5
  call void @bn_subtractmod(ptr noundef nonnull %24, ptr noundef nonnull %1, ptr noundef nonnull %24, ptr noundef nonnull %2) #5
  call void @bn_multiply(ptr noundef nonnull %4, ptr noundef nonnull %24, ptr noundef nonnull %2) #5
  call void @bn_subtractmod(ptr noundef nonnull %24, ptr noundef nonnull %7, ptr noundef nonnull %24, ptr noundef nonnull %2) #5
  call void @bn_mult_half(ptr noundef nonnull %24, ptr noundef nonnull %2) #5
  call void @bn_fast_mod(ptr noundef nonnull %24, ptr noundef nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %4) #5
  ret void
}

declare void @bn_add(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @bn_cmov(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @bn_mult_half(ptr noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !11, i64 180}
!6 = !{!"", !7, i64 0, !10, i64 36, !7, i64 108, !7, i64 144, !11, i64 180, !7, i64 184, !8, i64 220}
!7 = !{!"", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !7, i64 0, !7, i64 36}
!11 = !{!"int", !8, i64 0}
!12 = !{i64 0, i64 36, !13}
!13 = !{!8, !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass