; LLVM IR from openanolis/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 [85 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 380, 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 %162

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 %162

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 391, 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 %162

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 398, 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 %162

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 403, 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 %162

72:                                               ; preds = %64
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.rsa_st, ptr %73, i32 0, i32 1
  %75 = load ptr, ptr %74, align 8, !tbaa !21
  %76 = call ptr @BN_CTX_new_ex(ptr noundef %75)
  store ptr %76, ptr %11, align 8, !tbaa !5
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = icmp eq ptr %77, null
  br i1 %78, label %79, label %80

79:                                               ; preds = %72
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %162

80:                                               ; preds = %72
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  call void @BN_CTX_start(ptr noundef %81)
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  %83 = call ptr @BN_CTX_get(ptr noundef %82)
  store ptr %83, ptr %12, align 8, !tbaa !5
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  %85 = icmp eq ptr %84, null
  br i1 %85, label %97, label %86

86:                                               ; preds = %80
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.rsa_st, ptr %88, i32 0, i32 8
  %90 = load ptr, ptr %89, align 8, !tbaa !11
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.rsa_st, ptr %91, i32 0, i32 9
  %93 = load ptr, ptr %92, align 8, !tbaa !17
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = call i32 @BN_mul(ptr noundef %87, ptr noundef %90, ptr noundef %93, ptr noundef %94)
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %98, label %97

97:                                               ; preds = %86, %80
  br label %157

98:                                               ; preds = %86
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.rsa_st, ptr %99, i32 0, i32 5
  %101 = load ptr, ptr %100, align 8, !tbaa !20
  %102 = load ptr, ptr %12, align 8, !tbaa !5
  %103 = call i32 @BN_cmp(ptr noundef %101, ptr noundef %102)
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %106

105:                                              ; preds = %98
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 417, 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 %157

106:                                              ; preds = %98
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.rsa_st, ptr %107, i32 0, i32 8
  %109 = load ptr, ptr %108, align 8, !tbaa !11
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.rsa_st, ptr %110, i32 0, i32 6
  %112 = load ptr, ptr %111, align 8, !tbaa !18
  %113 = load i32, ptr %9, align 4, !tbaa !9
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = call i32 @ossl_rsa_check_prime_factor(ptr noundef %109, ptr noundef %112, i32 noundef %113, ptr noundef %114)
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %150

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

128:                                              ; preds = %117
  %129 = load ptr, ptr %12, align 8, !tbaa !5
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.rsa_st, ptr %130, i32 0, i32 8
  %132 = load ptr, ptr %131, align 8, !tbaa !11
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.rsa_st, ptr %133, i32 0, i32 9
  %135 = load ptr, ptr %134, align 8, !tbaa !17
  %136 = load i32, ptr %9, align 4, !tbaa !9
  %137 = call i32 @ossl_rsa_check_pminusq_diff(ptr noundef %129, ptr noundef %132, ptr noundef %135, i32 noundef %136)
  %138 = icmp sgt i32 %137, 0
  br i1 %138, label %139, label %150

139:                                              ; preds = %128
  %140 = load ptr, ptr %6, align 8, !tbaa !5
  %141 = load i32, ptr %9, align 4, !tbaa !9
  %142 = load ptr, ptr %11, align 8, !tbaa !5
  %143 = call i32 @ossl_rsa_check_private_exponent(ptr noundef %140, i32 noundef %141, ptr noundef %142)
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %150

145:                                              ; preds = %139
  %146 = load ptr, ptr %6, align 8, !tbaa !5
  %147 = load ptr, ptr %11, align 8, !tbaa !5
  %148 = call i32 @ossl_rsa_check_crt_components(ptr noundef %146, ptr noundef %147)
  %149 = icmp ne i32 %148, 0
  br label %150

150:                                              ; preds = %145, %139, %128, %117, %106
  %151 = phi i1 [ false, %139 ], [ false, %128 ], [ false, %117 ], [ false, %106 ], [ %149, %145 ]
  %152 = zext i1 %151 to i32
  store i32 %152, ptr %10, align 4, !tbaa !9
  %153 = load i32, ptr %10, align 4, !tbaa !9
  %154 = icmp ne i32 %153, 1
  br i1 %154, label %155, label %156

155:                                              ; preds = %150
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 430, 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 %156

156:                                              ; preds = %155, %150
  br label %157

157:                                              ; preds = %156, %105, %97
  %158 = load ptr, ptr %12, align 8, !tbaa !5
  call void @BN_clear(ptr noundef %158)
  %159 = load ptr, ptr %11, align 8, !tbaa !5
  call void @BN_CTX_end(ptr noundef %159)
  %160 = load ptr, ptr %11, align 8, !tbaa !5
  call void @BN_CTX_free(ptr noundef %160)
  %161 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %161, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %162

162:                                              ; preds = %157, %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
  %163 = load i32, ptr %5, align 4
  ret i32 %163
}

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 [85 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 380, 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 %73

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 %73, label %27

27:                                               ; preds = %25
  %.not52 = icmp eq ptr %1, null
  br i1 %.not52, 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
  %.not53 = icmp eq i32 %30, 0
  br i1 %.not53, 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 391, 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 %73

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)
  %.not54 = icmp eq i32 %34, 0
  br i1 %.not54, 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 398, 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 %73

36:                                               ; preds = %32
  %37 = load ptr, ptr %21, align 8, !tbaa !18
  %38 = tail call i32 @BN_num_bits(ptr noundef %37) #2
  %.not55 = icmp eq i32 %38, %3
  br i1 %.not55, 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 403, 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 %73

40:                                               ; preds = %36
  %41 = getelementptr inbounds i8, ptr %0, i64 8
  %42 = load ptr, ptr %41, align 8, !tbaa !19
  %43 = tail call ptr @BN_CTX_new_ex(ptr noundef %42) #2
  %44 = icmp eq ptr %43, null
  br i1 %44, label %73, label %45

45:                                               ; preds = %40
  tail call void @BN_CTX_start(ptr noundef nonnull %43) #2
  %46 = tail call ptr @BN_CTX_get(ptr noundef nonnull %43) #2
  %47 = icmp eq ptr %46, null
  br i1 %47, label %72, label %48

48:                                               ; preds = %45
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = load ptr, ptr %9, align 8, !tbaa !15
  %51 = tail call i32 @BN_mul(ptr noundef nonnull %46, ptr noundef %49, ptr noundef %50, ptr noundef nonnull %43) #2
  %.not56 = icmp eq i32 %51, 0
  br i1 %.not56, label %72, label %52

52:                                               ; preds = %48
  %53 = load ptr, ptr %21, align 8, !tbaa !18
  %54 = tail call i32 @BN_cmp(ptr noundef %53, ptr noundef nonnull %46) #2
  %.not57 = icmp eq i32 %54, 0
  br i1 %.not57, label %55, label %.sink.split

55:                                               ; preds = %52
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = load ptr, ptr %13, align 8, !tbaa !16
  %58 = tail call i32 @ossl_rsa_check_prime_factor(ptr noundef %56, ptr noundef %57, i32 noundef %3, ptr noundef nonnull %43)
  %.not58 = icmp eq i32 %58, 0
  br i1 %.not58, label %.sink.split, label %59

59:                                               ; preds = %55
  %60 = load ptr, ptr %9, align 8, !tbaa !15
  %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 %43)
  %.not59 = icmp eq i32 %62, 0
  br i1 %.not59, label %.sink.split, label %63

63:                                               ; preds = %59
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = load ptr, ptr %9, align 8, !tbaa !15
  %66 = tail call i32 @ossl_rsa_check_pminusq_diff(ptr noundef nonnull %46, ptr noundef %64, ptr noundef %65, i32 noundef %3)
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %68, label %.sink.split

68:                                               ; preds = %63
  %69 = tail call i32 @ossl_rsa_check_private_exponent(ptr noundef nonnull %0, i32 noundef %3, ptr noundef nonnull %43)
  %.not60 = icmp eq i32 %69, 0
  br i1 %.not60, label %.sink.split, label %70

70:                                               ; preds = %68
  %71 = tail call i32 @ossl_rsa_check_crt_components(ptr noundef nonnull %0, ptr noundef nonnull %43)
  %.not62 = icmp eq i32 %71, 0
  br i1 %.not62, label %.sink.split, label %72

.sink.split:                                      ; preds = %70, %55, %59, %63, %68, %52
  %.sink63 = phi i32 [ 417, %52 ], [ 430, %68 ], [ 430, %63 ], [ 430, %59 ], [ 430, %55 ], [ 430, %70 ]
  %.sink = phi i32 [ 175, %52 ], [ 171, %68 ], [ 171, %63 ], [ 171, %59 ], [ 171, %55 ], [ 171, %70 ]
  tail call void @ERR_new() #2
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef %.sink63, 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 %72

72:                                               ; preds = %.sink.split, %70, %45, %48
  %.0 = phi i32 [ 0, %45 ], [ 1, %70 ], [ 0, %48 ], [ 0, %.sink.split ]
  tail call void @BN_clear(ptr noundef %46) #2
  tail call void @BN_CTX_end(ptr noundef nonnull %43) #2
  tail call void @BN_CTX_free(ptr noundef nonnull %43) #2
  br label %73

73:                                               ; preds = %40, %25, %72, %39, %35, %31, %24
  %.046 = phi i32 [ 0, %24 ], [ 0, %31 ], [ 0, %39 ], [ %.0, %72 ], [ 0, %35 ], [ 0, %25 ], [ 0, %40 ]
  ret i32 %.046
}

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