; LLVM IR from openanolis/openssl :: demos/bio (sconnect)

; 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 [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@stdout = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1

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

22:                                               ; preds = %2
  %23 = load ptr, ptr %5, align 8, !tbaa !9
  %24 = getelementptr inbounds ptr, ptr %23, i64 1
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  store ptr %25, ptr %6, align 8, !tbaa !9
  br label %26

26:                                               ; preds = %22, %2
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = icmp sgt i32 %27, 2
  br i1 %28, label %29, label %33

29:                                               ; preds = %26
  %30 = load ptr, ptr %5, align 8, !tbaa !9
  %31 = getelementptr inbounds ptr, ptr %30, i64 2
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  store ptr %32, ptr %7, align 8, !tbaa !9
  br label %33

33:                                               ; preds = %29, %26
  %34 = call ptr @TLS_client_method()
  %35 = call ptr @SSL_CTX_new(ptr noundef %34)
  store ptr %35, ptr %13, align 8, !tbaa !9
  %36 = load ptr, ptr %13, align 8, !tbaa !9
  call void @SSL_CTX_set_verify(ptr noundef %36, i32 noundef 1, ptr noundef null)
  %37 = load ptr, ptr %13, align 8, !tbaa !9
  %38 = load ptr, ptr %7, align 8, !tbaa !9
  %39 = call i32 @SSL_CTX_load_verify_locations(ptr noundef %37, ptr noundef %38, ptr noundef null)
  %40 = load ptr, ptr %13, align 8, !tbaa !9
  %41 = call ptr @SSL_new(ptr noundef %40)
  store ptr %41, ptr %14, align 8, !tbaa !9
  %42 = load ptr, ptr %14, align 8, !tbaa !9
  call void @SSL_set_connect_state(ptr noundef %42)
  %43 = call ptr @BIO_f_ssl()
  %44 = call ptr @BIO_new(ptr noundef %43)
  store ptr %44, ptr %15, align 8, !tbaa !9
  %45 = load ptr, ptr %15, align 8, !tbaa !9
  %46 = load ptr, ptr %14, align 8, !tbaa !9
  %47 = call i64 @BIO_ctrl(ptr noundef %45, i32 noundef 109, i64 noundef 1, ptr noundef %46)
  %48 = call ptr @BIO_s_connect()
  %49 = call ptr @BIO_new(ptr noundef %48)
  store ptr %49, ptr %10, align 8, !tbaa !9
  %50 = load ptr, ptr %10, align 8, !tbaa !9
  %51 = load ptr, ptr %6, align 8, !tbaa !9
  %52 = call i64 @BIO_ctrl(ptr noundef %50, i32 noundef 100, i64 noundef 0, ptr noundef %51)
  %53 = load ptr, ptr %10, align 8, !tbaa !9
  %54 = call ptr @BIO_ptr_ctrl(ptr noundef %53, i32 noundef 123, i64 noundef 0)
  store ptr %54, ptr %8, align 8, !tbaa !9
  %55 = load ptr, ptr %8, align 8, !tbaa !9
  %56 = icmp ne ptr %55, null
  br i1 %56, label %57, label %62

57:                                               ; preds = %33
  %58 = load ptr, ptr %14, align 8, !tbaa !9
  %59 = load ptr, ptr %8, align 8, !tbaa !9
  %60 = call i32 @SSL_set1_host(ptr noundef %58, ptr noundef %59)
  %61 = icmp sle i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %57, %33
  br label %129

63:                                               ; preds = %57
  %64 = load ptr, ptr %10, align 8, !tbaa !9
  %65 = call i64 @BIO_ctrl(ptr noundef %64, i32 noundef 102, i64 noundef 1, ptr noundef null)
  %66 = load ptr, ptr %15, align 8, !tbaa !9
  %67 = load ptr, ptr %10, align 8, !tbaa !9
  %68 = call ptr @BIO_push(ptr noundef %66, ptr noundef %67)
  store ptr %68, ptr %10, align 8, !tbaa !9
  store ptr @.str.2, ptr %12, align 8, !tbaa !9
  %69 = load ptr, ptr %12, align 8, !tbaa !9
  %70 = call i64 @strlen(ptr noundef %69) #7
  %71 = trunc i64 %70 to i32
  store i32 %71, ptr %17, align 4, !tbaa !5
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %101, %86, %63
  %73 = load ptr, ptr %10, align 8, !tbaa !9
  %74 = load ptr, ptr %12, align 8, !tbaa !9
  %75 = load i32, ptr %18, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds i8, ptr %74, i64 %76
  %78 = load i32, ptr %17, align 4, !tbaa !5
  %79 = call i32 @BIO_write(ptr noundef %73, ptr noundef %77, i32 noundef %78)
  store i32 %79, ptr %16, align 4, !tbaa !5
  %80 = load i32, ptr %16, align 4, !tbaa !5
  %81 = icmp sle i32 %80, 0
  br i1 %81, label %82, label %91

82:                                               ; preds = %72
  %83 = load ptr, ptr %10, align 8, !tbaa !9
  %84 = call i32 @BIO_test_flags(ptr noundef %83, i32 noundef 8)
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %90

86:                                               ; preds = %82
  %87 = load ptr, ptr @stderr, align 8, !tbaa !9
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef @.str.3) #6
  %89 = call i32 @sleep(i32 noundef 1)
  br label %72

90:                                               ; preds = %82
  br label %129

91:                                               ; preds = %72
  %92 = load i32, ptr %16, align 4, !tbaa !5
  %93 = load i32, ptr %18, align 4, !tbaa !5
  %94 = add nsw i32 %93, %92
  store i32 %94, ptr %18, align 4, !tbaa !5
  %95 = load i32, ptr %16, align 4, !tbaa !5
  %96 = load i32, ptr %17, align 4, !tbaa !5
  %97 = sub nsw i32 %96, %95
  store i32 %97, ptr %17, align 4, !tbaa !5
  %98 = load i32, ptr %17, align 4, !tbaa !5
  %99 = icmp sle i32 %98, 0
  br i1 %99, label %100, label %101

100:                                              ; preds = %91
  br label %102

101:                                              ; preds = %91
  br label %72

102:                                              ; preds = %100
  br label %103

103:                                              ; preds = %122, %117, %102
  %104 = load ptr, ptr %10, align 8, !tbaa !9
  %105 = getelementptr inbounds [10240 x i8], ptr %11, i64 0, i64 0
  %106 = call i32 @BIO_read(ptr noundef %104, ptr noundef %105, i32 noundef 10240)
  store i32 %106, ptr %16, align 4, !tbaa !5
  %107 = load i32, ptr %16, align 4, !tbaa !5
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %109, label %110

109:                                              ; preds = %103
  br label %128

110:                                              ; preds = %103
  %111 = load i32, ptr %16, align 4, !tbaa !5
  %112 = icmp slt i32 %111, 0
  br i1 %112, label %113, label %122

113:                                              ; preds = %110
  %114 = load ptr, ptr %10, align 8, !tbaa !9
  %115 = call i32 @BIO_test_flags(ptr noundef %114, i32 noundef 8)
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %121

117:                                              ; preds = %113
  %118 = load ptr, ptr @stderr, align 8, !tbaa !9
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef @.str.4) #6
  %120 = call i32 @sleep(i32 noundef 1)
  br label %103

121:                                              ; preds = %113
  br label %129

122:                                              ; preds = %110
  %123 = getelementptr inbounds [10240 x i8], ptr %11, i64 0, i64 0
  %124 = load i32, ptr %16, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = load ptr, ptr @stdout, align 8, !tbaa !9
  %127 = call i64 @fwrite(ptr noundef %123, i64 noundef 1, i64 noundef %125, ptr noundef %126)
  br label %103

128:                                              ; preds = %109
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %140

129:                                              ; preds = %121, %90, %62
  %130 = call i64 @ERR_peek_error()
  %131 = icmp eq i64 %130, 0
  br i1 %131, label %132, label %137

132:                                              ; preds = %129
  %133 = load ptr, ptr @stderr, align 8, !tbaa !9
  %134 = call ptr @__errno_location() #8
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef @.str.5, i32 noundef %135) #6
  call void @perror(ptr noundef @.str.6)
  br label %139

137:                                              ; preds = %129
  %138 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @ERR_print_errors_fp(ptr noundef %138)
  br label %139

139:                                              ; preds = %137, %132
  br label %140

140:                                              ; preds = %139, %128
  %141 = load ptr, ptr %10, align 8, !tbaa !9
  call void @BIO_free_all(ptr noundef %141)
  %142 = load ptr, ptr %13, align 8, !tbaa !9
  call void @SSL_CTX_free(ptr noundef %142)
  %143 = load i32, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, 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 10240, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  ret i32 %143
}

; 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 void @SSL_CTX_set_verify(ptr noundef, i32 noundef, ptr noundef) #2

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

declare ptr @SSL_new(ptr noundef) #2

declare void @SSL_set_connect_state(ptr noundef) #2

declare ptr @BIO_new(ptr noundef) #2

declare ptr @BIO_f_ssl() #2

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

declare ptr @BIO_s_connect() #2

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

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

declare ptr @BIO_push(ptr noundef, ptr noundef) #2

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

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

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #4

declare i32 @sleep(i32 noundef) #2

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

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

declare i64 @ERR_peek_error() #2

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #5

declare void @perror(ptr noundef) #2

declare void @ERR_print_errors_fp(ptr noundef) #2

declare void @BIO_free_all(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 "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 willreturn memory(none) "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 willreturn memory(read) }
attributes #8 = { nounwind willreturn memory(none) }

!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 = !{!"int", !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}


; 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 [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca [10240 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 10240, ptr nonnull %3) #6
  %4 = icmp sgt i32 %0, 1
  br i1 %4, label %5, label %.thread

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %1, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %.not52 = icmp eq i32 %0, 2
  br i1 %.not52, label %.thread, label %8

8:                                                ; preds = %5
  %9 = getelementptr inbounds i8, ptr %1, i64 16
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %2, %8, %5
  %.04151 = phi ptr [ %7, %8 ], [ %7, %5 ], [ @.str, %2 ]
  %.042 = phi ptr [ %10, %8 ], [ @.str.1, %5 ], [ @.str.1, %2 ]
  %11 = tail call ptr @TLS_client_method() #6
  %12 = tail call ptr @SSL_CTX_new(ptr noundef %11) #6
  tail call void @SSL_CTX_set_verify(ptr noundef %12, i32 noundef 1, ptr noundef null) #6
  %13 = tail call i32 @SSL_CTX_load_verify_locations(ptr noundef %12, ptr noundef %.042, ptr noundef null) #6
  %14 = tail call ptr @SSL_new(ptr noundef %12) #6
  tail call void @SSL_set_connect_state(ptr noundef %14) #6
  %15 = tail call ptr @BIO_f_ssl() #6
  %16 = tail call ptr @BIO_new(ptr noundef %15) #6
  %17 = tail call i64 @BIO_ctrl(ptr noundef %16, i32 noundef 109, i64 noundef 1, ptr noundef %14) #6
  %18 = tail call ptr @BIO_s_connect() #6
  %19 = tail call ptr @BIO_new(ptr noundef %18) #6
  %20 = tail call i64 @BIO_ctrl(ptr noundef %19, i32 noundef 100, i64 noundef 0, ptr noundef %.04151) #6
  %21 = tail call ptr @BIO_ptr_ctrl(ptr noundef %19, i32 noundef 123, i64 noundef 0) #6
  %.not = icmp eq ptr %21, null
  br i1 %.not, label %.loopexit53, label %22

22:                                               ; preds = %.thread
  %23 = tail call i32 @SSL_set1_host(ptr noundef %14, ptr noundef nonnull %21) #6
  %24 = icmp slt i32 %23, 1
  br i1 %24, label %.loopexit53, label %25

25:                                               ; preds = %22
  %26 = tail call i64 @BIO_ctrl(ptr noundef %19, i32 noundef 102, i64 noundef 1, ptr noundef null) #6
  %27 = tail call ptr @BIO_push(ptr noundef %16, ptr noundef %19) #6
  %28 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @.str.2) #7
  %29 = trunc i64 %28 to i32
  br label %.outer

.outer:                                           ; preds = %._crit_edge, %25
  %.040.ph = phi i32 [ %42, %._crit_edge ], [ %29, %25 ]
  %.039.ph = phi i32 [ %41, %._crit_edge ], [ 0, %25 ]
  %30 = zext nneg i32 %.039.ph to i64
  %31 = getelementptr inbounds i8, ptr @.str.2, i64 %30
  %32 = tail call i32 @BIO_write(ptr noundef %27, ptr noundef nonnull %31, i32 noundef %.040.ph) #6
  %33 = icmp slt i32 %32, 1
  br i1 %33, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.outer, %35
  %34 = tail call i32 @BIO_test_flags(ptr noundef %27, i32 noundef 8) #6
  %.not49 = icmp eq i32 %34, 0
  br i1 %.not49, label %.loopexit53, label %35

35:                                               ; preds = %.lr.ph
  %36 = load ptr, ptr @stderr, align 8, !tbaa !5
  %37 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef nonnull @.str.3) #8
  %38 = tail call i32 @sleep(i32 noundef 1) #6
  %39 = tail call i32 @BIO_write(ptr noundef %27, ptr noundef nonnull %31, i32 noundef %.040.ph) #6
  %40 = icmp slt i32 %39, 1
  br i1 %40, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %35, %.outer
  %.lcssa = phi i32 [ %32, %.outer ], [ %39, %35 ]
  %41 = add nuw nsw i32 %.lcssa, %.039.ph
  %42 = sub nsw i32 %.040.ph, %.lcssa
  %43 = icmp slt i32 %42, 1
  br i1 %43, label %.preheader, label %.outer

.preheader:                                       ; preds = %._crit_edge
  %44 = call i32 @BIO_read(ptr noundef %27, ptr noundef nonnull %3, i32 noundef 10240) #6
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %.loopexit, label %.lr.ph56

.lr.ph56:                                         ; preds = %.preheader, %.backedge
  %46 = phi i32 [ %54, %.backedge ], [ %44, %.preheader ]
  %47 = icmp slt i32 %46, 0
  br i1 %47, label %48, label %56

48:                                               ; preds = %.lr.ph56
  %49 = call i32 @BIO_test_flags(ptr noundef %27, i32 noundef 8) #6
  %.not48 = icmp eq i32 %49, 0
  br i1 %.not48, label %.loopexit53, label %50

50:                                               ; preds = %48
  %51 = load ptr, ptr @stderr, align 8, !tbaa !5
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.4) #8
  %53 = call i32 @sleep(i32 noundef 1) #6
  br label %.backedge

.backedge:                                        ; preds = %50, %56
  %54 = call i32 @BIO_read(ptr noundef %27, ptr noundef nonnull %3, i32 noundef 10240) #6
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %.loopexit, label %.lr.ph56

56:                                               ; preds = %.lr.ph56
  %57 = zext nneg i32 %46 to i64
  %58 = load ptr, ptr @stdout, align 8, !tbaa !5
  %59 = call i64 @fwrite(ptr noundef nonnull %3, i64 noundef 1, i64 noundef %57, ptr noundef %58)
  br label %.backedge

.loopexit53:                                      ; preds = %.lr.ph, %48, %.thread, %22
  %.043 = phi ptr [ %19, %22 ], [ %19, %.thread ], [ %27, %48 ], [ %27, %.lr.ph ]
  %60 = call i64 @ERR_peek_error() #6
  %61 = icmp eq i64 %60, 0
  %62 = load ptr, ptr @stderr, align 8, !tbaa !5
  br i1 %61, label %63, label %67

63:                                               ; preds = %.loopexit53
  %64 = tail call ptr @__errno_location() #9
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef nonnull @.str.5, i32 noundef %65) #8
  call void @perror(ptr noundef nonnull @.str.6) #10
  br label %.loopexit

67:                                               ; preds = %.loopexit53
  call void @ERR_print_errors_fp(ptr noundef %62) #6
  br label %.loopexit

.loopexit:                                        ; preds = %.backedge, %.preheader, %63, %67
  %.1 = phi ptr [ %.043, %63 ], [ %.043, %67 ], [ %27, %.preheader ], [ %27, %.backedge ]
  %.0 = phi i32 [ 1, %63 ], [ 1, %67 ], [ 0, %.preheader ], [ 0, %.backedge ]
  call void @BIO_free_all(ptr noundef %.1) #6
  call void @SSL_CTX_free(ptr noundef %12) #6
  call void @llvm.lifetime.end.p0(i64 10240, ptr nonnull %3) #6
  ret i32 %.0
}

; 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

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

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

declare ptr @SSL_new(ptr noundef) local_unnamed_addr #2

declare void @SSL_set_connect_state(ptr noundef) local_unnamed_addr #2

declare ptr @BIO_new(ptr noundef) local_unnamed_addr #2

declare ptr @BIO_f_ssl() local_unnamed_addr #2

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

declare ptr @BIO_s_connect() local_unnamed_addr #2

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

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

declare ptr @BIO_push(ptr 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 #3

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

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

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

declare i32 @sleep(i32 noundef) local_unnamed_addr #2

declare i32 @BIO_read(ptr noundef, ptr noundef, i32 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 #4

declare i64 @ERR_peek_error() local_unnamed_addr #2

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #4

declare void @ERR_print_errors_fp(ptr noundef) local_unnamed_addr #2

declare void @BIO_free_all(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 = { 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 #4 = { 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 #5 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 willreturn memory(read) }
attributes #8 = { cold nounwind }
attributes #9 = { nounwind willreturn memory(none) }
attributes #10 = { cold }

!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}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass