; LLVM IR from openssl/openssl :: crypto/rsa (rsa_sp800_56b_check)

; 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.rsa_st = type { i32, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.rsa_pss_params_30_st, ptr, ptr, %struct.crypto_ex_data_st, %struct.CRYPTO_REF_COUNT, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.rsa_pss_params_30_st = type { i32, %struct.anon, i32, i32 }
%struct.anon = type { i32, i32 }
%struct.crypto_ex_data_st = type { ptr, ptr }
%struct.CRYPTO_REF_COUNT = type { i32 }

@.str = external hidden unnamed_addr constant [82 x i8], align 1
@__func__.ossl_rsa_sp800_56b_check_keypair = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @ossl_rsa_check_crt_components(ptr noundef, ptr noundef) #0

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

declare void @BN_CTX_start(ptr noundef) #2

declare ptr @BN_CTX_get(ptr noundef) #2

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

declare void @BN_clear(ptr noundef) #2

declare void @BN_CTX_end(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 i32 @BN_num_bits(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @ossl_rsa_check_prime_factor(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @ossl_rsa_check_private_exponent(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @ossl_rsa_check_public_exponent(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @ossl_rsa_check_pminusq_diff(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #0

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

declare void @ERR_new() #2

declare void @ERR_set_debug(ptr noundef, i32 noundef, ptr noundef) #2

declare void @ERR_set_error(i32 noundef, i32 noundef, ptr noundef, ...) #2

declare ptr @BN_CTX_new_ex(ptr noundef) #2

declare void @BN_CTX_free(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @ossl_rsa_sp800_56b_check_keypair(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  store ptr null, ptr %12, align 8, !tbaa !5
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.rsa_st, ptr %14, i32 0, i32 8
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = icmp eq ptr %16, null
  br i1 %17, label %38, label %18

18:                                               ; preds = %4
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.rsa_st, ptr %19, i32 0, i32 9
  %21 = load ptr, ptr %20, align 8, !tbaa !17
  %22 = icmp eq ptr %21, null
  br i1 %22, label %38, label %23

23:                                               ; preds = %18
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.rsa_st, ptr %24, i32 0, i32 6
  %26 = load ptr, ptr %25, align 8, !tbaa !18
  %27 = icmp eq ptr %26, null
  br i1 %27, label %38, label %28

28:                                               ; preds = %23
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.rsa_st, ptr %29, i32 0, i32 7
  %31 = load ptr, ptr %30, align 8, !tbaa !19
  %32 = icmp eq ptr %31, null
  br i1 %32, label %38, label %33

33:                                               ; preds = %28
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.rsa_st, ptr %34, i32 0, i32 5
  %36 = load ptr, ptr %35, align 8, !tbaa !20
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %39

38:                                               ; preds = %33, %28, %23, %18, %4
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 386, ptr noundef @__func__.ossl_rsa_sp800_56b_check_keypair)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 4, i32 noundef 175, ptr noundef null)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %170

39:                                               ; preds = %33
  %40 = load i32, ptr %9, align 4, !tbaa !9
  %41 = load i32, ptr %8, align 4, !tbaa !9
  %42 = call i32 @ossl_rsa_sp800_56b_validate_strength(i32 noundef %40, i32 noundef %41)
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %45, label %44

44:                                               ; preds = %39
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %170

45:                                               ; preds = %39
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = icmp ne ptr %46, null
  br i1 %47, label %48, label %57

48:                                               ; preds = %45
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.rsa_st, ptr %50, i32 0, i32 6
  %52 = load ptr, ptr %51, align 8, !tbaa !18
  %53 = call i32 @BN_cmp(ptr noundef %49, ptr noundef %52)
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %48
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 397, ptr noundef @__func__.ossl_rsa_sp800_56b_check_keypair)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 4, i32 noundef 175, ptr noundef null)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %170

56:                                               ; preds = %48
  br label %57

57:                                               ; preds = %56, %45
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.rsa_st, ptr %58, i32 0, i32 6
  %60 = load ptr, ptr %59, align 8, !tbaa !18
  %61 = call i32 @ossl_rsa_check_public_exponent(ptr noundef %60)
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %64, label %63

63:                                               ; preds = %57
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 404, ptr noundef @__func__.ossl_rsa_sp800_56b_check_keypair)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 4, i32 noundef 178, ptr noundef null)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %170

64:                                               ; preds = %57
  %65 = load i32, ptr %9, align 4, !tbaa !9
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.rsa_st, ptr %66, i32 0, i32 5
  %68 = load ptr, ptr %67, align 8, !tbaa !20
  %69 = call i32 @BN_num_bits(ptr noundef %68)
  %70 = icmp ne i32 %65, %69
  br i1 %70, label %71, label %72

71:                                               ; preds = %64
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 409, ptr noundef @__func__.ossl_rsa_sp800_56b_check_keypair)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 4, i32 noundef 171, ptr noundef null)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %170

72:                                               ; preds = %64
  %73 = load i32, ptr %9, align 4, !tbaa !9
  %74 = icmp sle i32 %73, 0
  br i1 %74, label %79, label %75

75:                                               ; preds = %72
  %76 = load i32, ptr %9, align 4, !tbaa !9
  %77 = and i32 %76, 1
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %80

79:                                               ; preds = %75, %72
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 414, ptr noundef @__func__.ossl_rsa_sp800_56b_check_keypair)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 4, i32 noundef 171, ptr noundef null)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %170

80:                                               ; preds = %75
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.rsa_st, ptr %81, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8, !tbaa !21
  %84 = call ptr @BN_CTX_new_ex(ptr noundef %83)
  store ptr %84, ptr %11, align 8, !tbaa !5
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = icmp eq ptr %85, null
  br i1 %86, label %87, label %88

87:                                               ; preds = %80
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %170

88:                                               ; preds = %80
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  call void @BN_CTX_start(ptr noundef %89)
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = call ptr @BN_CTX_get(ptr noundef %90)
  store ptr %91, ptr %12, align 8, !tbaa !5
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = icmp eq ptr %92, null
  br i1 %93, label %105, label %94

94:                                               ; preds = %88
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.rsa_st, ptr %96, i32 0, i32 8
  %98 = load ptr, ptr %97, align 8, !tbaa !11
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.rsa_st, ptr %99, i32 0, i32 9
  %101 = load ptr, ptr %100, align 8, !tbaa !17
  %102 = load ptr, ptr %11, align 8, !tbaa !5
  %103 = call i32 @BN_mul(ptr noundef %95, ptr noundef %98, ptr noundef %101, ptr noundef %102)
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %106, label %105

105:                                              ; preds = %94, %88
  br label %165

106:                                              ; preds = %94
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.rsa_st, ptr %107, i32 0, i32 5
  %109 = load ptr, ptr %108, align 8, !tbaa !20
  %110 = load ptr, ptr %12, align 8, !tbaa !5
  %111 = call i32 @BN_cmp(ptr noundef %109, ptr noundef %110)
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %114

113:                                              ; preds = %106
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 428, ptr noundef @__func__.ossl_rsa_sp800_56b_check_keypair)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 4, i32 noundef 175, ptr noundef null)
  br label %165

114:                                              ; preds = %106
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.rsa_st, ptr %115, i32 0, i32 8
  %117 = load ptr, ptr %116, align 8, !tbaa !11
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.rsa_st, ptr %118, i32 0, i32 6
  %120 = load ptr, ptr %119, align 8, !tbaa !18
  %121 = load i32, ptr %9, align 4, !tbaa !9
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = call i32 @ossl_rsa_check_prime_factor(ptr noundef %117, ptr noundef %120, i32 noundef %121, ptr noundef %122)
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %158

125:                                              ; preds = %114
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.rsa_st, ptr %126, i32 0, i32 9
  %128 = load ptr, ptr %127, align 8, !tbaa !17
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.rsa_st, ptr %129, i32 0, i32 6
  %131 = load ptr, ptr %130, align 8, !tbaa !18
  %132 = load i32, ptr %9, align 4, !tbaa !9
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = call i32 @ossl_rsa_check_prime_factor(ptr noundef %128, ptr noundef %131, i32 noundef %132, ptr noundef %133)
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %158

136:                                              ; preds = %125
  %137 = load ptr, ptr %12, align 8, !tbaa !5
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.rsa_st, ptr %138, i32 0, i32 8
  %140 = load ptr, ptr %139, align 8, !tbaa !11
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.rsa_st, ptr %141, i32 0, i32 9
  %143 = load ptr, ptr %142, align 8, !tbaa !17
  %144 = load i32, ptr %9, align 4, !tbaa !9
  %145 = call i32 @ossl_rsa_check_pminusq_diff(ptr noundef %137, ptr noundef %140, ptr noundef %143, i32 noundef %144)
  %146 = icmp sgt i32 %145, 0
  br i1 %146, label %147, label %158

147:                                              ; preds = %136
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = load i32, ptr %9, align 4, !tbaa !9
  %150 = load ptr, ptr %11, align 8, !tbaa !5
  %151 = call i32 @ossl_rsa_check_private_exponent(ptr noundef %148, i32 noundef %149, ptr noundef %150)
  %152 = icmp ne i32 %151, 0
  br i1 %152, label %153, label %158

153:                                              ; preds = %147
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = load ptr, ptr %11, align 8, !tbaa !5
  %156 = call i32 @ossl_rsa_check_crt_components(ptr noundef %154, ptr noundef %155)
  %157 = icmp ne i32 %156, 0
  br label %158

158:                                              ; preds = %153, %147, %136, %125, %114
  %159 = phi i1 [ false, %147 ], [ false, %136 ], [ false, %125 ], [ false, %114 ], [ %157, %153 ]
  %160 = zext i1 %159 to i32
  store i32 %160, ptr %10, align 4, !tbaa !9
  %161 = load i32, ptr %10, align 4, !tbaa !9
  %162 = icmp ne i32 %161, 1
  br i1 %162, label %163, label %164

163:                                              ; preds = %158
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 441, ptr noundef @__func__.ossl_rsa_sp800_56b_check_keypair)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 4, i32 noundef 171, ptr noundef null)
  br label %164

164:                                              ; preds = %163, %158
  br label %165

165:                                              ; preds = %164, %113, %105
  %166 = load ptr, ptr %12, align 8, !tbaa !5
  call void @BN_clear(ptr noundef %166)
  %167 = load ptr, ptr %11, align 8, !tbaa !5
  call void @BN_CTX_end(ptr noundef %167)
  %168 = load ptr, ptr %11, align 8, !tbaa !5
  call void @BN_CTX_free(ptr noundef %168)
  %169 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %169, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %170

170:                                              ; preds = %165, %87, %79, %71, %63, %55, %44, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  %171 = load i32, ptr %5, align 4
  ret i32 %171
}

declare i32 @ossl_rsa_sp800_56b_validate_strength(i32 noundef, i32 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 = !{!"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, !6, i64 64}
!12 = !{!"rsa_st", !10, i64 0, !6, i64 8, !10, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !13, i64 104, !6, i64 128, !6, i64 136, !15, i64 144, !16, i64 160, !10, i64 164, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !10, i64 216}
!13 = !{!"rsa_pss_params_30_st", !10, i64 0, !14, i64 4, !10, i64 12, !10, i64 16}
!14 = !{!"", !10, i64 0, !10, i64 4}
!15 = !{!"crypto_ex_data_st", !6, i64 0, !6, i64 8}
!16 = !{!"", !7, i64 0}
!17 = !{!12, !6, i64 72}
!18 = !{!12, !6, i64 48}
!19 = !{!12, !6, i64 56}
!20 = !{!12, !6, i64 40}
!21 = !{!12, !6, i64 8}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [82 x i8], align 1
@__func__.ossl_rsa_sp800_56b_check_keypair = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @ossl_rsa_check_crt_components(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @BN_CTX_start(ptr noundef) local_unnamed_addr #1

declare ptr @BN_CTX_get(ptr noundef) local_unnamed_addr #1

declare i32 @BN_cmp(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @BN_clear(ptr noundef) local_unnamed_addr #1

declare void @BN_CTX_end(ptr noundef) local_unnamed_addr #1

declare i32 @BN_num_bits(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @ossl_rsa_check_prime_factor(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @ossl_rsa_check_private_exponent(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @ossl_rsa_check_public_exponent(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @ossl_rsa_check_pminusq_diff(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

declare i32 @BN_mul(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @ERR_new() local_unnamed_addr #1

declare void @ERR_set_debug(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare void @ERR_set_error(i32 noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

declare ptr @BN_CTX_new_ex(ptr noundef) local_unnamed_addr #1

declare void @BN_CTX_free(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @ossl_rsa_sp800_56b_check_keypair(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = getelementptr inbounds i8, ptr %0, i64 64
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = icmp eq ptr %6, null
  br i1 %7, label %24, label %8

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %0, i64 72
  %10 = load ptr, ptr %9, align 8, !tbaa !15
  %11 = icmp eq ptr %10, null
  br i1 %11, label %24, label %12

12:                                               ; preds = %8
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  %14 = load ptr, ptr %13, align 8, !tbaa !16
  %15 = icmp eq ptr %14, null
  br i1 %15, label %24, label %16

16:                                               ; preds = %12
  %17 = getelementptr inbounds i8, ptr %0, i64 56
  %18 = load ptr, ptr %17, align 8, !tbaa !17
  %19 = icmp eq ptr %18, null
  br i1 %19, label %24, label %20

20:                                               ; preds = %16
  %21 = getelementptr inbounds i8, ptr %0, i64 40
  %22 = load ptr, ptr %21, align 8, !tbaa !18
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %25

24:                                               ; preds = %20, %16, %12, %8, %4
  tail call void @ERR_new() #2
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 386, ptr noundef nonnull @__func__.ossl_rsa_sp800_56b_check_keypair) #2
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 4, i32 noundef 175, ptr noundef null) #2
  br label %77

25:                                               ; preds = %20
  %26 = tail call i32 @ossl_rsa_sp800_56b_validate_strength(i32 noundef %3, i32 noundef %2) #2
  %.not = icmp eq i32 %26, 0
  br i1 %.not, label %77, label %27

27:                                               ; preds = %25
  %.not54 = icmp eq ptr %1, null
  br i1 %.not54, label %32, label %28

28:                                               ; preds = %27
  %29 = load ptr, ptr %13, align 8, !tbaa !16
  %30 = tail call i32 @BN_cmp(ptr noundef nonnull %1, ptr noundef %29) #2
  %.not55 = icmp eq i32 %30, 0
  br i1 %.not55, label %32, label %31

31:                                               ; preds = %28
  tail call void @ERR_new() #2
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 397, ptr noundef nonnull @__func__.ossl_rsa_sp800_56b_check_keypair) #2
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 4, i32 noundef 175, ptr noundef null) #2
  br label %77

32:                                               ; preds = %28, %27
  %33 = load ptr, ptr %13, align 8, !tbaa !16
  %34 = tail call i32 @ossl_rsa_check_public_exponent(ptr noundef %33)
  %.not56 = icmp eq i32 %34, 0
  br i1 %.not56, label %35, label %36

35:                                               ; preds = %32
  tail call void @ERR_new() #2
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 404, ptr noundef nonnull @__func__.ossl_rsa_sp800_56b_check_keypair) #2
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 4, i32 noundef 178, ptr noundef null) #2
  br label %77

36:                                               ; preds = %32
  %37 = load ptr, ptr %21, align 8, !tbaa !18
  %38 = tail call i32 @BN_num_bits(ptr noundef %37) #2
  %.not57 = icmp eq i32 %38, %3
  br i1 %.not57, label %40, label %39

39:                                               ; preds = %36
  tail call void @ERR_new() #2
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 409, ptr noundef nonnull @__func__.ossl_rsa_sp800_56b_check_keypair) #2
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 4, i32 noundef 171, ptr noundef null) #2
  br label %77

40:                                               ; preds = %36
  %41 = icmp sgt i32 %3, 0
  %42 = and i32 %3, 1
  %.not58 = icmp eq i32 %42, 0
  %or.cond = and i1 %41, %.not58
  br i1 %or.cond, label %44, label %43

43:                                               ; preds = %40
  tail call void @ERR_new() #2
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 414, ptr noundef nonnull @__func__.ossl_rsa_sp800_56b_check_keypair) #2
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 4, i32 noundef 171, ptr noundef null) #2
  br label %77

44:                                               ; preds = %40
  %45 = getelementptr inbounds i8, ptr %0, i64 8
  %46 = load ptr, ptr %45, align 8, !tbaa !19
  %47 = tail call ptr @BN_CTX_new_ex(ptr noundef %46) #2
  %48 = icmp eq ptr %47, null
  br i1 %48, label %77, label %49

49:                                               ; preds = %44
  tail call void @BN_CTX_start(ptr noundef nonnull %47) #2
  %50 = tail call ptr @BN_CTX_get(ptr noundef nonnull %47) #2
  %51 = icmp eq ptr %50, null
  br i1 %51, label %76, label %52

52:                                               ; preds = %49
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = load ptr, ptr %9, align 8, !tbaa !15
  %55 = tail call i32 @BN_mul(ptr noundef nonnull %50, ptr noundef %53, ptr noundef %54, ptr noundef nonnull %47) #2
  %.not59 = icmp eq i32 %55, 0
  br i1 %.not59, label %76, label %56

56:                                               ; preds = %52
  %57 = load ptr, ptr %21, align 8, !tbaa !18
  %58 = tail call i32 @BN_cmp(ptr noundef %57, ptr noundef nonnull %50) #2
  %.not60 = icmp eq i32 %58, 0
  br i1 %.not60, label %59, label %.sink.split

59:                                               ; preds = %56
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = load ptr, ptr %13, align 8, !tbaa !16
  %62 = tail call i32 @ossl_rsa_check_prime_factor(ptr noundef %60, ptr noundef %61, i32 noundef %3, ptr noundef nonnull %47)
  %.not61 = icmp eq i32 %62, 0
  br i1 %.not61, label %.sink.split, label %63

63:                                               ; preds = %59
  %64 = load ptr, ptr %9, align 8, !tbaa !15
  %65 = load ptr, ptr %13, align 8, !tbaa !16
  %66 = tail call i32 @ossl_rsa_check_prime_factor(ptr noundef %64, ptr noundef %65, i32 noundef %3, ptr noundef nonnull %47)
  %.not62 = icmp eq i32 %66, 0
  br i1 %.not62, label %.sink.split, label %67

67:                                               ; preds = %63
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = load ptr, ptr %9, align 8, !tbaa !15
  %70 = tail call i32 @ossl_rsa_check_pminusq_diff(ptr noundef nonnull %50, ptr noundef %68, ptr noundef %69, i32 noundef %3)
  %71 = icmp sgt i32 %70, 0
  br i1 %71, label %72, label %.sink.split

72:                                               ; preds = %67
  %73 = tail call i32 @ossl_rsa_check_private_exponent(ptr noundef nonnull %0, i32 noundef %3, ptr noundef nonnull %47)
  %.not63 = icmp eq i32 %73, 0
  br i1 %.not63, label %.sink.split, label %74

74:                                               ; preds = %72
  %75 = tail call i32 @ossl_rsa_check_crt_components(ptr noundef nonnull %0, ptr noundef nonnull %47)
  %.not65 = icmp eq i32 %75, 0
  br i1 %.not65, label %.sink.split, label %76

.sink.split:                                      ; preds = %74, %59, %63, %67, %72, %56
  %.sink66 = phi i32 [ 428, %56 ], [ 441, %72 ], [ 441, %67 ], [ 441, %63 ], [ 441, %59 ], [ 441, %74 ]
  %.sink = phi i32 [ 175, %56 ], [ 171, %72 ], [ 171, %67 ], [ 171, %63 ], [ 171, %59 ], [ 171, %74 ]
  tail call void @ERR_new() #2
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef %.sink66, ptr noundef nonnull @__func__.ossl_rsa_sp800_56b_check_keypair) #2
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 4, i32 noundef %.sink, ptr noundef null) #2
  br label %76

76:                                               ; preds = %.sink.split, %74, %49, %52
  %.0 = phi i32 [ 0, %49 ], [ 1, %74 ], [ 0, %52 ], [ 0, %.sink.split ]
  tail call void @BN_clear(ptr noundef %50) #2
  tail call void @BN_CTX_end(ptr noundef nonnull %47) #2
  tail call void @BN_CTX_free(ptr noundef nonnull %47) #2
  br label %77

77:                                               ; preds = %44, %25, %76, %43, %39, %35, %31, %24
  %.048 = phi i32 [ 0, %24 ], [ 0, %31 ], [ 0, %39 ], [ 0, %43 ], [ %.0, %76 ], [ 0, %35 ], [ 0, %25 ], [ 0, %44 ]
  ret i32 %.048
}

declare i32 @ossl_rsa_sp800_56b_validate_strength(i32 noundef, i32 noundef) local_unnamed_addr #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 = { "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 #2 = { 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, !10, i64 64}
!6 = !{!"rsa_st", !7, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !11, i64 104, !10, i64 128, !10, i64 136, !13, i64 144, !14, i64 160, !7, i64 164, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !7, i64 216}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"rsa_pss_params_30_st", !7, i64 0, !12, i64 4, !7, i64 12, !7, i64 16}
!12 = !{!"", !7, i64 0, !7, i64 4}
!13 = !{!"crypto_ex_data_st", !10, i64 0, !10, i64 8}
!14 = !{!"", !8, i64 0}
!15 = !{!6, !10, i64 72}
!16 = !{!6, !10, i64 48}
!17 = !{!6, !10, i64 56}
!18 = !{!6, !10, i64 40}
!19 = !{!6, !10, i64 8}


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