; LLVM IR from openanolis/openssl :: demos/guide (tls-client-block)

; 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 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [30 x i8], align 1
@stdout = external global ptr, align 8
@.str.13 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [21 x i8], align 1
@stderr = external global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca [160 x i8], align 16
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  store ptr null, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store ptr @.str, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 160, ptr %10) #4
  %11 = call ptr @TLS_client_method()
  %12 = call ptr @SSL_CTX_new(ptr noundef %11)
  store ptr %12, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %17

15:                                               ; preds = %0
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %108

17:                                               ; preds = %0
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  call void @SSL_CTX_set_verify(ptr noundef %18, i32 noundef 1, ptr noundef null)
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = call i32 @SSL_CTX_set_default_verify_paths(ptr noundef %19)
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %24, label %22

22:                                               ; preds = %17
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %108

24:                                               ; preds = %17
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = call i64 @SSL_CTX_ctrl(ptr noundef %25, i32 noundef 123, i64 noundef 771, ptr noundef null)
  %27 = icmp ne i64 %26, 0
  br i1 %27, label %30, label %28

28:                                               ; preds = %24
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %108

30:                                               ; preds = %24
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = call ptr @SSL_new(ptr noundef %31)
  store ptr %32, ptr %3, align 8, !tbaa !5
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = icmp eq ptr %33, null
  br i1 %34, label %35, label %37

35:                                               ; preds = %30
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %108

37:                                               ; preds = %30
  %38 = call ptr @create_socket_bio(ptr noundef @.str.5, ptr noundef @.str.6)
  store ptr %38, ptr %4, align 8, !tbaa !5
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = icmp eq ptr %39, null
  br i1 %40, label %41, label %43

41:                                               ; preds = %37
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  br label %108

43:                                               ; preds = %37
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  call void @SSL_set_bio(ptr noundef %44, ptr noundef %45, ptr noundef %46)
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = call i64 @SSL_ctrl(ptr noundef %47, i32 noundef 55, i64 noundef 0, ptr noundef @.str.5)
  %49 = icmp ne i64 %48, 0
  br i1 %49, label %52, label %50

50:                                               ; preds = %43
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  br label %108

52:                                               ; preds = %43
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = call i32 @SSL_set1_host(ptr noundef %53, ptr noundef @.str.5)
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %58, label %56

56:                                               ; preds = %52
  %57 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %108

58:                                               ; preds = %52
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = call i32 @SSL_connect(ptr noundef %59)
  %61 = icmp slt i32 %60, 1
  br i1 %61, label %62, label %73

62:                                               ; preds = %58
  %63 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = call i64 @SSL_get_verify_result(ptr noundef %64)
  %66 = icmp ne i64 %65, 0
  br i1 %66, label %67, label %72

67:                                               ; preds = %62
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = call i64 @SSL_get_verify_result(ptr noundef %68)
  %70 = call ptr @X509_verify_cert_error_string(i64 noundef %69)
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, ptr noundef %70)
  br label %72

72:                                               ; preds = %67, %62
  br label %108

73:                                               ; preds = %58
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = call i64 @strlen(ptr noundef %76) #5
  %78 = call i32 @SSL_write_ex(ptr noundef %74, ptr noundef %75, i64 noundef %77, ptr noundef %8)
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %82, label %80

80:                                               ; preds = %73
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  br label %108

82:                                               ; preds = %73
  br label %83

83:                                               ; preds = %88, %82
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds [160 x i8], ptr %10, i64 0, i64 0
  %86 = call i32 @SSL_read_ex(ptr noundef %84, ptr noundef %85, i64 noundef 160, ptr noundef %9)
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %93

88:                                               ; preds = %83
  %89 = getelementptr inbounds [160 x i8], ptr %10, i64 0, i64 0
  %90 = load i64, ptr %9, align 8, !tbaa !11
  %91 = load ptr, ptr @stdout, align 8, !tbaa !5
  %92 = call i64 @fwrite(ptr noundef %89, i64 noundef 1, i64 noundef %90, ptr noundef %91)
  br label %83, !llvm.loop !13

93:                                               ; preds = %83
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = call i32 @SSL_get_error(ptr noundef %95, i32 noundef 0)
  %97 = icmp ne i32 %96, 6
  br i1 %97, label %98, label %100

98:                                               ; preds = %93
  %99 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  br label %108

100:                                              ; preds = %93
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = call i32 @SSL_shutdown(ptr noundef %101)
  store i32 %102, ptr %6, align 4, !tbaa !9
  %103 = load i32, ptr %6, align 4, !tbaa !9
  %104 = icmp slt i32 %103, 1
  br i1 %104, label %105, label %107

105:                                              ; preds = %100
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  br label %108

107:                                              ; preds = %100
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %107, %105, %98, %80, %72, %56, %50, %41, %35, %28, %22, %15
  %109 = load i32, ptr %5, align 4, !tbaa !9
  %110 = icmp eq i32 %109, 1
  br i1 %110, label %111, label %113

111:                                              ; preds = %108
  %112 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %112)
  br label %113

113:                                              ; preds = %111, %108
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  call void @SSL_free(ptr noundef %114)
  %115 = load ptr, ptr %2, align 8, !tbaa !5
  call void @SSL_CTX_free(ptr noundef %115)
  %116 = load i32, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 160, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  ret i32 %116
}

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

declare ptr @SSL_CTX_new(ptr noundef) #2

declare ptr @TLS_client_method() #2

declare i32 @printf(ptr noundef, ...) #2

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

declare i32 @SSL_CTX_set_default_verify_paths(ptr noundef) #2

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

declare ptr @SSL_new(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @create_socket_bio(ptr noundef, ptr noundef) #0

declare void @SSL_set_bio(ptr noundef, ptr noundef, ptr noundef) #2

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

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

declare i32 @SSL_connect(ptr noundef) #2

declare i64 @SSL_get_verify_result(ptr noundef) #2

declare ptr @X509_verify_cert_error_string(i64 noundef) #2

declare i32 @SSL_write_ex(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #2

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

declare i32 @SSL_read_ex(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #2

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

declare i32 @SSL_get_error(ptr noundef, i32 noundef) #2

declare i32 @SSL_shutdown(ptr noundef) #2

declare void @ERR_print_errors_fp(ptr noundef) #2

declare void @SSL_free(ptr noundef) #2

declare void @SSL_CTX_free(ptr noundef) #2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!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 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [30 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.13 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [21 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca [160 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %3) #5
  %4 = tail call ptr @TLS_client_method() #5
  %5 = tail call ptr @SSL_CTX_new(ptr noundef %4) #5
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %9

7:                                                ; preds = %0
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %64

9:                                                ; preds = %0
  tail call void @SSL_CTX_set_verify(ptr noundef nonnull %5, i32 noundef 1, ptr noundef null) #5
  %10 = tail call i32 @SSL_CTX_set_default_verify_paths(ptr noundef nonnull %5) #5
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %11, label %13

11:                                               ; preds = %9
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %64

13:                                               ; preds = %9
  %14 = tail call i64 @SSL_CTX_ctrl(ptr noundef nonnull %5, i32 noundef 123, i64 noundef 771, ptr noundef null) #5
  %.not29 = icmp eq i64 %14, 0
  br i1 %.not29, label %15, label %17

15:                                               ; preds = %13
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %64

17:                                               ; preds = %13
  %18 = tail call ptr @SSL_new(ptr noundef nonnull %5) #5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %22

20:                                               ; preds = %17
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %64

22:                                               ; preds = %17
  %23 = tail call ptr @create_socket_bio(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6)
  %24 = icmp eq ptr %23, null
  br i1 %24, label %25, label %27

25:                                               ; preds = %22
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  br label %64

27:                                               ; preds = %22
  tail call void @SSL_set_bio(ptr noundef nonnull %18, ptr noundef nonnull %23, ptr noundef nonnull %23) #5
  %28 = tail call i64 @SSL_ctrl(ptr noundef nonnull %18, i32 noundef 55, i64 noundef 0, ptr noundef nonnull @.str.5) #5
  %.not30 = icmp eq i64 %28, 0
  br i1 %.not30, label %29, label %31

29:                                               ; preds = %27
  %30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  br label %64

31:                                               ; preds = %27
  %32 = tail call i32 @SSL_set1_host(ptr noundef nonnull %18, ptr noundef nonnull @.str.5) #5
  %.not31 = icmp eq i32 %32, 0
  br i1 %.not31, label %33, label %35

33:                                               ; preds = %31
  %34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  br label %64

35:                                               ; preds = %31
  %36 = tail call i32 @SSL_connect(ptr noundef nonnull %18) #5
  %37 = icmp slt i32 %36, 1
  br i1 %37, label %38, label %45

38:                                               ; preds = %35
  %39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %40 = tail call i64 @SSL_get_verify_result(ptr noundef nonnull %18) #5
  %.not35 = icmp eq i64 %40, 0
  br i1 %.not35, label %64, label %41

41:                                               ; preds = %38
  %42 = tail call i64 @SSL_get_verify_result(ptr noundef nonnull %18) #5
  %43 = tail call ptr @X509_verify_cert_error_string(i64 noundef %42) #5
  %44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, ptr noundef %43)
  br label %64

45:                                               ; preds = %35
  %46 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @.str) #6
  %47 = call i32 @SSL_write_ex(ptr noundef nonnull %18, ptr noundef nonnull @.str, i64 noundef %46, ptr noundef nonnull %1) #5
  %.not32 = icmp eq i32 %47, 0
  br i1 %.not32, label %49, label %.preheader

.preheader:                                       ; preds = %45
  %48 = call i32 @SSL_read_ex(ptr noundef nonnull %18, ptr noundef nonnull %3, i64 noundef 160, ptr noundef nonnull %2) #5
  %.not3342 = icmp eq i32 %48, 0
  br i1 %.not3342, label %._crit_edge, label %.lr.ph

49:                                               ; preds = %45
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  br label %64

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %51 = load i64, ptr %2, align 8, !tbaa !5
  %52 = load ptr, ptr @stdout, align 8, !tbaa !9
  %53 = call i64 @fwrite(ptr noundef nonnull %3, i64 noundef 1, i64 noundef %51, ptr noundef %52)
  %54 = call i32 @SSL_read_ex(ptr noundef nonnull %18, ptr noundef nonnull %3, i64 noundef 160, ptr noundef nonnull %2) #5
  %.not33 = icmp eq i32 %54, 0
  br i1 %.not33, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %56 = call i32 @SSL_get_error(ptr noundef nonnull %18, i32 noundef 0) #5
  %.not34 = icmp eq i32 %56, 6
  br i1 %.not34, label %59, label %57

57:                                               ; preds = %._crit_edge
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  br label %64

59:                                               ; preds = %._crit_edge
  %60 = call i32 @SSL_shutdown(ptr noundef nonnull %18) #5
  %61 = icmp slt i32 %60, 1
  br i1 %61, label %62, label %66

62:                                               ; preds = %59
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15)
  br label %64

64:                                               ; preds = %7, %20, %25, %41, %38, %57, %62, %49, %33, %29, %15, %11
  %.0.ph = phi ptr [ null, %11 ], [ null, %15 ], [ %18, %29 ], [ %18, %33 ], [ %18, %49 ], [ %18, %62 ], [ %18, %57 ], [ %18, %38 ], [ %18, %41 ], [ %18, %25 ], [ null, %20 ], [ null, %7 ]
  %65 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @ERR_print_errors_fp(ptr noundef %65) #5
  br label %66

66:                                               ; preds = %59, %64
  %.040 = phi ptr [ %.0.ph, %64 ], [ %18, %59 ]
  %.02538 = phi i32 [ 1, %64 ], [ 0, %59 ]
  call void @SSL_free(ptr noundef %.040) #5
  call void @SSL_CTX_free(ptr noundef %5) #5
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 %.02538
}

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

declare ptr @SSL_CTX_new(ptr noundef) local_unnamed_addr #2

declare ptr @TLS_client_method() local_unnamed_addr #2

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

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

declare i32 @SSL_CTX_set_default_verify_paths(ptr noundef) local_unnamed_addr #2

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

declare ptr @SSL_new(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden ptr @create_socket_bio(ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

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

declare i32 @SSL_connect(ptr noundef) local_unnamed_addr #2

declare i64 @SSL_get_verify_result(ptr noundef) local_unnamed_addr #2

declare ptr @X509_verify_cert_error_string(i64 noundef) local_unnamed_addr #2

declare i32 @SSL_write_ex(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

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

declare i32 @SSL_read_ex(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3

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

declare i32 @SSL_shutdown(ptr noundef) local_unnamed_addr #2

declare void @ERR_print_errors_fp(ptr noundef) local_unnamed_addr #2

declare void @SSL_free(ptr noundef) local_unnamed_addr #2

declare void @SSL_CTX_free(ptr noundef) local_unnamed_addr #2

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

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

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

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


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