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

; 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.secp256k1_pubkey = type { [64 x i8] }

@.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 [72 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
@.str.4 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [17 x i8], align 1

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

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

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

27:                                               ; preds = %21
  br label %29

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

29:                                               ; preds = %27
  %30 = getelementptr inbounds [32 x i8], ptr %2, i64 0, i64 0
  %31 = call i32 @fill_random(ptr noundef %30, i64 noundef 32)
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %37

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

37:                                               ; preds = %33, %29
  %38 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %14, align 4
  br label %135

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

44:                                               ; preds = %39
  %45 = load ptr, ptr %13, align 8, !tbaa !5
  %46 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 0
  %47 = call i32 @secp256k1_ec_seckey_verify(ptr noundef %45, ptr noundef %46)
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %51, label %49

49:                                               ; preds = %44, %39
  %50 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %14, align 4
  br label %135

51:                                               ; preds = %44
  %52 = load ptr, ptr %13, align 8, !tbaa !5
  %53 = getelementptr inbounds [32 x i8], ptr %2, i64 0, i64 0
  %54 = call i32 @secp256k1_ec_pubkey_create(ptr noundef %52, ptr noundef %11, ptr noundef %53)
  store i32 %54, ptr %9, align 4, !tbaa !9
  %55 = load i32, ptr %9, align 4, !tbaa !9
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %51
  br label %59

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

59:                                               ; preds = %57
  %60 = load ptr, ptr %13, align 8, !tbaa !5
  %61 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 0
  %62 = call i32 @secp256k1_ec_pubkey_create(ptr noundef %60, ptr noundef %12, ptr noundef %61)
  store i32 %62, ptr %9, align 4, !tbaa !9
  %63 = load i32, ptr %9, align 4, !tbaa !9
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %66

65:                                               ; preds = %59
  br label %67

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

67:                                               ; preds = %65
  store i64 33, ptr %10, align 8, !tbaa !11
  %68 = load ptr, ptr %13, align 8, !tbaa !5
  %69 = getelementptr inbounds [33 x i8], ptr %4, i64 0, i64 0
  %70 = call i32 @secp256k1_ec_pubkey_serialize(ptr noundef %68, ptr noundef %69, ptr noundef %10, ptr noundef %11, i32 noundef 258)
  store i32 %70, ptr %9, align 4, !tbaa !9
  %71 = load i32, ptr %9, align 4, !tbaa !9
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %74

73:                                               ; preds = %67
  br label %75

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

75:                                               ; preds = %73
  %76 = load i64, ptr %10, align 8, !tbaa !11
  %77 = icmp eq i64 %76, 33
  br i1 %77, label %78, label %79

78:                                               ; preds = %75
  br label %80

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

80:                                               ; preds = %78
  store i64 33, ptr %10, align 8, !tbaa !11
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = getelementptr inbounds [33 x i8], ptr %5, i64 0, i64 0
  %83 = call i32 @secp256k1_ec_pubkey_serialize(ptr noundef %81, ptr noundef %82, ptr noundef %10, ptr noundef %12, i32 noundef 258)
  store i32 %83, ptr %9, align 4, !tbaa !9
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %87

86:                                               ; preds = %80
  br label %88

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

88:                                               ; preds = %86
  %89 = load i64, ptr %10, align 8, !tbaa !11
  %90 = icmp eq i64 %89, 33
  br i1 %90, label %91, label %92

91:                                               ; preds = %88
  br label %93

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

93:                                               ; preds = %91
  %94 = load ptr, ptr %13, align 8, !tbaa !5
  %95 = getelementptr inbounds [32 x i8], ptr %6, i64 0, i64 0
  %96 = getelementptr inbounds [32 x i8], ptr %2, i64 0, i64 0
  %97 = call i32 @secp256k1_ecdh(ptr noundef %94, ptr noundef %95, ptr noundef %12, ptr noundef %96, ptr noundef null, ptr noundef null)
  store i32 %97, ptr %9, align 4, !tbaa !9
  %98 = load i32, ptr %9, align 4, !tbaa !9
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %101

100:                                              ; preds = %93
  br label %102

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

102:                                              ; preds = %100
  %103 = load ptr, ptr %13, align 8, !tbaa !5
  %104 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %105 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 0
  %106 = call i32 @secp256k1_ecdh(ptr noundef %103, ptr noundef %104, ptr noundef %11, ptr noundef %105, ptr noundef null, ptr noundef null)
  store i32 %106, ptr %9, align 4, !tbaa !9
  %107 = load i32, ptr %9, align 4, !tbaa !9
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %110

109:                                              ; preds = %102
  br label %111

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

111:                                              ; preds = %109
  %112 = getelementptr inbounds [32 x i8], ptr %6, i64 0, i64 0
  %113 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %114 = call i32 @memcmp(ptr noundef %112, ptr noundef %113, i64 noundef 32) #7
  store i32 %114, ptr %9, align 4, !tbaa !9
  %115 = load i32, ptr %9, align 4, !tbaa !9
  %116 = icmp eq i32 %115, 0
  br i1 %116, label %117, label %118

117:                                              ; preds = %111
  br label %119

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

119:                                              ; preds = %117
  %120 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %121 = getelementptr inbounds [32 x i8], ptr %2, i64 0, i64 0
  call void @print_hex(ptr noundef %121, i64 noundef 32)
  %122 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %123 = getelementptr inbounds [33 x i8], ptr %4, i64 0, i64 0
  call void @print_hex(ptr noundef %123, i64 noundef 33)
  %124 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  %125 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 0
  call void @print_hex(ptr noundef %125, i64 noundef 32)
  %126 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %127 = getelementptr inbounds [33 x i8], ptr %5, i64 0, i64 0
  call void @print_hex(ptr noundef %127, i64 noundef 33)
  %128 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  %129 = getelementptr inbounds [32 x i8], ptr %6, i64 0, i64 0
  call void @print_hex(ptr noundef %129, i64 noundef 32)
  %130 = load ptr, ptr %13, align 8, !tbaa !5
  call void @secp256k1_context_destroy(ptr noundef %130)
  %131 = getelementptr inbounds [32 x i8], ptr %2, i64 0, i64 0
  call void @secure_erase(ptr noundef %131, i64 noundef 32)
  %132 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 0
  call void @secure_erase(ptr noundef %132, i64 noundef 32)
  %133 = getelementptr inbounds [32 x i8], ptr %6, i64 0, i64 0
  call void @secure_erase(ptr noundef %133, i64 noundef 32)
  %134 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @secure_erase(ptr noundef %134, i64 noundef 32)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %14, align 4
  br label %135

135:                                              ; preds = %119, %49, %37, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 32, 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 33, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 33, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #5
  %136 = load i32, ptr %1, align 4
  ret i32 %136
}

; 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_ec_pubkey_create(ptr noundef, ptr noundef, ptr noundef) #2

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

declare i32 @secp256k1_ecdh(ptr noundef, ptr noundef, ptr noundef, ptr 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}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !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.secp256k1_pubkey = type { [64 x i8] }

@.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 [72 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
@.str.4 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [17 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 [33 x i8], align 16
  %4 = alloca [33 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 i64, align 8
  %9 = alloca %struct.secp256k1_pubkey, align 1
  %10 = alloca %struct.secp256k1_pubkey, align 1
  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 33, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 33, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %10) #6
  %11 = tail call ptr @secp256k1_context_create(i32 noundef 1) #6
  %12 = call i32 @fill_random(ptr noundef nonnull %7, i64 noundef 32)
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %13, label %15

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

15:                                               ; preds = %0
  %16 = call i32 @secp256k1_context_randomize(ptr noundef %11, ptr noundef nonnull %7) #6
  %.not18 = icmp eq i32 %16, 0
  br i1 %.not18, label %17, label %18

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

18:                                               ; preds = %15
  %19 = call i32 @fill_random(ptr noundef nonnull %1, i64 noundef 32)
  %.not19 = icmp eq i32 %19, 0
  br i1 %.not19, label %22, label %20

20:                                               ; preds = %18
  %21 = call i32 @fill_random(ptr noundef nonnull %2, i64 noundef 32)
  %.not20 = icmp eq i32 %21, 0
  br i1 %.not20, label %22, label %24

22:                                               ; preds = %20, %18
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %65

24:                                               ; preds = %20
  %25 = call i32 @secp256k1_ec_seckey_verify(ptr noundef %11, ptr noundef nonnull %1) #6
  %.not21 = icmp eq i32 %25, 0
  br i1 %.not21, label %28, label %26

26:                                               ; preds = %24
  %27 = call i32 @secp256k1_ec_seckey_verify(ptr noundef %11, ptr noundef nonnull %2) #6
  %.not22 = icmp eq i32 %27, 0
  br i1 %.not22, label %28, label %30

28:                                               ; preds = %26, %24
  %29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %65

30:                                               ; preds = %26
  %31 = call i32 @secp256k1_ec_pubkey_create(ptr noundef %11, ptr noundef nonnull %9, ptr noundef nonnull %1) #6
  %.not23 = icmp eq i32 %31, 0
  br i1 %.not23, label %32, label %33

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

33:                                               ; preds = %30
  %34 = call i32 @secp256k1_ec_pubkey_create(ptr noundef %11, ptr noundef nonnull %10, ptr noundef nonnull %2) #6
  %.not24 = icmp eq i32 %34, 0
  br i1 %.not24, label %35, label %36

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

36:                                               ; preds = %33
  store i64 33, ptr %8, align 8, !tbaa !5
  %37 = call i32 @secp256k1_ec_pubkey_serialize(ptr noundef %11, ptr noundef nonnull %3, ptr noundef nonnull %8, ptr noundef nonnull %9, i32 noundef 258) #6
  %.not25 = icmp eq i32 %37, 0
  br i1 %.not25, label %38, label %39

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

39:                                               ; preds = %36
  %40 = load i64, ptr %8, align 8, !tbaa !5
  %41 = icmp eq i64 %40, 33
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %39
  %44 = call i32 @secp256k1_ec_pubkey_serialize(ptr noundef %11, ptr noundef nonnull %4, ptr noundef nonnull %8, ptr noundef nonnull %10, i32 noundef 258) #6
  %.not26 = icmp eq i32 %44, 0
  br i1 %.not26, label %45, label %46

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

46:                                               ; preds = %43
  %47 = load i64, ptr %8, align 8, !tbaa !5
  %48 = icmp eq i64 %47, 33
  br i1 %48, label %50, label %49

49:                                               ; preds = %46
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.2, i32 noundef 76, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

50:                                               ; preds = %46
  %51 = call i32 @secp256k1_ecdh(ptr noundef %11, ptr noundef nonnull %5, ptr noundef nonnull %10, ptr noundef nonnull %1, ptr noundef null, ptr noundef null) #6
  %.not27 = icmp eq i32 %51, 0
  br i1 %.not27, label %52, label %53

52:                                               ; preds = %50
  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

53:                                               ; preds = %50
  %54 = call i32 @secp256k1_ecdh(ptr noundef %11, ptr noundef nonnull %6, ptr noundef nonnull %9, ptr noundef nonnull %2, ptr noundef null, ptr noundef null) #6
  %.not28 = icmp eq i32 %54, 0
  br i1 %.not28, label %55, label %56

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

56:                                               ; preds = %53
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(32) %5, ptr noundef nonnull dereferenceable(32) %6, i64 32)
  %57 = icmp eq i32 %bcmp, 0
  br i1 %57, label %59, label %58

58:                                               ; preds = %56
  call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.2, i32 noundef 92, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

59:                                               ; preds = %56
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  call void @print_hex(ptr noundef nonnull %1, i64 noundef 32)
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  call void @print_hex(ptr noundef nonnull %3, i64 noundef 33)
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  call void @print_hex(ptr noundef nonnull %2, i64 noundef 32)
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  call void @print_hex(ptr noundef nonnull %4, i64 noundef 33)
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  call void @print_hex(ptr noundef nonnull %5, i64 noundef 32)
  call void @secp256k1_context_destroy(ptr noundef %11) #6
  call void @secure_erase(ptr noundef nonnull %1, i64 noundef 32)
  call void @secure_erase(ptr noundef nonnull %2, i64 noundef 32)
  call void @secure_erase(ptr noundef nonnull %5, i64 noundef 32)
  call void @secure_erase(ptr noundef nonnull %6, i64 noundef 32)
  br label %65

65:                                               ; preds = %59, %28, %22, %13
  %.0 = phi i32 [ 0, %59 ], [ 1, %28 ], [ 1, %22 ], [ 1, %13 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 33, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 33, 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_ec_pubkey_create(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare i32 @secp256k1_ecdh(ptr noundef, ptr noundef, ptr noundef, ptr 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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