; LLVM IR from vergecurrency/verge :: src/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 [83 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.10 = 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) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 33, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 33, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %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 %137

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 42, ptr noundef @__PRETTY_FUNCTION__.main) #7
  unreachable

29:                                               ; preds = %27
  br label %30

30:                                               ; preds = %52, %29
  br label %31

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

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

39:                                               ; preds = %35, %31
  %40 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %14, align 4
  br label %137

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

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

51:                                               ; preds = %46
  br label %53

52:                                               ; preds = %46, %41
  br label %30

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

59:                                               ; preds = %53
  br label %61

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

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

67:                                               ; preds = %61
  br label %69

68:                                               ; preds = %61
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 63, ptr noundef @__PRETTY_FUNCTION__.main) #7
  unreachable

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

75:                                               ; preds = %69
  br label %77

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

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

80:                                               ; preds = %77
  br label %82

81:                                               ; preds = %77
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.2, i32 noundef 70, ptr noundef @__PRETTY_FUNCTION__.main) #7
  unreachable

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

88:                                               ; preds = %82
  br label %90

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

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

93:                                               ; preds = %90
  br label %95

94:                                               ; preds = %90
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.2, i32 noundef 77, ptr noundef @__PRETTY_FUNCTION__.main) #7
  unreachable

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

102:                                              ; preds = %95
  br label %104

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

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

111:                                              ; preds = %104
  br label %113

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

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

119:                                              ; preds = %113
  br label %121

120:                                              ; preds = %113
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.2, i32 noundef 93, ptr noundef @__PRETTY_FUNCTION__.main) #7
  unreachable

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

137:                                              ; preds = %121, %39, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 33, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 33, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #6
  %138 = load i32, ptr %1, align 4
  ret i32 %138
}

; 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: inlinehint nounwind uwtable
declare hidden void @secure_erase(ptr noundef, i64 noundef) #5

; 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 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { noreturn nounwind }
attributes #8 = { 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 [83 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.10 = 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) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 33, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 33, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %10) #7
  %11 = tail call ptr @secp256k1_context_create(i32 noundef 1) #7
  %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 %62

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

.preheader:                                       ; preds = %15
  %17 = call i32 @fill_random(ptr noundef nonnull %1, i64 noundef 32)
  %.not1929 = icmp eq i32 %17, 0
  br i1 %.not1929, label %._crit_edge, label %.lr.ph

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

.lr.ph:                                           ; preds = %.preheader, %25
  %19 = call i32 @fill_random(ptr noundef nonnull %2, i64 noundef 32)
  %.not20 = icmp eq i32 %19, 0
  br i1 %.not20, label %._crit_edge, label %21

._crit_edge:                                      ; preds = %25, %.lr.ph, %.preheader
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %62

21:                                               ; preds = %.lr.ph
  %22 = call i32 @secp256k1_ec_seckey_verify(ptr noundef %11, ptr noundef nonnull %1) #7
  %.not21 = icmp eq i32 %22, 0
  br i1 %.not21, label %25, label %23

23:                                               ; preds = %21
  %24 = call i32 @secp256k1_ec_seckey_verify(ptr noundef %11, ptr noundef nonnull %2) #7
  %.not22 = icmp eq i32 %24, 0
  br i1 %.not22, label %25, label %27

25:                                               ; preds = %23, %21
  %26 = call i32 @fill_random(ptr noundef nonnull %1, i64 noundef 32)
  %.not19 = icmp eq i32 %26, 0
  br i1 %.not19, label %._crit_edge, label %.lr.ph

27:                                               ; preds = %23
  %28 = call i32 @secp256k1_ec_pubkey_create(ptr noundef %11, ptr noundef nonnull %9, ptr noundef nonnull %1) #7
  %.not23 = icmp eq i32 %28, 0
  br i1 %.not23, label %29, label %30

29:                                               ; preds = %27
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 61, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

30:                                               ; preds = %27
  %31 = call i32 @secp256k1_ec_pubkey_create(ptr noundef %11, ptr noundef nonnull %10, ptr noundef nonnull %2) #7
  %.not24 = icmp eq i32 %31, 0
  br i1 %.not24, label %32, label %33

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

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

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

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

39:                                               ; preds = %36
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.2, i32 noundef 70, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

40:                                               ; preds = %36
  %41 = call i32 @secp256k1_ec_pubkey_serialize(ptr noundef %11, ptr noundef nonnull %4, ptr noundef nonnull %8, ptr noundef nonnull %10, i32 noundef 258) #7
  %.not26 = icmp eq i32 %41, 0
  br i1 %.not26, label %42, label %43

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

43:                                               ; preds = %40
  %44 = load i64, ptr %8, align 8, !tbaa !5
  %45 = icmp eq i64 %44, 33
  br i1 %45, label %47, label %46

46:                                               ; preds = %43
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.2, i32 noundef 77, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

47:                                               ; preds = %43
  %48 = 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) #7
  %.not27 = icmp eq i32 %48, 0
  br i1 %.not27, label %49, label %50

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

50:                                               ; preds = %47
  %51 = 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) #7
  %.not28 = icmp eq i32 %51, 0
  br i1 %.not28, label %52, label %53

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

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

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

56:                                               ; preds = %53
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  call void @print_hex(ptr noundef nonnull %1, i64 noundef 32)
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  call void @print_hex(ptr noundef nonnull %3, i64 noundef 33)
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  call void @print_hex(ptr noundef nonnull %2, i64 noundef 32)
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  call void @print_hex(ptr noundef nonnull %4, i64 noundef 33)
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  call void @print_hex(ptr noundef nonnull %5, i64 noundef 32)
  call void @secp256k1_context_destroy(ptr noundef %11) #7
  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 %62

62:                                               ; preds = %56, %._crit_edge, %13
  %.0 = phi i32 [ 0, %56 ], [ 1, %._crit_edge ], [ 1, %13 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 33, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 33, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  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: inlinehint nounwind uwtable
declare hidden void @secure_erase(ptr noundef, i64 noundef) local_unnamed_addr #5

; 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 #6

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 = { inlinehint 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 #6 = { nofree nounwind willreturn memory(argmem: read) }
attributes #7 = { nounwind }
attributes #8 = { 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,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass