; LLVM IR from PacktPublishing/Demystifying-Cryptography-with-OpenSSL-3 :: Chapter10 (tls-client2)

; 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"

@.str.21 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [50 x i8], align 1

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @load_client_certificate(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store ptr null, ptr %14, align 8, !tbaa !5
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = call ptr @BIO_new_file(ptr noundef %16, ptr noundef @.str.21)
  store ptr %17, ptr %10, align 8, !tbaa !5
  %18 = load ptr, ptr %10, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %28, label %20

20:                                               ; preds = %4
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %27

23:                                               ; preds = %20
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef @.str.22, ptr noundef %25) #6
  br label %27

27:                                               ; preds = %23, %20
  br label %101

28:                                               ; preds = %4
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  %30 = call ptr @d2i_PKCS12_bio(ptr noundef %29, ptr noundef null)
  store ptr %30, ptr %11, align 8, !tbaa !5
  %31 = load ptr, ptr %11, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %41, label %33

33:                                               ; preds = %28
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %40

36:                                               ; preds = %33
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str.23, ptr noundef %38) #6
  br label %40

40:                                               ; preds = %36, %33
  br label %101

41:                                               ; preds = %28
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = call i64 @strlen(ptr noundef %44) #7
  %46 = trunc i64 %45 to i32
  %47 = call i32 @PKCS12_verify_mac(ptr noundef %42, ptr noundef %43, i32 noundef %46)
  store i32 %47, ptr %15, align 4, !tbaa !9
  %48 = load i32, ptr %15, align 4, !tbaa !9
  %49 = icmp ne i32 %48, 1
  br i1 %49, label %50, label %58

50:                                               ; preds = %41
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = icmp ne ptr %51, null
  br i1 %52, label %53, label %57

53:                                               ; preds = %50
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef @.str.24, ptr noundef %55) #6
  br label %57

57:                                               ; preds = %53, %50
  br label %101

58:                                               ; preds = %41
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = call i32 @PKCS12_parse(ptr noundef %59, ptr noundef %60, ptr noundef %12, ptr noundef %13, ptr noundef %14)
  store i32 %61, ptr %15, align 4, !tbaa !9
  %62 = load i32, ptr %15, align 4, !tbaa !9
  %63 = icmp ne i32 %62, 1
  br i1 %63, label %64, label %72

64:                                               ; preds = %58
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = icmp ne ptr %65, null
  br i1 %66, label %67, label %71

67:                                               ; preds = %64
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef @.str.25, ptr noundef %69) #6
  br label %71

71:                                               ; preds = %67, %64
  br label %101

72:                                               ; preds = %58
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = load ptr, ptr %13, align 8, !tbaa !5
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = load ptr, ptr %14, align 8, !tbaa !5
  %77 = call i32 @SSL_CTX_use_cert_and_key(ptr noundef %73, ptr noundef %74, ptr noundef %75, ptr noundef %76, i32 noundef 1)
  store i32 %77, ptr %15, align 4, !tbaa !9
  %78 = load i32, ptr %15, align 4, !tbaa !9
  %79 = icmp ne i32 %78, 1
  br i1 %79, label %80, label %88

80:                                               ; preds = %72
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = icmp ne ptr %81, null
  br i1 %82, label %83, label %87

83:                                               ; preds = %80
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef @.str.26, ptr noundef %85) #6
  br label %87

87:                                               ; preds = %83, %80
  br label %101

88:                                               ; preds = %72
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = call i32 @SSL_CTX_check_private_key(ptr noundef %89)
  store i32 %90, ptr %15, align 4, !tbaa !9
  %91 = load i32, ptr %15, align 4, !tbaa !9
  %92 = icmp ne i32 %91, 1
  br i1 %92, label %93, label %100

93:                                               ; preds = %88
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = icmp ne ptr %94, null
  br i1 %95, label %96, label %99

96:                                               ; preds = %93
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef @.str.27) #6
  br label %99

99:                                               ; preds = %96, %93
  br label %101

100:                                              ; preds = %88
  br label %102

101:                                              ; preds = %99, %87, %71, %57, %40, %27
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %102

102:                                              ; preds = %101, %100
  %103 = load ptr, ptr %14, align 8, !tbaa !5
  %104 = icmp ne ptr %103, null
  br i1 %104, label %105, label %109

105:                                              ; preds = %102
  %106 = load ptr, ptr %14, align 8, !tbaa !5
  %107 = call ptr @ossl_check_X509_sk_type(ptr noundef %106)
  %108 = call ptr @ossl_check_X509_freefunc_type(ptr noundef @X509_free)
  call void @OPENSSL_sk_pop_free(ptr noundef %107, ptr noundef %108)
  br label %109

109:                                              ; preds = %105, %102
  %110 = load ptr, ptr %13, align 8, !tbaa !5
  %111 = icmp ne ptr %110, null
  br i1 %111, label %112, label %114

112:                                              ; preds = %109
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  call void @X509_free(ptr noundef %113)
  br label %114

114:                                              ; preds = %112, %109
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  %116 = icmp ne ptr %115, null
  br i1 %116, label %117, label %119

117:                                              ; preds = %114
  %118 = load ptr, ptr %12, align 8, !tbaa !5
  call void @EVP_PKEY_free(ptr noundef %118)
  br label %119

119:                                              ; preds = %117, %114
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = icmp ne ptr %120, null
  br i1 %121, label %122, label %124

122:                                              ; preds = %119
  %123 = load ptr, ptr %11, align 8, !tbaa !5
  call void @PKCS12_free(ptr noundef %123)
  br label %124

124:                                              ; preds = %122, %119
  %125 = load ptr, ptr %10, align 8, !tbaa !5
  %126 = icmp ne ptr %125, null
  br i1 %126, label %127, label %130

127:                                              ; preds = %124
  %128 = load ptr, ptr %10, align 8, !tbaa !5
  %129 = call i32 @BIO_free(ptr noundef %128)
  br label %130

130:                                              ; preds = %127, %124
  %131 = load i32, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret i32 %131
}

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

declare ptr @BIO_new_file(ptr noundef, ptr noundef) #4

declare ptr @d2i_PKCS12_bio(ptr noundef, ptr noundef) #4

declare i32 @PKCS12_verify_mac(ptr noundef, ptr noundef, i32 noundef) #4

declare i32 @PKCS12_parse(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare i32 @SSL_CTX_use_cert_and_key(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #4

declare i32 @SSL_CTX_check_private_key(ptr noundef) #4

declare void @OPENSSL_sk_pop_free(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ossl_check_X509_sk_type(ptr noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ossl_check_X509_freefunc_type(ptr noundef) #5

declare void @X509_free(ptr noundef) #4

declare void @EVP_PKEY_free(ptr noundef) #4

declare void @PKCS12_free(ptr noundef) #4

declare i32 @BIO_free(ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}


; 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.21 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [50 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @load_client_certificate(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  store ptr null, ptr %7, align 8, !tbaa !5
  %8 = tail call ptr @BIO_new_file(ptr noundef %0, ptr noundef nonnull @.str.21) #6
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %9, label %12

9:                                                ; preds = %4
  %.not46 = icmp eq ptr %3, null
  br i1 %.not46, label %.thread, label %10

10:                                               ; preds = %9
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.22, ptr noundef %0) #6
  br label %42

12:                                               ; preds = %4
  %13 = tail call ptr @d2i_PKCS12_bio(ptr noundef nonnull %8, ptr noundef null) #6
  %.not47 = icmp eq ptr %13, null
  br i1 %.not47, label %14, label %17

14:                                               ; preds = %12
  %.not48 = icmp eq ptr %3, null
  br i1 %.not48, label %42, label %15

15:                                               ; preds = %14
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.23, ptr noundef %0) #6
  br label %42

17:                                               ; preds = %12
  %18 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #7
  %19 = trunc i64 %18 to i32
  %20 = tail call i32 @PKCS12_verify_mac(ptr noundef nonnull %13, ptr noundef %1, i32 noundef %19) #6
  %.not49 = icmp eq i32 %20, 1
  br i1 %.not49, label %24, label %21

21:                                               ; preds = %17
  %.not56 = icmp eq ptr %3, null
  br i1 %.not56, label %42, label %22

22:                                               ; preds = %21
  %23 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.24, ptr noundef %0) #6
  br label %42

24:                                               ; preds = %17
  %25 = call i32 @PKCS12_parse(ptr noundef nonnull %13, ptr noundef %1, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7) #6
  %.not50 = icmp eq i32 %25, 1
  br i1 %.not50, label %29, label %26

26:                                               ; preds = %24
  %.not55 = icmp eq ptr %3, null
  br i1 %.not55, label %42, label %27

27:                                               ; preds = %26
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.25, ptr noundef %0) #6
  br label %42

29:                                               ; preds = %24
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = call i32 @SSL_CTX_use_cert_and_key(ptr noundef %2, ptr noundef %30, ptr noundef %31, ptr noundef %32, i32 noundef 1) #6
  %.not51 = icmp eq i32 %33, 1
  br i1 %.not51, label %37, label %34

34:                                               ; preds = %29
  %.not54 = icmp eq ptr %3, null
  br i1 %.not54, label %42, label %35

35:                                               ; preds = %34
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.26, ptr noundef %0) #6
  br label %42

37:                                               ; preds = %29
  %38 = call i32 @SSL_CTX_check_private_key(ptr noundef %2) #6
  %.not52 = icmp eq i32 %38, 1
  br i1 %.not52, label %42, label %39

39:                                               ; preds = %37
  %.not53 = icmp eq ptr %3, null
  br i1 %.not53, label %42, label %40

40:                                               ; preds = %39
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.27) #6
  br label %42

42:                                               ; preds = %10, %15, %14, %22, %21, %27, %26, %35, %34, %40, %39, %37
  %.036.ph = phi i32 [ 1, %10 ], [ 1, %15 ], [ 1, %14 ], [ 1, %22 ], [ 1, %21 ], [ 1, %27 ], [ 1, %26 ], [ 1, %35 ], [ 1, %34 ], [ 1, %40 ], [ 1, %39 ], [ 0, %37 ]
  %.1.ph = phi ptr [ null, %10 ], [ null, %15 ], [ null, %14 ], [ %13, %22 ], [ %13, %21 ], [ %13, %27 ], [ %13, %26 ], [ %13, %35 ], [ %13, %34 ], [ %13, %40 ], [ %13, %39 ], [ %13, %37 ]
  %.pr = load ptr, ptr %7, align 8, !tbaa !5
  %.not57 = icmp eq ptr %.pr, null
  br i1 %.not57, label %.thread, label %43

43:                                               ; preds = %42
  %44 = call ptr @ossl_check_X509_sk_type(ptr noundef nonnull %.pr)
  %45 = call ptr @ossl_check_X509_freefunc_type(ptr noundef nonnull @X509_free)
  call void @OPENSSL_sk_pop_free(ptr noundef %44, ptr noundef %45) #6
  br label %.thread

.thread:                                          ; preds = %9, %43, %42
  %.165 = phi ptr [ %.1.ph, %43 ], [ %.1.ph, %42 ], [ null, %9 ]
  %.03664 = phi i32 [ %.036.ph, %43 ], [ %.036.ph, %42 ], [ 1, %9 ]
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %.not58 = icmp eq ptr %46, null
  br i1 %.not58, label %48, label %47

47:                                               ; preds = %.thread
  call void @X509_free(ptr noundef nonnull %46) #6
  br label %48

48:                                               ; preds = %47, %.thread
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %.not59 = icmp eq ptr %49, null
  br i1 %.not59, label %51, label %50

50:                                               ; preds = %48
  call void @EVP_PKEY_free(ptr noundef nonnull %49) #6
  br label %51

51:                                               ; preds = %50, %48
  %.not60 = icmp eq ptr %.165, null
  br i1 %.not60, label %53, label %52

52:                                               ; preds = %51
  call void @PKCS12_free(ptr noundef nonnull %.165) #6
  br label %53

53:                                               ; preds = %52, %51
  br i1 %.not, label %56, label %54

54:                                               ; preds = %53
  %55 = call i32 @BIO_free(ptr noundef nonnull %8) #6
  br label %56

56:                                               ; preds = %54, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  ret i32 %.03664
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

declare ptr @BIO_new_file(ptr noundef, ptr noundef) local_unnamed_addr #4

declare ptr @d2i_PKCS12_bio(ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @PKCS12_verify_mac(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare i32 @PKCS12_parse(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @SSL_CTX_use_cert_and_key(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare i32 @SSL_CTX_check_private_key(ptr noundef) local_unnamed_addr #4

declare void @OPENSSL_sk_pop_free(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ossl_check_X509_sk_type(ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ossl_check_X509_freefunc_type(ptr noundef) local_unnamed_addr #5

declare void @X509_free(ptr noundef) #4

declare void @EVP_PKEY_free(ptr noundef) local_unnamed_addr #4

declare void @PKCS12_free(ptr noundef) local_unnamed_addr #4

declare i32 @BIO_free(ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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