; LLVM IR from PacktPublishing/Demystifying-Cryptography-with-OpenSSL-3 :: Chapter10 (ocsp-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 [113 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 53, 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 55, 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 60, 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 %125

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 i64 @SSL_CTX_ctrl(ptr noundef %59, i32 noundef 65, i64 noundef 1, ptr noundef null)
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = call i64 @SSL_CTX_callback_ctrl(ptr noundef %61, i32 noundef 63, ptr noundef @ocsp_callback)
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = call ptr @BIO_new_ssl_connect(ptr noundef %63)
  store ptr %64, ptr %12, align 8, !tbaa !5
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = icmp ne ptr %65, null
  br i1 %66, label %67, label %68

67:                                               ; preds = %55
  br label %69

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

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

81:                                               ; preds = %69
  br label %83

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

83:                                               ; preds = %81
  %84 = load ptr, ptr %13, align 8, !tbaa !5
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %87

86:                                               ; preds = %83
  br label %88

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

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

95:                                               ; preds = %88
  br label %97

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

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

103:                                              ; preds = %97
  br label %105

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

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

114:                                              ; preds = %105
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = icmp ne ptr %115, null
  br i1 %116, label %117, label %122

117:                                              ; preds = %114
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef @.str.11, ptr noundef %119, ptr noundef %120) #6
  br label %122

122:                                              ; preds = %117, %114
  br label %125

123:                                              ; preds = %105
  %124 = load ptr, ptr %12, align 8, !tbaa !5
  call void @BIO_ssl_shutdown(ptr noundef %124)
  br label %126

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

126:                                              ; preds = %125, %123
  %127 = load ptr, ptr %12, align 8, !tbaa !5
  %128 = icmp ne ptr %127, null
  br i1 %128, label %129, label %131

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

131:                                              ; preds = %129, %126
  %132 = load ptr, ptr %11, align 8, !tbaa !5
  %133 = icmp ne ptr %132, null
  br i1 %133, label %134, label %136

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

136:                                              ; preds = %134, %131
  %137 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %137) #6
  %138 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %138) #6
  %139 = call i64 @ERR_peek_error()
  %140 = icmp ne i64 %139, 0
  br i1 %140, label %141, label %149

141:                                              ; preds = %136
  store i32 1, ptr %9, align 4, !tbaa !9
  %142 = load ptr, ptr %8, align 8, !tbaa !5
  %143 = icmp ne ptr %142, null
  br i1 %143, label %144, label %148

144:                                              ; preds = %141
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  %146 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %145, ptr noundef @.str.12) #6
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %147)
  br label %148

148:                                              ; preds = %144, %141
  call void @ERR_clear_error()
  br label %149

149:                                              ; preds = %148, %136
  %150 = 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 %150
}

; 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 i64 @SSL_CTX_callback_ctrl(ptr noundef, i32 noundef, ptr noundef) #5

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

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 [113 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 60, ptr noundef nonnull @__PRETTY_FUNCTION__.run_tls_client) #6
  unreachable

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

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

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

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 i64 @SSL_CTX_ctrl(ptr noundef nonnull %7, i32 noundef 65, i64 noundef 1, ptr noundef null) #5
  %22 = tail call i64 @SSL_CTX_callback_ctrl(ptr noundef nonnull %7, i32 noundef 63, ptr noundef nonnull @ocsp_callback) #5
  %23 = tail call ptr @BIO_new_ssl_connect(ptr noundef nonnull %7) #5
  %.not55 = icmp eq ptr %23, null
  br i1 %.not55, label %24, label %25

24:                                               ; 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

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

31:                                               ; preds = %25
  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

32:                                               ; preds = %25
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %.not56 = icmp eq ptr %33, null
  br i1 %.not56, label %34, label %35

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

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

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

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

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

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

51:                                               ; preds = %45
  %.not57 = icmp eq ptr %3, null
  br i1 %.not57, label %55, label %52

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

54:                                               ; preds = %45
  call void @BIO_ssl_shutdown(ptr noundef nonnull %23) #5
  br label %55

55:                                               ; preds = %54, %52, %51
  %.0.ph = phi i32 [ 1, %52 ], [ 1, %51 ], [ 0, %54 ]
  call void @BIO_free_all(ptr noundef nonnull %23) #5
  br label %56

56:                                               ; preds = %16, %17, %55
  %.067 = phi i32 [ %.0.ph, %55 ], [ 1, %16 ], [ 1, %17 ]
  call void @SSL_CTX_free(ptr noundef nonnull %7) #5
  %57 = call i64 @ERR_peek_error() #5
  %.not60 = icmp eq i64 %57, 0
  br i1 %.not60, label %62, label %58

58:                                               ; preds = %56
  %.not61 = icmp eq ptr %3, null
  br i1 %.not61, label %61, label %59

59:                                               ; preds = %58
  %60 = 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 %61

61:                                               ; preds = %59, %58
  call void @ERR_clear_error() #5
  br label %62

62:                                               ; preds = %61, %56
  %.1 = phi i32 [ 1, %61 ], [ %.067, %56 ]
  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 i64 @SSL_CTX_callback_ctrl(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

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

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