; LLVM IR from PacktPublishing/Demystifying-Cryptography-with-OpenSSL-3 :: Chapter08 (x509-verify)

; 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.6 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [38 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: nounwind uwtable
define dso_local i32 @verify(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @ERR_clear_error()
  %21 = call ptr @X509_STORE_new()
  store ptr %21, ptr %13, align 8, !tbaa !5
  %22 = load ptr, ptr %13, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = call i32 @X509_STORE_load_file(ptr noundef %22, ptr noundef %23)
  store i32 %24, ptr %11, align 4, !tbaa !9
  %25 = load i32, ptr %11, align 4, !tbaa !9
  %26 = icmp ne i32 %25, 1
  br i1 %26, label %27, label %34

27:                                               ; preds = %4
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %33

30:                                               ; preds = %27
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str.6) #5
  br label %33

33:                                               ; preds = %30, %27
  br label %120

34:                                               ; preds = %4
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = call i32 @fseek(ptr noundef %35, i64 noundef 0, i32 noundef 2)
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = call i64 @ftell(ptr noundef %37)
  store i64 %38, ptr %16, align 8, !tbaa !11
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = call i32 @fseek(ptr noundef %39, i64 noundef 0, i32 noundef 0)
  %41 = call ptr @OPENSSL_sk_new_null()
  store ptr %41, ptr %14, align 8, !tbaa !5
  br label %42

42:                                               ; preds = %67, %34
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = call i64 @ftell(ptr noundef %43)
  %45 = load i64, ptr %16, align 8, !tbaa !11
  %46 = icmp slt i64 %44, %45
  br i1 %46, label %47, label %68

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = call ptr @PEM_read_X509(ptr noundef %48, ptr noundef null, ptr noundef null, ptr noundef null)
  store ptr %49, ptr %17, align 8, !tbaa !5
  %50 = load i32, ptr %11, align 4, !tbaa !9
  %51 = icmp ne i32 %50, 1
  br i1 %51, label %52, label %59

52:                                               ; preds = %47
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %58

55:                                               ; preds = %52
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef @.str.7) #5
  br label %58

58:                                               ; preds = %55, %52
  store i32 2, ptr %18, align 4
  br label %65

59:                                               ; preds = %47
  %60 = load ptr, ptr %14, align 8, !tbaa !5
  %61 = call ptr @ossl_check_X509_sk_type(ptr noundef %60)
  %62 = load ptr, ptr %17, align 8, !tbaa !5
  %63 = call ptr @ossl_check_X509_type(ptr noundef %62)
  %64 = call i32 @OPENSSL_sk_push(ptr noundef %61, ptr noundef %63)
  store i32 0, ptr %18, align 4
  br label %65

65:                                               ; preds = %59, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  %66 = load i32, ptr %18, align 4
  switch i32 %66, label %140 [
    i32 0, label %67
    i32 2, label %120
  ]

67:                                               ; preds = %65
  br label %42, !llvm.loop !13

68:                                               ; preds = %42
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = call ptr @PEM_read_X509(ptr noundef %69, ptr noundef null, ptr noundef null, ptr noundef null)
  store ptr %70, ptr %15, align 8, !tbaa !5
  %71 = load i32, ptr %11, align 4, !tbaa !9
  %72 = icmp ne i32 %71, 1
  br i1 %72, label %73, label %80

73:                                               ; preds = %68
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = icmp ne ptr %74, null
  br i1 %75, label %76, label %79

76:                                               ; preds = %73
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef @.str.8) #5
  br label %79

79:                                               ; preds = %76, %73
  br label %120

80:                                               ; preds = %68
  %81 = call ptr @X509_STORE_CTX_new()
  store ptr %81, ptr %12, align 8, !tbaa !5
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = load ptr, ptr %15, align 8, !tbaa !5
  %85 = load ptr, ptr %14, align 8, !tbaa !5
  %86 = call i32 @X509_STORE_CTX_init(ptr noundef %82, ptr noundef %83, ptr noundef %84, ptr noundef %85)
  store i32 %86, ptr %11, align 4, !tbaa !9
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = call i32 @X509_verify_cert(ptr noundef %87)
  store i32 %88, ptr %11, align 4, !tbaa !9
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = call i32 @ferror(ptr noundef %89) #5
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %96, label %92

92:                                               ; preds = %80
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = call i32 @ferror(ptr noundef %93) #5
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %96, label %103

96:                                               ; preds = %92, %80
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = icmp ne ptr %97, null
  br i1 %98, label %99, label %102

99:                                               ; preds = %96
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef @.str.9) #5
  br label %102

102:                                              ; preds = %99, %96
  br label %120

103:                                              ; preds = %92
  %104 = load i32, ptr %11, align 4, !tbaa !9
  %105 = icmp ne i32 %104, 1
  br i1 %105, label %106, label %119

106:                                              ; preds = %103
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = icmp ne ptr %107, null
  br i1 %108, label %109, label %118

109:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %110 = load ptr, ptr %12, align 8, !tbaa !5
  %111 = call i32 @X509_STORE_CTX_get_error(ptr noundef %110)
  store i32 %111, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %112 = load i32, ptr %19, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = call ptr @X509_verify_cert_error_string(i64 noundef %113)
  store ptr %114, ptr %20, align 8, !tbaa !5
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = load ptr, ptr %20, align 8, !tbaa !5
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef @.str.10, ptr noundef %116) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %118

118:                                              ; preds = %109, %106
  br label %120

119:                                              ; preds = %103
  br label %121

120:                                              ; preds = %118, %102, %79, %65, %33
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %120, %119
  %122 = load ptr, ptr %12, align 8, !tbaa !5
  call void @X509_STORE_CTX_free(ptr noundef %122)
  %123 = load ptr, ptr %15, align 8, !tbaa !5
  call void @X509_free(ptr noundef %123)
  %124 = load ptr, ptr %14, align 8, !tbaa !5
  %125 = call ptr @ossl_check_X509_sk_type(ptr noundef %124)
  %126 = call ptr @ossl_check_X509_freefunc_type(ptr noundef @X509_free)
  call void @OPENSSL_sk_pop_free(ptr noundef %125, ptr noundef %126)
  %127 = load ptr, ptr %13, align 8, !tbaa !5
  call void @X509_STORE_free(ptr noundef %127)
  %128 = call i64 @ERR_peek_error()
  %129 = icmp ne i64 %128, 0
  br i1 %129, label %130, label %138

130:                                              ; preds = %121
  store i32 1, ptr %10, align 4, !tbaa !9
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  %132 = icmp ne ptr %131, null
  br i1 %132, label %133, label %137

133:                                              ; preds = %130
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef @.str.11) #5
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %136)
  br label %137

137:                                              ; preds = %133, %130
  call void @ERR_clear_error()
  br label %138

138:                                              ; preds = %137, %121
  %139 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %139, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %140

140:                                              ; preds = %138, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %141 = load i32, ptr %5, align 4
  ret i32 %141
}

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

declare void @ERR_clear_error() #3

declare ptr @X509_STORE_new() #3

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

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

declare i64 @ftell(ptr noundef) #3

declare ptr @OPENSSL_sk_new_null() #3

declare ptr @PEM_read_X509(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ossl_check_X509_type(ptr noundef) #4

declare ptr @X509_STORE_CTX_new() #3

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

declare i32 @X509_verify_cert(ptr noundef) #3

; Function Attrs: nounwind
declare i32 @ferror(ptr noundef) #1

declare i32 @X509_STORE_CTX_get_error(ptr noundef) #3

declare ptr @X509_verify_cert_error_string(i64 noundef) #3

declare void @X509_STORE_CTX_free(ptr noundef) #3

declare void @X509_free(ptr noundef) #3

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

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

declare void @X509_STORE_free(ptr noundef) #3

declare i64 @ERR_peek_error() #3

declare void @ERR_print_errors_fp(ptr noundef) #3

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 = { "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 = { 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 #5 = { 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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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"

@.str.6 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [38 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @verify(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #1 {
  tail call void @ERR_clear_error() #5
  %5 = tail call ptr @X509_STORE_new() #5
  %6 = tail call i32 @X509_STORE_load_file(ptr noundef %5, ptr noundef %0) #5
  %.not = icmp eq i32 %6, 1
  br i1 %.not, label %10, label %7

7:                                                ; preds = %4
  %.not59 = icmp eq ptr %3, null
  br i1 %.not59, label %40, label %8

8:                                                ; preds = %7
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.6) #5
  br label %40

10:                                               ; preds = %4
  %11 = tail call i32 @fseek(ptr noundef %1, i64 noundef 0, i32 noundef 2)
  %12 = tail call i64 @ftell(ptr noundef %1)
  %13 = tail call i32 @fseek(ptr noundef %1, i64 noundef 0, i32 noundef 0)
  %14 = tail call ptr @OPENSSL_sk_new_null() #5
  %15 = tail call i64 @ftell(ptr noundef %1)
  %16 = icmp slt i64 %15, %12
  br i1 %16, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %10, %.lr.ph
  %17 = tail call ptr @PEM_read_X509(ptr noundef %1, ptr noundef null, ptr noundef null, ptr noundef null) #5
  %18 = tail call ptr @ossl_check_X509_sk_type(ptr noundef %14)
  %19 = tail call ptr @ossl_check_X509_type(ptr noundef %17)
  %20 = tail call i32 @OPENSSL_sk_push(ptr noundef %18, ptr noundef %19) #5
  %21 = tail call i64 @ftell(ptr noundef %1)
  %22 = icmp slt i64 %21, %12
  br i1 %22, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %10
  %23 = tail call ptr @PEM_read_X509(ptr noundef %2, ptr noundef null, ptr noundef null, ptr noundef null) #5
  %24 = tail call ptr @X509_STORE_CTX_new() #5
  %25 = tail call i32 @X509_STORE_CTX_init(ptr noundef %24, ptr noundef %5, ptr noundef %23, ptr noundef %14) #5
  %26 = tail call i32 @X509_verify_cert(ptr noundef %24) #5
  %27 = tail call i32 @ferror(ptr noundef %1) #5
  %.not54 = icmp eq i32 %27, 0
  br i1 %.not54, label %28, label %30

28:                                               ; preds = %._crit_edge
  %29 = tail call i32 @ferror(ptr noundef %2) #5
  %.not55 = icmp eq i32 %29, 0
  br i1 %.not55, label %33, label %30

30:                                               ; preds = %28, %._crit_edge
  %.not58 = icmp eq ptr %3, null
  br i1 %.not58, label %40, label %31

31:                                               ; preds = %30
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.9) #5
  br label %40

33:                                               ; preds = %28
  %.not56 = icmp eq i32 %26, 1
  br i1 %.not56, label %40, label %34

34:                                               ; preds = %33
  %.not57 = icmp eq ptr %3, null
  br i1 %.not57, label %40, label %35

35:                                               ; preds = %34
  %36 = tail call i32 @X509_STORE_CTX_get_error(ptr noundef %24) #5
  %37 = sext i32 %36 to i64
  %38 = tail call ptr @X509_verify_cert_error_string(i64 noundef %37) #5
  %39 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.10, ptr noundef %38) #5
  br label %40

40:                                               ; preds = %8, %7, %31, %30, %35, %34, %33
  %.151 = phi ptr [ %14, %33 ], [ null, %8 ], [ null, %7 ], [ %14, %31 ], [ %14, %30 ], [ %14, %35 ], [ %14, %34 ]
  %.149 = phi ptr [ %23, %33 ], [ null, %8 ], [ null, %7 ], [ %23, %31 ], [ %23, %30 ], [ %23, %35 ], [ %23, %34 ]
  %.147 = phi ptr [ %24, %33 ], [ null, %8 ], [ null, %7 ], [ %24, %31 ], [ %24, %30 ], [ %24, %35 ], [ %24, %34 ]
  %.044 = phi i32 [ 0, %33 ], [ 1, %8 ], [ 1, %7 ], [ 1, %31 ], [ 1, %30 ], [ 1, %35 ], [ 1, %34 ]
  tail call void @X509_STORE_CTX_free(ptr noundef %.147) #5
  tail call void @X509_free(ptr noundef %.149) #5
  %41 = tail call ptr @ossl_check_X509_sk_type(ptr noundef %.151)
  %42 = tail call ptr @ossl_check_X509_freefunc_type(ptr noundef nonnull @X509_free)
  tail call void @OPENSSL_sk_pop_free(ptr noundef %41, ptr noundef %42) #5
  tail call void @X509_STORE_free(ptr noundef %5) #5
  %43 = tail call i64 @ERR_peek_error() #5
  %.not60 = icmp eq i64 %43, 0
  br i1 %.not60, label %48, label %44

44:                                               ; preds = %40
  %.not61 = icmp eq ptr %3, null
  br i1 %.not61, label %47, label %45

45:                                               ; preds = %44
  %46 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.11) #5
  tail call void @ERR_print_errors_fp(ptr noundef nonnull %3) #5
  br label %47

47:                                               ; preds = %45, %44
  tail call void @ERR_clear_error() #5
  br label %48

48:                                               ; preds = %40, %47
  %.1 = phi i32 [ 1, %47 ], [ %.044, %40 ]
  ret i32 %.1
}

declare void @ERR_clear_error() local_unnamed_addr #2

declare ptr @X509_STORE_new() local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i32 @fseek(ptr nocapture noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i64 @ftell(ptr nocapture noundef) local_unnamed_addr #0

declare ptr @OPENSSL_sk_new_null() local_unnamed_addr #2

declare ptr @PEM_read_X509(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

declare ptr @X509_STORE_CTX_new() local_unnamed_addr #2

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

declare i32 @X509_verify_cert(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind memory(read)
declare noundef i32 @ferror(ptr nocapture noundef) local_unnamed_addr #4

declare i32 @X509_STORE_CTX_get_error(ptr noundef) local_unnamed_addr #2

declare ptr @X509_verify_cert_error_string(i64 noundef) local_unnamed_addr #2

declare void @X509_STORE_CTX_free(ptr noundef) local_unnamed_addr #2

declare void @X509_free(ptr noundef) #2

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

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

declare void @X509_STORE_free(ptr noundef) local_unnamed_addr #2

declare i64 @ERR_peek_error() local_unnamed_addr #2

declare void @ERR_print_errors_fp(ptr noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { 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 #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 = { 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 #4 = { nofree nounwind 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 #5 = { 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)"}


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