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

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

20:                                               ; preds = %4
  br label %22

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

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

26:                                               ; preds = %22
  br label %28

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

28:                                               ; preds = %26
  call void @ERR_clear_error()
  %29 = call ptr @TLS_client_method()
  %30 = call ptr @SSL_CTX_new(ptr noundef %29)
  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 %33, label %34

33:                                               ; preds = %28
  br label %35

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

35:                                               ; preds = %33
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %42

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

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

45:                                               ; preds = %42, %38
  %46 = load i32, ptr %10, align 4, !tbaa !9
  %47 = icmp sle i32 %46, 0
  br i1 %47, label %48, label %55

48:                                               ; preds = %45
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %54

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

54:                                               ; preds = %51, %48
  br label %121

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

63:                                               ; preds = %55
  br label %65

64:                                               ; preds = %55
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.4, i32 noundef 74, ptr noundef @__PRETTY_FUNCTION__.run_tls_client) #8
  unreachable

65:                                               ; preds = %63
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = call i64 @BIO_ctrl(ptr noundef %66, i32 noundef 100, i64 noundef 0, ptr noundef %67)
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = call i64 @BIO_ctrl(ptr noundef %69, i32 noundef 100, i64 noundef 1, ptr noundef %70)
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = call i64 @BIO_ctrl(ptr noundef %72, i32 noundef 110, i64 noundef 0, ptr noundef %13)
  %74 = trunc i64 %73 to i32
  store i32 %74, ptr %10, align 4, !tbaa !9
  %75 = load i32, ptr %10, align 4, !tbaa !9
  %76 = icmp eq i32 %75, 1
  br i1 %76, label %77, label %78

77:                                               ; preds = %65
  br label %79

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

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

82:                                               ; preds = %79
  br label %84

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

84:                                               ; preds = %82
  %85 = load ptr, ptr %13, align 8, !tbaa !5
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = call i64 @SSL_ctrl(ptr noundef %85, i32 noundef 55, i64 noundef 0, ptr noundef %86)
  %88 = trunc i64 %87 to i32
  store i32 %88, ptr %10, align 4, !tbaa !9
  %89 = load i32, ptr %10, align 4, !tbaa !9
  %90 = icmp eq i32 %89, 1
  br i1 %90, label %91, label %92

91:                                               ; preds = %84
  br label %93

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

93:                                               ; preds = %91
  %94 = load ptr, ptr %13, align 8, !tbaa !5
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = call i32 @SSL_set1_host(ptr noundef %94, ptr noundef %95)
  store i32 %96, ptr %10, align 4, !tbaa !9
  %97 = load i32, ptr %10, align 4, !tbaa !9
  %98 = icmp eq i32 %97, 1
  br i1 %98, label %99, label %100

99:                                               ; preds = %93
  br label %101

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

101:                                              ; preds = %99
  %102 = load ptr, ptr %13, align 8, !tbaa !5
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  %104 = call i32 @SSL_set_ex_data(ptr noundef %102, i32 noundef 0, ptr noundef %103)
  store i32 %104, ptr %10, align 4, !tbaa !9
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = call i64 @BIO_ctrl(ptr noundef %105, i32 noundef 101, i64 noundef 0, ptr noundef null)
  %107 = trunc i64 %106 to i32
  store i32 %107, ptr %10, align 4, !tbaa !9
  %108 = load i32, ptr %10, align 4, !tbaa !9
  %109 = icmp sle i32 %108, 0
  br i1 %109, label %110, label %119

110:                                              ; preds = %101
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = icmp ne ptr %111, null
  br i1 %112, label %113, label %118

113:                                              ; preds = %110
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %114, ptr noundef @.str.11, ptr noundef %115, ptr noundef %116) #6
  br label %118

118:                                              ; preds = %113, %110
  br label %121

119:                                              ; preds = %101
  %120 = load ptr, ptr %12, align 8, !tbaa !5
  call void @BIO_ssl_shutdown(ptr noundef %120)
  br label %122

121:                                              ; preds = %118, %54
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %122

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

125:                                              ; preds = %122
  %126 = load ptr, ptr %12, align 8, !tbaa !5
  call void @BIO_free_all(ptr noundef %126)
  br label %127

127:                                              ; preds = %125, %122
  %128 = load ptr, ptr %11, align 8, !tbaa !5
  %129 = icmp ne ptr %128, null
  br i1 %129, label %130, label %132

130:                                              ; preds = %127
  %131 = load ptr, ptr %11, align 8, !tbaa !5
  call void @SSL_CTX_free(ptr noundef %131)
  br label %132

132:                                              ; preds = %130, %127
  %133 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %133) #6
  %134 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %134) #6
  %135 = call i64 @ERR_peek_error()
  %136 = icmp ne i64 %135, 0
  br i1 %136, label %137, label %145

137:                                              ; preds = %132
  store i32 1, ptr %9, align 4, !tbaa !9
  %138 = load ptr, ptr %8, align 8, !tbaa !5
  %139 = icmp ne ptr %138, null
  br i1 %139, label %140, label %144

140:                                              ; preds = %137
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %141, ptr noundef @.str.12) #6
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %143)
  br label %144

144:                                              ; preds = %140, %137
  call void @ERR_clear_error()
  br label %145

145:                                              ; preds = %144, %132
  %146 = load i32, ptr %9, align 4, !tbaa !9
  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 %146
}

; 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 @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 [118 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 [8 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.12 = 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 57, ptr noundef nonnull @__PRETTY_FUNCTION__.run_tls_client) #6
  unreachable

9:                                                ; preds = %4
  %.not52 = icmp eq ptr %2, null
  br i1 %.not52, 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
  %.041 = phi i32 [ %11, %10 ], [ %13, %12 ]
  %15 = icmp slt i32 %.041, 1
  br i1 %15, label %16, label %19

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

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

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 @BIO_new_ssl_connect(ptr noundef nonnull %7) #5
  %.not53 = icmp eq ptr %21, null
  br i1 %.not53, label %22, label %23

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

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

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

30:                                               ; preds = %23
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %.not54 = icmp eq ptr %31, null
  br i1 %.not54, label %32, label %33

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

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

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

38:                                               ; preds = %33
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = call i32 @SSL_set1_host(ptr noundef %39, ptr noundef %0) #5
  %41 = icmp eq i32 %40, 1
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %38
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = call i32 @SSL_set_ex_data(ptr noundef %44, i32 noundef 0, ptr noundef %3) #5
  %46 = call i64 @BIO_ctrl(ptr noundef nonnull %21, i32 noundef 101, i64 noundef 0, ptr noundef null) #5
  %47 = trunc i64 %46 to i32
  %48 = icmp slt i32 %47, 1
  br i1 %48, label %49, label %52

49:                                               ; preds = %43
  %.not55 = icmp eq ptr %3, null
  br i1 %.not55, label %53, label %50

50:                                               ; preds = %49
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.11, ptr noundef %0, ptr noundef %1) #5
  br label %53

52:                                               ; preds = %43
  call void @BIO_ssl_shutdown(ptr noundef nonnull %21) #5
  br label %53

53:                                               ; preds = %52, %50, %49
  %.0.ph = phi i32 [ 1, %50 ], [ 1, %49 ], [ 0, %52 ]
  call void @BIO_free_all(ptr noundef nonnull %21) #5
  br label %54

54:                                               ; preds = %16, %17, %53
  %.065 = phi i32 [ %.0.ph, %53 ], [ 1, %16 ], [ 1, %17 ]
  call void @SSL_CTX_free(ptr noundef nonnull %7) #5
  %55 = call i64 @ERR_peek_error() #5
  %.not58 = icmp eq i64 %55, 0
  br i1 %.not58, label %60, label %56

56:                                               ; preds = %54
  %.not59 = icmp eq ptr %3, null
  br i1 %.not59, label %59, label %57

57:                                               ; preds = %56
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.12) #5
  call void @ERR_print_errors_fp(ptr noundef nonnull %3) #5
  br label %59

59:                                               ; preds = %57, %56
  call void @ERR_clear_error() #5
  br label %60

60:                                               ; preds = %59, %54
  %.1 = phi i32 [ 1, %59 ], [ %.065, %54 ]
  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 @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