; LLVM IR from bitcoin-core/secp256k1 :: examples (ellswift)

; 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"

@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [92 x i8], align 1
@secp256k1_ellswift_xdh_hash_function_bip324 = external constant ptr, align 8
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca [32 x i8], align 16
  %4 = alloca [32 x i8], align 16
  %5 = alloca [32 x i8], align 16
  %6 = alloca [32 x i8], align 16
  %7 = alloca [32 x i8], align 16
  %8 = alloca [64 x i8], align 16
  %9 = alloca [64 x i8], align 16
  %10 = alloca [32 x i8], align 16
  %11 = alloca [32 x i8], align 16
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %14 = call ptr @secp256k1_context_create(i32 noundef 1)
  store ptr %14, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 0
  %16 = call i32 @fill_random(ptr noundef %15, i64 noundef 32)
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %20, label %18

18:                                               ; preds = %0
  %19 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %13, align 4
  br label %128

20:                                               ; preds = %0
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 0
  %23 = call i32 @secp256k1_context_randomize(ptr noundef %21, ptr noundef %22)
  store i32 %23, ptr %12, align 4, !tbaa !9
  %24 = load i32, ptr %12, align 4, !tbaa !9
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %20
  br label %28

27:                                               ; preds = %20
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 48, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

28:                                               ; preds = %26
  %29 = getelementptr inbounds [32 x i8], ptr %6, i64 0, i64 0
  %30 = call i32 @fill_random(ptr noundef %29, i64 noundef 32)
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %36

32:                                               ; preds = %28
  %33 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %34 = call i32 @fill_random(ptr noundef %33, i64 noundef 32)
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %38, label %36

36:                                               ; preds = %32, %28
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %13, align 4
  br label %128

38:                                               ; preds = %32
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds [32 x i8], ptr %6, i64 0, i64 0
  %41 = call i32 @secp256k1_ec_seckey_verify(ptr noundef %39, ptr noundef %40)
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %48

43:                                               ; preds = %38
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %46 = call i32 @secp256k1_ec_seckey_verify(ptr noundef %44, ptr noundef %45)
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %50, label %48

48:                                               ; preds = %43, %38
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %13, align 4
  br label %128

50:                                               ; preds = %43
  %51 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %52 = call i32 @fill_random(ptr noundef %51, i64 noundef 32)
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %58

54:                                               ; preds = %50
  %55 = getelementptr inbounds [32 x i8], ptr %5, i64 0, i64 0
  %56 = call i32 @fill_random(ptr noundef %55, i64 noundef 32)
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %60, label %58

58:                                               ; preds = %54, %50
  %59 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %13, align 4
  br label %128

60:                                               ; preds = %54
  %61 = load ptr, ptr %2, align 8, !tbaa !5
  %62 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  %63 = getelementptr inbounds [32 x i8], ptr %6, i64 0, i64 0
  %64 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %65 = call i32 @secp256k1_ellswift_create(ptr noundef %61, ptr noundef %62, ptr noundef %63, ptr noundef %64)
  store i32 %65, ptr %12, align 4, !tbaa !9
  %66 = load i32, ptr %12, align 4, !tbaa !9
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %69

68:                                               ; preds = %60
  br label %70

69:                                               ; preds = %60
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 71, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

70:                                               ; preds = %68
  %71 = load ptr, ptr %2, align 8, !tbaa !5
  %72 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %73 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %74 = getelementptr inbounds [32 x i8], ptr %5, i64 0, i64 0
  %75 = call i32 @secp256k1_ellswift_create(ptr noundef %71, ptr noundef %72, ptr noundef %73, ptr noundef %74)
  store i32 %75, ptr %12, align 4, !tbaa !9
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %79

78:                                               ; preds = %70
  br label %80

79:                                               ; preds = %70
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 73, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

80:                                               ; preds = %78
  %81 = load ptr, ptr %2, align 8, !tbaa !5
  %82 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %83 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  %84 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %85 = getelementptr inbounds [32 x i8], ptr %6, i64 0, i64 0
  %86 = load ptr, ptr @secp256k1_ellswift_xdh_hash_function_bip324, align 8, !tbaa !5
  %87 = call i32 @secp256k1_ellswift_xdh(ptr noundef %81, ptr noundef %82, ptr noundef %83, ptr noundef %84, ptr noundef %85, i32 noundef 0, ptr noundef %86, ptr noundef null)
  store i32 %87, ptr %12, align 4, !tbaa !9
  %88 = load i32, ptr %12, align 4, !tbaa !9
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %91

90:                                               ; preds = %80
  br label %92

91:                                               ; preds = %80
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 83, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

92:                                               ; preds = %90
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  %94 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 0
  %95 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  %96 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %97 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %98 = load ptr, ptr @secp256k1_ellswift_xdh_hash_function_bip324, align 8, !tbaa !5
  %99 = call i32 @secp256k1_ellswift_xdh(ptr noundef %93, ptr noundef %94, ptr noundef %95, ptr noundef %96, ptr noundef %97, i32 noundef 1, ptr noundef %98, ptr noundef null)
  store i32 %99, ptr %12, align 4, !tbaa !9
  %100 = load i32, ptr %12, align 4, !tbaa !9
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %103

102:                                              ; preds = %92
  br label %104

103:                                              ; preds = %92
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 89, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

104:                                              ; preds = %102
  %105 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %106 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 0
  %107 = call i32 @memcmp(ptr noundef %105, ptr noundef %106, i64 noundef 32) #7
  store i32 %107, ptr %12, align 4, !tbaa !9
  %108 = load i32, ptr %12, align 4, !tbaa !9
  %109 = icmp eq i32 %108, 0
  br i1 %109, label %110, label %111

110:                                              ; preds = %104
  br label %112

111:                                              ; preds = %104
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.2, i32 noundef 93, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

112:                                              ; preds = %110
  %113 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %114 = getelementptr inbounds [32 x i8], ptr %6, i64 0, i64 0
  call void @print_hex(ptr noundef %114, i64 noundef 32)
  %115 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %116 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  call void @print_hex(ptr noundef %116, i64 noundef 64)
  %117 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %118 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @print_hex(ptr noundef %118, i64 noundef 32)
  %119 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %120 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  call void @print_hex(ptr noundef %120, i64 noundef 64)
  %121 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  %122 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  call void @print_hex(ptr noundef %122, i64 noundef 32)
  %123 = load ptr, ptr %2, align 8, !tbaa !5
  call void @secp256k1_context_destroy(ptr noundef %123)
  %124 = getelementptr inbounds [32 x i8], ptr %6, i64 0, i64 0
  call void @secure_erase(ptr noundef %124, i64 noundef 32)
  %125 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @secure_erase(ptr noundef %125, i64 noundef 32)
  %126 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  call void @secure_erase(ptr noundef %126, i64 noundef 32)
  %127 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 0
  call void @secure_erase(ptr noundef %127, i64 noundef 32)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %13, align 4
  br label %128

128:                                              ; preds = %112, %58, %48, %36, %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %129 = load i32, ptr %1, align 4
  ret i32 %129
}

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

declare ptr @secp256k1_context_create(i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @fill_random(ptr noundef, i64 noundef) #0

declare i32 @printf(ptr noundef, ...) #2

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

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

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

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #4

; Function Attrs: nounwind uwtable
declare hidden void @print_hex(ptr noundef, i64 noundef) #0

declare void @secp256k1_context_destroy(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @secure_erase(ptr noundef, i64 noundef) #0

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

attributes #0 = { 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 #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 willreturn memory(read) "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 }
attributes #7 = { nounwind willreturn memory(read) }

!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, !10, i64 0}
!10 = !{!"int", !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"

@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [92 x i8], align 1
@secp256k1_ellswift_xdh_hash_function_bip324 = external local_unnamed_addr constant ptr, align 8
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main() local_unnamed_addr #0 {
  %1 = alloca [32 x i8], align 16
  %2 = alloca [32 x i8], align 16
  %3 = alloca [32 x i8], align 16
  %4 = alloca [32 x i8], align 16
  %5 = alloca [32 x i8], align 16
  %6 = alloca [64 x i8], align 16
  %7 = alloca [64 x i8], align 16
  %8 = alloca [32 x i8], align 16
  %9 = alloca [32 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #6
  %10 = tail call ptr @secp256k1_context_create(i32 noundef 1) #6
  %11 = call i32 @fill_random(ptr noundef nonnull %1, i64 noundef 32)
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %12, label %14

12:                                               ; preds = %0
  %13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %57

14:                                               ; preds = %0
  %15 = call i32 @secp256k1_context_randomize(ptr noundef %10, ptr noundef nonnull %1) #6
  %.not14 = icmp eq i32 %15, 0
  br i1 %.not14, label %16, label %17

16:                                               ; preds = %14
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 48, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

17:                                               ; preds = %14
  %18 = call i32 @fill_random(ptr noundef nonnull %4, i64 noundef 32)
  %.not15 = icmp eq i32 %18, 0
  br i1 %.not15, label %21, label %19

19:                                               ; preds = %17
  %20 = call i32 @fill_random(ptr noundef nonnull %5, i64 noundef 32)
  %.not16 = icmp eq i32 %20, 0
  br i1 %.not16, label %21, label %23

21:                                               ; preds = %19, %17
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %57

23:                                               ; preds = %19
  %24 = call i32 @secp256k1_ec_seckey_verify(ptr noundef %10, ptr noundef nonnull %4) #6
  %.not17 = icmp eq i32 %24, 0
  br i1 %.not17, label %27, label %25

25:                                               ; preds = %23
  %26 = call i32 @secp256k1_ec_seckey_verify(ptr noundef %10, ptr noundef nonnull %5) #6
  %.not18 = icmp eq i32 %26, 0
  br i1 %.not18, label %27, label %29

27:                                               ; preds = %25, %23
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %57

29:                                               ; preds = %25
  %30 = call i32 @fill_random(ptr noundef nonnull %2, i64 noundef 32)
  %.not19 = icmp eq i32 %30, 0
  br i1 %.not19, label %33, label %31

31:                                               ; preds = %29
  %32 = call i32 @fill_random(ptr noundef nonnull %3, i64 noundef 32)
  %.not20 = icmp eq i32 %32, 0
  br i1 %.not20, label %33, label %35

33:                                               ; preds = %31, %29
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %57

35:                                               ; preds = %31
  %36 = call i32 @secp256k1_ellswift_create(ptr noundef %10, ptr noundef nonnull %6, ptr noundef nonnull %4, ptr noundef nonnull %2) #6
  %.not21 = icmp eq i32 %36, 0
  br i1 %.not21, label %37, label %38

37:                                               ; preds = %35
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 71, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

38:                                               ; preds = %35
  %39 = call i32 @secp256k1_ellswift_create(ptr noundef %10, ptr noundef nonnull %7, ptr noundef nonnull %5, ptr noundef nonnull %3) #6
  %.not22 = icmp eq i32 %39, 0
  br i1 %.not22, label %40, label %41

40:                                               ; preds = %38
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 73, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

41:                                               ; preds = %38
  %42 = load ptr, ptr @secp256k1_ellswift_xdh_hash_function_bip324, align 8, !tbaa !5
  %43 = call i32 @secp256k1_ellswift_xdh(ptr noundef %10, ptr noundef nonnull %8, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %4, i32 noundef 0, ptr noundef %42, ptr noundef null) #6
  %.not23 = icmp eq i32 %43, 0
  br i1 %.not23, label %44, label %45

44:                                               ; preds = %41
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 83, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

45:                                               ; preds = %41
  %46 = call i32 @secp256k1_ellswift_xdh(ptr noundef %10, ptr noundef nonnull %9, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %5, i32 noundef 1, ptr noundef %42, ptr noundef null) #6
  %.not24 = icmp eq i32 %46, 0
  br i1 %.not24, label %47, label %48

47:                                               ; preds = %45
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 89, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

48:                                               ; preds = %45
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(32) %8, ptr noundef nonnull dereferenceable(32) %9, i64 32)
  %49 = icmp eq i32 %bcmp, 0
  br i1 %49, label %51, label %50

50:                                               ; preds = %48
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.2, i32 noundef 93, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

51:                                               ; preds = %48
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  call void @print_hex(ptr noundef nonnull %4, i64 noundef 32)
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  call void @print_hex(ptr noundef nonnull %6, i64 noundef 64)
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  call void @print_hex(ptr noundef nonnull %5, i64 noundef 32)
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  call void @print_hex(ptr noundef nonnull %7, i64 noundef 64)
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  call void @print_hex(ptr noundef nonnull %8, i64 noundef 32)
  call void @secp256k1_context_destroy(ptr noundef %10) #6
  call void @secure_erase(ptr noundef nonnull %4, i64 noundef 32)
  call void @secure_erase(ptr noundef nonnull %5, i64 noundef 32)
  call void @secure_erase(ptr noundef nonnull %8, i64 noundef 32)
  call void @secure_erase(ptr noundef nonnull %9, i64 noundef 32)
  br label %57

57:                                               ; preds = %51, %33, %27, %21, %12
  %.0 = phi i32 [ 0, %51 ], [ 1, %33 ], [ 1, %27 ], [ 1, %21 ], [ 1, %12 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #6
  ret i32 %.0
}

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

declare ptr @secp256k1_context_create(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @fill_random(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

declare i32 @secp256k1_context_randomize(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 #4

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @print_hex(ptr noundef, i64 noundef) local_unnamed_addr #0

declare void @secp256k1_context_destroy(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @secure_erase(ptr noundef, i64 noundef) local_unnamed_addr #0

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

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #5

attributes #0 = { 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 #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 = { nofree 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 = { 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 #5 = { nofree nounwind willreturn memory(argmem: read) }
attributes #6 = { nounwind }
attributes #7 = { 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"}


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