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

; 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.SHA256state_st = type { [8 x i32], i32, i32, [16 x i32], i32, i32 }

@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @openssl_check(i32 noundef %0, i32 noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca [64 x i8], align 16
  %8 = alloca [33 x i8], align 16
  %9 = alloca [65 x i8], align 16
  %10 = alloca [32 x i8], align 16
  %11 = alloca [256 x i8], align 16
  %12 = alloca [32 x i8], align 16
  %13 = alloca %struct.SHA256state_st, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 64, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 33, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 65, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 256, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 112, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = call ptr @EC_GROUP_new_by_curve_name(i32 noundef %25)
  store ptr %26, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %141, %3
  %28 = load i32, ptr %15, align 4, !tbaa !5
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = icmp ult i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  store i32 2, ptr %16, align 4
  br label %144

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %33 = call i32 @random32()
  %34 = and i32 %33, 255
  %35 = add i32 %34, 1
  store i32 %35, ptr %17, align 4, !tbaa !5
  %36 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 0
  %37 = load i32, ptr %17, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  call void @random_buffer(ptr noundef %36, i64 noundef %38)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %39 = call ptr @EC_KEY_new()
  store ptr %39, ptr %18, align 8, !tbaa !9
  %40 = load ptr, ptr %18, align 8, !tbaa !9
  %41 = load ptr, ptr %14, align 8, !tbaa !9
  %42 = call i32 @EC_KEY_set_group(ptr noundef %40, ptr noundef %41)
  %43 = load ptr, ptr %18, align 8, !tbaa !9
  %44 = call i32 @EC_KEY_generate_key(ptr noundef %43)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %45 = load ptr, ptr %18, align 8, !tbaa !9
  %46 = call ptr @EC_KEY_get0_private_key(ptr noundef %45)
  store ptr %46, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  %47 = load ptr, ptr %19, align 8, !tbaa !9
  %48 = call i32 @BN_num_bits(ptr noundef %47)
  %49 = add nsw i32 %48, 7
  %50 = sdiv i32 %49, 8
  %51 = sext i32 %50 to i64
  %52 = sub i64 32, %51
  %53 = trunc i64 %52 to i32
  store i32 %53, ptr %20, align 4, !tbaa !5
  %54 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %55 = load i32, ptr %20, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  call void @memzero(ptr noundef %54, i64 noundef %56)
  %57 = load ptr, ptr %19, align 8, !tbaa !9
  %58 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %59 = load i32, ptr %20, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i8, ptr %58, i64 %60
  %62 = call i32 @BN_bn2bin(ptr noundef %57, ptr noundef %61)
  %63 = load ptr, ptr %6, align 8, !tbaa !9
  %64 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %65 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 0
  %66 = load i32, ptr %17, align 4, !tbaa !5
  %67 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %68 = call i32 @ecdsa_sign(ptr noundef %63, i32 noundef 0, ptr noundef %64, ptr noundef %65, i32 noundef %66, ptr noundef %67, ptr noundef null, ptr noundef null)
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %72

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

72:                                               ; preds = %32
  %73 = load ptr, ptr %6, align 8, !tbaa !9
  %74 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %75 = getelementptr inbounds [33 x i8], ptr %8, i64 0, i64 0
  call void @ecdsa_get_public_key33(ptr noundef %73, ptr noundef %74, ptr noundef %75)
  %76 = load ptr, ptr %6, align 8, !tbaa !9
  %77 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %78 = getelementptr inbounds [65 x i8], ptr %9, i64 0, i64 0
  call void @ecdsa_get_public_key65(ptr noundef %76, ptr noundef %77, ptr noundef %78)
  %79 = load ptr, ptr %6, align 8, !tbaa !9
  %80 = getelementptr inbounds [65 x i8], ptr %9, i64 0, i64 0
  %81 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %82 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 0
  %83 = load i32, ptr %17, align 4, !tbaa !5
  %84 = call i32 @ecdsa_verify(ptr noundef %79, i32 noundef 0, ptr noundef %80, ptr noundef %81, ptr noundef %82, i32 noundef %83)
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %88

86:                                               ; preds = %72
  %87 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  store i32 1, ptr %16, align 4
  br label %138

88:                                               ; preds = %72
  %89 = load ptr, ptr %6, align 8, !tbaa !9
  %90 = getelementptr inbounds [33 x i8], ptr %8, i64 0, i64 0
  %91 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %92 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 0
  %93 = load i32, ptr %17, align 4, !tbaa !5
  %94 = call i32 @ecdsa_verify(ptr noundef %89, i32 noundef 0, ptr noundef %90, ptr noundef %91, ptr noundef %92, i32 noundef %93)
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %96, label %98

96:                                               ; preds = %88
  %97 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  store i32 1, ptr %16, align 4
  br label %138

98:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %99 = call ptr @ECDSA_SIG_new()
  store ptr %99, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %100 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %101 = call ptr @BN_bin2bn(ptr noundef %100, i32 noundef 32, ptr noundef null)
  store ptr %101, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %102 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %103 = getelementptr inbounds i8, ptr %102, i64 32
  %104 = call ptr @BN_bin2bn(ptr noundef %103, i32 noundef 32, ptr noundef null)
  store ptr %104, ptr %23, align 8, !tbaa !9
  %105 = load ptr, ptr %21, align 8, !tbaa !9
  %106 = load ptr, ptr %22, align 8, !tbaa !9
  %107 = load ptr, ptr %23, align 8, !tbaa !9
  %108 = call i32 @ECDSA_SIG_set0(ptr noundef %105, ptr noundef %106, ptr noundef %107)
  %109 = call i32 @SHA256_Init(ptr noundef %13)
  %110 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 0
  %111 = load i32, ptr %17, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = call i32 @SHA256_Update(ptr noundef %13, ptr noundef %110, i64 noundef %112)
  %114 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %115 = call i32 @SHA256_Final(ptr noundef %114, ptr noundef %13)
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  %116 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %117 = load ptr, ptr %21, align 8, !tbaa !9
  %118 = load ptr, ptr %18, align 8, !tbaa !9
  %119 = call i32 @ECDSA_do_verify(ptr noundef %116, i32 noundef 32, ptr noundef %117, ptr noundef %118)
  store i32 %119, ptr %24, align 4, !tbaa !5
  %120 = load i32, ptr %24, align 4, !tbaa !5
  %121 = icmp ne i32 %120, 1
  br i1 %121, label %122, label %125

122:                                              ; preds = %98
  %123 = load i32, ptr %24, align 4, !tbaa !5
  %124 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %123)
  store i32 1, ptr %16, align 4
  br label %137

125:                                              ; preds = %98
  %126 = load ptr, ptr %21, align 8, !tbaa !9
  call void @ECDSA_SIG_free(ptr noundef %126)
  %127 = load ptr, ptr %18, align 8, !tbaa !9
  call void @EC_KEY_free(ptr noundef %127)
  %128 = load i32, ptr %15, align 4, !tbaa !5
  %129 = add i32 %128, 1
  %130 = urem i32 %129, 100
  %131 = icmp eq i32 %130, 0
  br i1 %131, label %132, label %136

132:                                              ; preds = %125
  %133 = load i32, ptr %15, align 4, !tbaa !5
  %134 = add i32 %133, 1
  %135 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %134)
  br label %136

136:                                              ; preds = %132, %125
  store i32 0, ptr %16, align 4
  br label %137

137:                                              ; preds = %136, %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  br label %138

138:                                              ; preds = %137, %96, %86, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  %139 = load i32, ptr %16, align 4
  switch i32 %139, label %144 [
    i32 0, label %140
  ]

140:                                              ; preds = %138
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %15, align 4, !tbaa !5
  %143 = add i32 %142, 1
  store i32 %143, ptr %15, align 4, !tbaa !5
  br label %27, !llvm.loop !11

144:                                              ; preds = %138, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  %145 = load i32, ptr %16, align 4
  switch i32 %145, label %149 [
    i32 2, label %146
  ]

146:                                              ; preds = %144
  %147 = load ptr, ptr %14, align 8, !tbaa !9
  call void @EC_GROUP_free(ptr noundef %147)
  %148 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  store i32 0, ptr %16, align 4
  br label %149

149:                                              ; preds = %146, %144
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 112, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 256, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 65, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 33, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #3
  %150 = load i32, ptr %16, align 4
  switch i32 %150, label %152 [
    i32 0, label %151
    i32 1, label %151
  ]

151:                                              ; preds = %149, %149
  ret void

152:                                              ; preds = %149
  unreachable
}

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

declare ptr @EC_GROUP_new_by_curve_name(i32 noundef) #2

declare i32 @random32() #2

declare void @random_buffer(ptr noundef, i64 noundef) #2

declare ptr @EC_KEY_new() #2

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

declare i32 @EC_KEY_generate_key(ptr noundef) #2

declare ptr @EC_KEY_get0_private_key(ptr noundef) #2

declare i32 @BN_num_bits(ptr noundef) #2

declare void @memzero(ptr noundef, i64 noundef) #2

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

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

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

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

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

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

declare ptr @ECDSA_SIG_new() #2

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

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

declare i32 @SHA256_Init(ptr noundef) #2

declare i32 @SHA256_Update(ptr noundef, ptr noundef, i64 noundef) #2

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

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

declare void @ECDSA_SIG_free(ptr noundef) #2

declare void @EC_KEY_free(ptr noundef) #2

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

declare void @EC_GROUP_free(ptr noundef) #2

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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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.SHA256state_st = type { [8 x i32], i32, i32, [16 x i32], i32, i32 }

@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @openssl_check(i32 noundef %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca [64 x i8], align 16
  %5 = alloca [33 x i8], align 16
  %6 = alloca [65 x i8], align 16
  %7 = alloca [32 x i8], align 16
  %8 = alloca [256 x i8], align 16
  %9 = alloca [32 x i8], align 16
  %10 = alloca %struct.SHA256state_st, align 4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 33, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 65, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %10) #4
  %11 = tail call ptr @EC_GROUP_new_by_curve_name(i32 noundef %1) #4
  %.not4144.not = icmp eq i32 %0, 0
  br i1 %.not4144.not, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %12 = getelementptr inbounds i8, ptr %4, i64 32
  br label %13

13:                                               ; preds = %.lr.ph, %55
  %.045 = phi i32 [ 0, %.lr.ph ], [ %50, %55 ]
  %14 = call i32 @random32() #4
  %15 = and i32 %14, 255
  %16 = add nuw nsw i32 %15, 1
  %17 = zext nneg i32 %16 to i64
  call void @random_buffer(ptr noundef nonnull %8, i64 noundef %17) #4
  %18 = call ptr @EC_KEY_new() #4
  %19 = call i32 @EC_KEY_set_group(ptr noundef %18, ptr noundef %11) #4
  %20 = call i32 @EC_KEY_generate_key(ptr noundef %18) #4
  %21 = call ptr @EC_KEY_get0_private_key(ptr noundef %18) #4
  %22 = call i32 @BN_num_bits(ptr noundef %21) #4
  %23 = add nsw i32 %22, 7
  %.neg = sdiv i32 %23, -8
  %narrow = add nsw i32 %.neg, 32
  %24 = sext i32 %narrow to i64
  call void @memzero(ptr noundef nonnull %7, i64 noundef %24) #4
  %25 = getelementptr inbounds i8, ptr %7, i64 %24
  %26 = call i32 @BN_bn2bin(ptr noundef %21, ptr noundef nonnull %25) #4
  %27 = call i32 @ecdsa_sign(ptr noundef %2, i32 noundef 0, ptr noundef nonnull %7, ptr noundef nonnull %8, i32 noundef %16, ptr noundef nonnull %4, ptr noundef null, ptr noundef null) #4
  %.not = icmp eq i32 %27, 0
  br i1 %.not, label %30, label %28

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

30:                                               ; preds = %13
  call void @ecdsa_get_public_key33(ptr noundef %2, ptr noundef nonnull %7, ptr noundef nonnull %5) #4
  call void @ecdsa_get_public_key65(ptr noundef %2, ptr noundef nonnull %7, ptr noundef nonnull %6) #4
  %31 = call i32 @ecdsa_verify(ptr noundef %2, i32 noundef 0, ptr noundef nonnull %6, ptr noundef nonnull %4, ptr noundef nonnull %8, i32 noundef %16) #4
  %.not38 = icmp eq i32 %31, 0
  br i1 %.not38, label %34, label %32

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

34:                                               ; preds = %30
  %35 = call i32 @ecdsa_verify(ptr noundef %2, i32 noundef 0, ptr noundef nonnull %5, ptr noundef nonnull %4, ptr noundef nonnull %8, i32 noundef %16) #4
  %.not39 = icmp eq i32 %35, 0
  br i1 %.not39, label %38, label %36

36:                                               ; preds = %34
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %57

38:                                               ; preds = %34
  %39 = call ptr @ECDSA_SIG_new() #4
  %40 = call ptr @BN_bin2bn(ptr noundef nonnull %4, i32 noundef 32, ptr noundef null) #4
  %41 = call ptr @BN_bin2bn(ptr noundef nonnull %12, i32 noundef 32, ptr noundef null) #4
  %42 = call i32 @ECDSA_SIG_set0(ptr noundef %39, ptr noundef %40, ptr noundef %41) #4
  %43 = call i32 @SHA256_Init(ptr noundef nonnull %10) #4
  %44 = call i32 @SHA256_Update(ptr noundef nonnull %10, ptr noundef nonnull %8, i64 noundef %17) #4
  %45 = call i32 @SHA256_Final(ptr noundef nonnull %9, ptr noundef nonnull %10) #4
  %46 = call i32 @ECDSA_do_verify(ptr noundef nonnull %9, i32 noundef 32, ptr noundef %39, ptr noundef %18) #4
  %.not40 = icmp eq i32 %46, 1
  br i1 %.not40, label %49, label %47

47:                                               ; preds = %38
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %46)
  br label %57

49:                                               ; preds = %38
  call void @ECDSA_SIG_free(ptr noundef %39) #4
  call void @EC_KEY_free(ptr noundef %18) #4
  %50 = add nuw i32 %.045, 1
  %51 = urem i32 %50, 100
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %53, label %55

53:                                               ; preds = %49
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %50)
  br label %55

55:                                               ; preds = %49, %53
  %exitcond.not = icmp eq i32 %50, %0
  br i1 %exitcond.not, label %.critedge, label %13, !llvm.loop !5

.critedge:                                        ; preds = %55, %3
  call void @EC_GROUP_free(ptr noundef %11) #4
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %57

57:                                               ; preds = %47, %36, %32, %28, %.critedge
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 65, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 33, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #4
  ret void
}

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

declare ptr @EC_GROUP_new_by_curve_name(i32 noundef) local_unnamed_addr #2

declare i32 @random32() local_unnamed_addr #2

declare void @random_buffer(ptr noundef, i64 noundef) local_unnamed_addr #2

declare ptr @EC_KEY_new() local_unnamed_addr #2

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

declare i32 @EC_KEY_generate_key(ptr noundef) local_unnamed_addr #2

declare ptr @EC_KEY_get0_private_key(ptr noundef) local_unnamed_addr #2

declare i32 @BN_num_bits(ptr noundef) local_unnamed_addr #2

declare void @memzero(ptr noundef, i64 noundef) local_unnamed_addr #2

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

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

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

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

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

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

declare ptr @ECDSA_SIG_new() local_unnamed_addr #2

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

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

declare i32 @SHA256_Init(ptr noundef) local_unnamed_addr #2

declare i32 @SHA256_Update(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

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

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

declare void @ECDSA_SIG_free(ptr noundef) local_unnamed_addr #2

declare void @EC_KEY_free(ptr noundef) local_unnamed_addr #2

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

declare void @EC_GROUP_free(ptr noundef) local_unnamed_addr #2

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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass