; LLVM IR from PacktPublishing/Demystifying-Cryptography-with-OpenSSL-3 :: Chapter10 (crl-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"

@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [112 x i8], align 1
@__PRETTY_FUNCTION__.run_tls_client = external hidden unnamed_addr constant [69 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.13 = 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 @run_tls_client(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 i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  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 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !9
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 16384, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %18 = call noalias ptr @malloc(i64 noundef 16384) #7
  store ptr %18, ptr %16, align 8, !tbaa !5
  %19 = load ptr, ptr %16, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %4
  br label %23

22:                                               ; preds = %4
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 56, ptr noundef @__PRETTY_FUNCTION__.run_tls_client) #8
  unreachable

23:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %24 = call noalias ptr @malloc(i64 noundef 16384) #7
  store ptr %24, ptr %17, align 8, !tbaa !5
  %25 = load ptr, ptr %17, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %28

27:                                               ; preds = %23
  br label %29

28:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.4, i32 noundef 58, ptr noundef @__PRETTY_FUNCTION__.run_tls_client) #8
  unreachable

29:                                               ; preds = %27
  call void @ERR_clear_error()
  %30 = call ptr @TLS_client_method()
  %31 = call ptr @SSL_CTX_new(ptr noundef %30)
  store ptr %31, ptr %11, align 8, !tbaa !5
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %35

34:                                               ; preds = %29
  br label %36

35:                                               ; preds = %29
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.4, i32 noundef 63, ptr noundef @__PRETTY_FUNCTION__.run_tls_client) #8
  unreachable

36:                                               ; preds = %34
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %43

39:                                               ; preds = %36
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = call i32 @SSL_CTX_load_verify_locations(ptr noundef %40, ptr noundef %41, ptr noundef null)
  store i32 %42, ptr %10, align 4, !tbaa !9
  br label %46

43:                                               ; preds = %36
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = call i32 @SSL_CTX_set_default_verify_paths(ptr noundef %44)
  store i32 %45, ptr %10, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %43, %39
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = icmp sle i32 %47, 0
  br i1 %48, label %49, label %56

49:                                               ; preds = %46
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %55

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

55:                                               ; preds = %52, %49
  br label %132

56:                                               ; preds = %46
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  call void @SSL_CTX_set_verify(ptr noundef %57, i32 noundef 1, ptr noundef @verify_callback)
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = call i64 @SSL_CTX_ctrl(ptr noundef %58, i32 noundef 33, i64 noundef 4, ptr noundef null)
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = call ptr @SSL_CTX_get_cert_store(ptr noundef %60)
  store ptr %61, ptr %12, align 8, !tbaa !5
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %65

64:                                               ; preds = %56
  br label %66

65:                                               ; preds = %56
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.4, i32 noundef 80, ptr noundef @__PRETTY_FUNCTION__.run_tls_client) #8
  unreachable

66:                                               ; preds = %64
  %67 = load ptr, ptr %12, align 8, !tbaa !5
  call void @X509_STORE_set_lookup_crls(ptr noundef %67, ptr noundef @lookup_crls)
  %68 = load ptr, ptr %12, align 8, !tbaa !5
  %69 = call i32 @X509_STORE_set_flags(ptr noundef %68, i64 noundef 4)
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = call ptr @BIO_new_ssl_connect(ptr noundef %70)
  store ptr %71, ptr %13, align 8, !tbaa !5
  %72 = load ptr, ptr %13, align 8, !tbaa !5
  %73 = icmp ne ptr %72, null
  br i1 %73, label %74, label %75

74:                                               ; preds = %66
  br label %76

75:                                               ; preds = %66
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.4, i32 noundef 88, ptr noundef @__PRETTY_FUNCTION__.run_tls_client) #8
  unreachable

76:                                               ; preds = %74
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = call i64 @BIO_ctrl(ptr noundef %77, i32 noundef 100, i64 noundef 0, ptr noundef %78)
  %80 = load ptr, ptr %13, align 8, !tbaa !5
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = call i64 @BIO_ctrl(ptr noundef %80, i32 noundef 100, i64 noundef 1, ptr noundef %81)
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = call i64 @BIO_ctrl(ptr noundef %83, i32 noundef 110, i64 noundef 0, ptr noundef %14)
  %85 = trunc i64 %84 to i32
  store i32 %85, ptr %10, align 4, !tbaa !9
  %86 = load i32, ptr %10, align 4, !tbaa !9
  %87 = icmp eq i32 %86, 1
  br i1 %87, label %88, label %89

88:                                               ; preds = %76
  br label %90

89:                                               ; preds = %76
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.4, i32 noundef 96, ptr noundef @__PRETTY_FUNCTION__.run_tls_client) #8
  unreachable

90:                                               ; preds = %88
  %91 = load ptr, ptr %14, align 8, !tbaa !5
  %92 = icmp ne ptr %91, null
  br i1 %92, label %93, label %94

93:                                               ; preds = %90
  br label %95

94:                                               ; preds = %90
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.4, i32 noundef 97, ptr noundef @__PRETTY_FUNCTION__.run_tls_client) #8
  unreachable

95:                                               ; preds = %93
  %96 = load ptr, ptr %14, align 8, !tbaa !5
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = call i64 @SSL_ctrl(ptr noundef %96, i32 noundef 55, i64 noundef 0, ptr noundef %97)
  %99 = trunc i64 %98 to i32
  store i32 %99, ptr %10, align 4, !tbaa !9
  %100 = load i32, ptr %10, align 4, !tbaa !9
  %101 = icmp eq i32 %100, 1
  br i1 %101, label %102, label %103

102:                                              ; preds = %95
  br label %104

103:                                              ; preds = %95
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.4, i32 noundef 101, ptr noundef @__PRETTY_FUNCTION__.run_tls_client) #8
  unreachable

104:                                              ; preds = %102
  %105 = load ptr, ptr %14, align 8, !tbaa !5
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = call i32 @SSL_set1_host(ptr noundef %105, ptr noundef %106)
  store i32 %107, ptr %10, align 4, !tbaa !9
  %108 = load i32, ptr %10, align 4, !tbaa !9
  %109 = icmp eq i32 %108, 1
  br i1 %109, label %110, label %111

110:                                              ; preds = %104
  br label %112

111:                                              ; preds = %104
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.4, i32 noundef 105, ptr noundef @__PRETTY_FUNCTION__.run_tls_client) #8
  unreachable

112:                                              ; preds = %110
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  %115 = call i32 @SSL_set_ex_data(ptr noundef %113, i32 noundef 0, ptr noundef %114)
  store i32 %115, ptr %10, align 4, !tbaa !9
  %116 = load ptr, ptr %13, align 8, !tbaa !5
  %117 = call i64 @BIO_ctrl(ptr noundef %116, i32 noundef 101, i64 noundef 0, ptr noundef null)
  %118 = trunc i64 %117 to i32
  store i32 %118, ptr %10, align 4, !tbaa !9
  %119 = load i32, ptr %10, align 4, !tbaa !9
  %120 = icmp sle i32 %119, 0
  br i1 %120, label %121, label %130

121:                                              ; preds = %112
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %129

124:                                              ; preds = %121
  %125 = load ptr, ptr %8, align 8, !tbaa !5
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %125, ptr noundef @.str.12, ptr noundef %126, ptr noundef %127) #6
  br label %129

129:                                              ; preds = %124, %121
  br label %132

130:                                              ; preds = %112
  %131 = load ptr, ptr %13, align 8, !tbaa !5
  call void @BIO_ssl_shutdown(ptr noundef %131)
  br label %133

132:                                              ; preds = %129, %55
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %132, %130
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = icmp ne ptr %134, null
  br i1 %135, label %136, label %138

136:                                              ; preds = %133
  %137 = load ptr, ptr %13, align 8, !tbaa !5
  call void @BIO_free_all(ptr noundef %137)
  br label %138

138:                                              ; preds = %136, %133
  %139 = load ptr, ptr %11, align 8, !tbaa !5
  %140 = icmp ne ptr %139, null
  br i1 %140, label %141, label %143

141:                                              ; preds = %138
  %142 = load ptr, ptr %11, align 8, !tbaa !5
  call void @SSL_CTX_free(ptr noundef %142)
  br label %143

143:                                              ; preds = %141, %138
  %144 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %144) #6
  %145 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %145) #6
  %146 = call i64 @ERR_peek_error()
  %147 = icmp ne i64 %146, 0
  br i1 %147, label %148, label %156

148:                                              ; preds = %143
  store i32 1, ptr %9, align 4, !tbaa !9
  %149 = load ptr, ptr %8, align 8, !tbaa !5
  %150 = icmp ne ptr %149, null
  br i1 %150, label %151, label %155

151:                                              ; preds = %148
  %152 = load ptr, ptr %8, align 8, !tbaa !5
  %153 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %152, ptr noundef @.str.13) #6
  %154 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %154)
  br label %155

155:                                              ; preds = %151, %148
  call void @ERR_clear_error()
  br label %156

156:                                              ; preds = %155, %143
  %157 = load i32, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  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 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret i32 %157
}

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

declare void @ERR_clear_error() #5

declare ptr @SSL_CTX_new(ptr noundef) #5

declare ptr @TLS_client_method() #5

declare i32 @SSL_CTX_load_verify_locations(ptr noundef, ptr noundef, ptr noundef) #5

declare i32 @SSL_CTX_set_default_verify_paths(ptr noundef) #5

declare void @SSL_CTX_set_verify(ptr noundef, i32 noundef, ptr noundef) #5

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

declare i64 @SSL_CTX_ctrl(ptr noundef, i32 noundef, i64 noundef, ptr noundef) #5

declare ptr @SSL_CTX_get_cert_store(ptr noundef) #5

declare void @X509_STORE_set_lookup_crls(ptr noundef, ptr noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local ptr @lookup_crls(ptr noundef, ptr noundef) #2

declare i32 @X509_STORE_set_flags(ptr noundef, i64 noundef) #5

declare ptr @BIO_new_ssl_connect(ptr noundef) #5

declare i64 @BIO_ctrl(ptr noundef, i32 noundef, i64 noundef, ptr noundef) #5

declare i64 @SSL_ctrl(ptr noundef, i32 noundef, i64 noundef, ptr noundef) #5

declare i32 @SSL_set1_host(ptr noundef, ptr noundef) #5

declare i32 @SSL_set_ex_data(ptr noundef, i32 noundef, ptr noundef) #5

declare void @BIO_ssl_shutdown(ptr noundef) #5

declare void @BIO_free_all(ptr noundef) #5

declare void @SSL_CTX_free(ptr noundef) #5

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

declare i64 @ERR_peek_error() #5

declare void @ERR_print_errors_fp(ptr noundef) #5

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 allocsize(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 = { noreturn 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 #5 = { "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 allocsize(0) }
attributes #8 = { noreturn 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}


; 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.4 = external hidden unnamed_addr constant [112 x i8], align 1
@__PRETTY_FUNCTION__.run_tls_client = external hidden unnamed_addr constant [69 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [38 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: nounwind uwtable
define dso_local range(i32 0, 2) i32 @run_tls_client(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #2 {
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store ptr null, ptr %5, align 8, !tbaa !5
  tail call void @ERR_clear_error() #5
  %6 = tail call ptr @TLS_client_method() #5
  %7 = tail call ptr @SSL_CTX_new(ptr noundef %6) #5
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %8, label %9

8:                                                ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.4, i32 noundef 63, ptr noundef nonnull @__PRETTY_FUNCTION__.run_tls_client) #6
  unreachable

9:                                                ; preds = %4
  %.not57 = icmp eq ptr %2, null
  br i1 %.not57, label %12, label %10

10:                                               ; preds = %9
  %11 = tail call i32 @SSL_CTX_load_verify_locations(ptr noundef nonnull %7, ptr noundef nonnull %2, ptr noundef null) #5
  br label %14

12:                                               ; preds = %9
  %13 = tail call i32 @SSL_CTX_set_default_verify_paths(ptr noundef nonnull %7) #5
  br label %14

14:                                               ; preds = %12, %10
  %.045 = phi i32 [ %11, %10 ], [ %13, %12 ]
  %15 = icmp slt i32 %.045, 1
  br i1 %15, label %16, label %19

16:                                               ; preds = %14
  %.not62 = icmp eq ptr %3, null
  br i1 %.not62, label %58, label %17

17:                                               ; preds = %16
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.7) #5
  br label %58

19:                                               ; preds = %14
  tail call void @SSL_CTX_set_verify(ptr noundef nonnull %7, i32 noundef 1, ptr noundef nonnull @verify_callback) #5
  %20 = tail call i64 @SSL_CTX_ctrl(ptr noundef nonnull %7, i32 noundef 33, i64 noundef 4, ptr noundef null) #5
  %21 = tail call ptr @SSL_CTX_get_cert_store(ptr noundef nonnull %7) #5
  %.not58 = icmp eq ptr %21, null
  br i1 %.not58, label %22, label %23

22:                                               ; preds = %19
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.4, i32 noundef 80, ptr noundef nonnull @__PRETTY_FUNCTION__.run_tls_client) #6
  unreachable

23:                                               ; preds = %19
  tail call void @X509_STORE_set_lookup_crls(ptr noundef nonnull %21, ptr noundef nonnull @lookup_crls) #5
  %24 = tail call i32 @X509_STORE_set_flags(ptr noundef nonnull %21, i64 noundef 4) #5
  %25 = tail call ptr @BIO_new_ssl_connect(ptr noundef nonnull %7) #5
  %.not59 = icmp eq ptr %25, null
  br i1 %.not59, label %26, label %27

26:                                               ; preds = %23
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.4, i32 noundef 88, ptr noundef nonnull @__PRETTY_FUNCTION__.run_tls_client) #6
  unreachable

27:                                               ; preds = %23
  %28 = tail call i64 @BIO_ctrl(ptr noundef nonnull %25, i32 noundef 100, i64 noundef 0, ptr noundef %0) #5
  %29 = tail call i64 @BIO_ctrl(ptr noundef nonnull %25, i32 noundef 100, i64 noundef 1, ptr noundef %1) #5
  %30 = call i64 @BIO_ctrl(ptr noundef nonnull %25, i32 noundef 110, i64 noundef 0, ptr noundef nonnull %5) #5
  %31 = and i64 %30, 4294967295
  %32 = icmp eq i64 %31, 1
  br i1 %32, label %34, label %33

33:                                               ; preds = %27
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.4, i32 noundef 96, ptr noundef nonnull @__PRETTY_FUNCTION__.run_tls_client) #6
  unreachable

34:                                               ; preds = %27
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %.not60 = icmp eq ptr %35, null
  br i1 %.not60, label %36, label %37

36:                                               ; preds = %34
  call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.4, i32 noundef 97, ptr noundef nonnull @__PRETTY_FUNCTION__.run_tls_client) #6
  unreachable

37:                                               ; preds = %34
  %38 = call i64 @SSL_ctrl(ptr noundef nonnull %35, i32 noundef 55, i64 noundef 0, ptr noundef %0) #5
  %39 = and i64 %38, 4294967295
  %40 = icmp eq i64 %39, 1
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.4, i32 noundef 101, ptr noundef nonnull @__PRETTY_FUNCTION__.run_tls_client) #6
  unreachable

42:                                               ; preds = %37
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = call i32 @SSL_set1_host(ptr noundef %43, ptr noundef %0) #5
  %45 = icmp eq i32 %44, 1
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.4, i32 noundef 105, ptr noundef nonnull @__PRETTY_FUNCTION__.run_tls_client) #6
  unreachable

47:                                               ; preds = %42
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = call i32 @SSL_set_ex_data(ptr noundef %48, i32 noundef 0, ptr noundef %3) #5
  %50 = call i64 @BIO_ctrl(ptr noundef nonnull %25, i32 noundef 101, i64 noundef 0, ptr noundef null) #5
  %51 = trunc i64 %50 to i32
  %52 = icmp slt i32 %51, 1
  br i1 %52, label %53, label %56

53:                                               ; preds = %47
  %.not61 = icmp eq ptr %3, null
  br i1 %.not61, label %57, label %54

54:                                               ; preds = %53
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.12, ptr noundef %0, ptr noundef %1) #5
  br label %57

56:                                               ; preds = %47
  call void @BIO_ssl_shutdown(ptr noundef nonnull %25) #5
  br label %57

57:                                               ; preds = %56, %54, %53
  %.0.ph = phi i32 [ 1, %54 ], [ 1, %53 ], [ 0, %56 ]
  call void @BIO_free_all(ptr noundef nonnull %25) #5
  br label %58

58:                                               ; preds = %16, %17, %57
  %.071 = phi i32 [ %.0.ph, %57 ], [ 1, %16 ], [ 1, %17 ]
  call void @SSL_CTX_free(ptr noundef nonnull %7) #5
  %59 = call i64 @ERR_peek_error() #5
  %.not64 = icmp eq i64 %59, 0
  br i1 %.not64, label %64, label %60

60:                                               ; preds = %58
  %.not65 = icmp eq ptr %3, null
  br i1 %.not65, label %63, label %61

61:                                               ; preds = %60
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.13) #5
  call void @ERR_print_errors_fp(ptr noundef nonnull %3) #5
  br label %63

63:                                               ; preds = %61, %60
  call void @ERR_clear_error() #5
  br label %64

64:                                               ; preds = %63, %58
  %.1 = phi i32 [ 1, %63 ], [ %.071, %58 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  ret i32 %.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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare void @ERR_clear_error() local_unnamed_addr #4

declare ptr @SSL_CTX_new(ptr noundef) local_unnamed_addr #4

declare ptr @TLS_client_method() local_unnamed_addr #4

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

declare i32 @SSL_CTX_set_default_verify_paths(ptr noundef) local_unnamed_addr #4

declare void @SSL_CTX_set_verify(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

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

declare i64 @SSL_CTX_ctrl(ptr noundef, i32 noundef, i64 noundef, ptr noundef) local_unnamed_addr #4

declare ptr @SSL_CTX_get_cert_store(ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @lookup_crls(ptr noundef, ptr noundef) #2

declare i32 @X509_STORE_set_flags(ptr noundef, i64 noundef) local_unnamed_addr #4

declare ptr @BIO_new_ssl_connect(ptr noundef) local_unnamed_addr #4

declare i64 @BIO_ctrl(ptr noundef, i32 noundef, i64 noundef, ptr noundef) local_unnamed_addr #4

declare i64 @SSL_ctrl(ptr noundef, i32 noundef, i64 noundef, ptr noundef) local_unnamed_addr #4

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

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

declare void @BIO_ssl_shutdown(ptr noundef) local_unnamed_addr #4

declare void @BIO_free_all(ptr noundef) local_unnamed_addr #4

declare void @SSL_CTX_free(ptr noundef) local_unnamed_addr #4

declare i64 @ERR_peek_error() local_unnamed_addr #4

declare void @ERR_print_errors_fp(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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 }
attributes #6 = { noreturn 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"}


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