; LLVM IR from vergecurrency/verge :: src/secp256k1/examples (schnorr)

; 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_xonly_pubkey = type { [64 x i8] }
%struct.secp256k1_keypair = type { [96 x i8] }

@__const.main.msg = external hidden unnamed_addr constant [12 x i8], align 1
@__const.main.tag = external hidden unnamed_addr constant [17 x i8], align 16
@.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 [86 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [12 x i8], align 1
@secp256k1_context_static = external global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [42 x i8], align 1

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

21:                                               ; preds = %0
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %132

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

29:                                               ; preds = %23
  br label %31

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

31:                                               ; preds = %29
  br label %32

32:                                               ; preds = %45, %31
  br label %33

33:                                               ; preds = %32
  %34 = getelementptr inbounds [32 x i8], ptr %5, 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
  %38 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %132

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

44:                                               ; preds = %39
  br label %46

45:                                               ; preds = %39
  br label %32

46:                                               ; preds = %44
  %47 = load ptr, ptr %15, align 8, !tbaa !5
  %48 = call i32 @secp256k1_keypair_xonly_pub(ptr noundef %47, ptr noundef %13, ptr noundef null, ptr noundef %14)
  store i32 %48, ptr %12, align 4, !tbaa !9
  %49 = load i32, ptr %12, align 4, !tbaa !9
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %52

51:                                               ; preds = %46
  br label %53

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

53:                                               ; preds = %51
  %54 = load ptr, ptr %15, align 8, !tbaa !5
  %55 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  %56 = call i32 @secp256k1_xonly_pubkey_serialize(ptr noundef %54, ptr noundef %55, ptr noundef %13)
  store i32 %56, ptr %12, align 4, !tbaa !9
  %57 = load i32, ptr %12, 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 72, ptr noundef @__PRETTY_FUNCTION__.main) #7
  unreachable

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

69:                                               ; preds = %61
  br label %71

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

71:                                               ; preds = %69
  %72 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %73 = call i32 @fill_random(ptr noundef %72, i64 noundef 32)
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %77, label %75

75:                                               ; preds = %71
  %76 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %132

77:                                               ; preds = %71
  %78 = load ptr, ptr %15, align 8, !tbaa !5
  %79 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %80 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 0
  %81 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %82 = call i32 @secp256k1_schnorrsig_sign32(ptr noundef %78, ptr noundef %79, ptr noundef %80, ptr noundef %14, ptr noundef %81)
  store i32 %82, ptr %12, align 4, !tbaa !9
  %83 = load i32, ptr %12, align 4, !tbaa !9
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %77
  br label %87

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

87:                                               ; preds = %85
  %88 = load ptr, ptr %15, align 8, !tbaa !5
  %89 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  %90 = call i32 @secp256k1_xonly_pubkey_parse(ptr noundef %88, ptr noundef %13, ptr noundef %89)
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %94, label %92

92:                                               ; preds = %87
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %132

94:                                               ; preds = %87
  %95 = load ptr, ptr %15, align 8, !tbaa !5
  %96 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 0
  %97 = getelementptr inbounds [17 x i8], ptr %4, i64 0, i64 0
  %98 = getelementptr inbounds [12 x i8], ptr %2, i64 0, i64 0
  %99 = call i32 @secp256k1_tagged_sha256(ptr noundef %95, ptr noundef %96, ptr noundef %97, i64 noundef 17, ptr noundef %98, i64 noundef 12)
  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 = %94
  br label %104

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

104:                                              ; preds = %102
  %105 = load ptr, ptr %15, align 8, !tbaa !5
  %106 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %107 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 0
  %108 = call i32 @secp256k1_schnorrsig_verify(ptr noundef %105, ptr noundef %106, ptr noundef %107, i64 noundef 32, ptr noundef %13)
  store i32 %108, ptr %10, align 4, !tbaa !9
  %109 = load i32, ptr %10, align 4, !tbaa !9
  %110 = icmp ne i32 %109, 0
  %111 = zext i1 %110 to i64
  %112 = select i1 %110, ptr @.str.5, ptr @.str.6
  %113 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %112)
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %115 = getelementptr inbounds [32 x i8], ptr %5, i64 0, i64 0
  call void @print_hex(ptr noundef %115, i64 noundef 32)
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %117 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  call void @print_hex(ptr noundef %117, i64 noundef 32)
  %118 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  %119 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  call void @print_hex(ptr noundef %119, i64 noundef 64)
  %120 = load ptr, ptr %15, align 8, !tbaa !5
  call void @secp256k1_context_destroy(ptr noundef %120)
  %121 = load ptr, ptr @secp256k1_context_static, align 8, !tbaa !5
  %122 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %123 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 0
  %124 = call i32 @secp256k1_schnorrsig_verify(ptr noundef %121, ptr noundef %122, ptr noundef %123, i64 noundef 32, ptr noundef %13)
  store i32 %124, ptr %11, align 4, !tbaa !9
  %125 = load i32, ptr %11, align 4, !tbaa !9
  %126 = load i32, ptr %10, align 4, !tbaa !9
  %127 = icmp eq i32 %125, %126
  br i1 %127, label %128, label %129

128:                                              ; preds = %104
  br label %130

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

130:                                              ; preds = %128
  %131 = getelementptr inbounds [32 x i8], ptr %5, i64 0, i64 0
  call void @secure_erase(ptr noundef %131, i64 noundef 32)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %132

132:                                              ; preds = %130, %92, %75, %37, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 64, 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 32, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 17, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %2) #6
  %133 = load i32, ptr %1, align 4
  ret i32 %133
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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) #2

declare ptr @secp256k1_context_create(i32 noundef) #3

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

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

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

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

declare i32 @secp256k1_keypair_create(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @secp256k1_keypair_xonly_pub(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @secp256k1_xonly_pubkey_serialize(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @secp256k1_tagged_sha256(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) #3

declare i32 @secp256k1_schnorrsig_sign32(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @secp256k1_xonly_pubkey_parse(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @secp256k1_schnorrsig_verify(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) #3

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

declare void @secp256k1_context_destroy(ptr noundef) #3

; 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { 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"}
!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"

%struct.secp256k1_xonly_pubkey = type { [64 x i8] }
%struct.secp256k1_keypair = type { [96 x i8] }

@__const.main.msg = external hidden unnamed_addr constant [12 x i8], align 1
@__const.main.tag = external hidden unnamed_addr constant [17 x i8], align 16
@.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 [86 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [12 x i8], align 1
@secp256k1_context_static = external local_unnamed_addr global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [42 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main() local_unnamed_addr #0 {
  %1 = alloca [12 x i8], align 1
  %2 = alloca [32 x i8], align 16
  %3 = alloca [17 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 %struct.secp256k1_xonly_pubkey, align 1
  %10 = alloca %struct.secp256k1_keypair, align 1
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %1) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(12) %1, ptr noundef nonnull align 1 dereferenceable(12) @__const.main.msg, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 17, ptr nonnull %3) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(17) %3, ptr noundef nonnull align 16 dereferenceable(17) @__const.main.tag, i64 17, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, 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 64, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %10) #7
  %11 = tail call ptr @secp256k1_context_create(i32 noundef 1) #7
  %12 = call i32 @fill_random(ptr noundef nonnull %5, 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 %58

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

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) #8
  unreachable

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

19:                                               ; preds = %.preheader
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %58

21:                                               ; preds = %.preheader
  %22 = call i32 @secp256k1_keypair_create(ptr noundef %11, ptr noundef nonnull %10, ptr noundef nonnull %4) #7
  %.not21 = icmp eq i32 %22, 0
  br i1 %.not21, label %.preheader, label %23

23:                                               ; preds = %21
  %24 = call i32 @secp256k1_keypair_xonly_pub(ptr noundef %11, ptr noundef nonnull %9, ptr noundef null, ptr noundef nonnull %10) #7
  %.not22 = icmp eq i32 %24, 0
  br i1 %.not22, label %25, label %26

25:                                               ; preds = %23
  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

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

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

29:                                               ; preds = %26
  %30 = call i32 @secp256k1_tagged_sha256(ptr noundef %11, ptr noundef nonnull %2, ptr noundef nonnull %3, i64 noundef 17, ptr noundef nonnull %1, i64 noundef 12) #7
  %.not24 = icmp eq i32 %30, 0
  br i1 %.not24, label %31, label %32

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

32:                                               ; preds = %29
  %33 = call i32 @fill_random(ptr noundef nonnull %6, i64 noundef 32)
  %.not25 = icmp eq i32 %33, 0
  br i1 %.not25, label %34, label %36

34:                                               ; preds = %32
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %58

36:                                               ; preds = %32
  %37 = call i32 @secp256k1_schnorrsig_sign32(ptr noundef %11, ptr noundef nonnull %8, ptr noundef nonnull %2, ptr noundef nonnull %10, ptr noundef nonnull %6) #7
  %.not26 = icmp eq i32 %37, 0
  br i1 %.not26, label %38, label %39

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

39:                                               ; preds = %36
  %40 = call i32 @secp256k1_xonly_pubkey_parse(ptr noundef %11, ptr noundef nonnull %9, ptr noundef nonnull %7) #7
  %.not27 = icmp eq i32 %40, 0
  br i1 %.not27, label %41, label %43

41:                                               ; preds = %39
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %58

43:                                               ; preds = %39
  %44 = call i32 @secp256k1_tagged_sha256(ptr noundef %11, ptr noundef nonnull %2, ptr noundef nonnull %3, i64 noundef 17, ptr noundef nonnull %1, i64 noundef 12) #7
  %.not28 = icmp eq i32 %44, 0
  br i1 %.not28, label %45, label %46

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

46:                                               ; preds = %43
  %47 = call i32 @secp256k1_schnorrsig_verify(ptr noundef %11, ptr noundef nonnull %8, ptr noundef nonnull %2, i64 noundef 32, ptr noundef nonnull %9) #7
  %.not29 = icmp eq i32 %47, 0
  %48 = select i1 %.not29, ptr @.str.6, ptr @.str.5
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %48)
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  call void @print_hex(ptr noundef nonnull %4, i64 noundef 32)
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  call void @print_hex(ptr noundef nonnull %7, i64 noundef 32)
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  call void @print_hex(ptr noundef nonnull %8, i64 noundef 64)
  call void @secp256k1_context_destroy(ptr noundef %11) #7
  %53 = load ptr, ptr @secp256k1_context_static, align 8, !tbaa !5
  %54 = call i32 @secp256k1_schnorrsig_verify(ptr noundef %53, ptr noundef nonnull %8, ptr noundef nonnull %2, i64 noundef 32, ptr noundef nonnull %9) #7
  %55 = icmp eq i32 %54, %47
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %46
  call void @secure_erase(ptr noundef nonnull %4, i64 noundef 32)
  br label %58

58:                                               ; preds = %57, %41, %34, %19, %13
  %.0 = phi i32 [ 0, %57 ], [ 1, %41 ], [ 1, %34 ], [ 1, %19 ], [ 1, %13 ]
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 64, 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 32, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 17, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 12, 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

; 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) #2

declare ptr @secp256k1_context_create(i32 noundef) local_unnamed_addr #3

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

declare i32 @secp256k1_context_randomize(ptr noundef, ptr noundef) local_unnamed_addr #3

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

declare i32 @secp256k1_keypair_create(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @secp256k1_keypair_xonly_pub(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @secp256k1_xonly_pubkey_serialize(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @secp256k1_tagged_sha256(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

declare i32 @secp256k1_schnorrsig_sign32(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @secp256k1_xonly_pubkey_parse(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @secp256k1_schnorrsig_verify(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { 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 #5 = { 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 #6 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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