; LLVM IR from aws/s2n-tls :: bin (echo)

; 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"

%struct.fd_set = type { [16 x i64] }

@stderr = external global ptr, align 8
@s2n_errno = external thread_local global i32, align 4
@stdout = external global ptr, align 8
@.str.65 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @print_s2n_error(ptr noundef) #0

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #3

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @wait_for_event(i32 noundef, i32 noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @print_connection_info(ptr noundef) #0

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

declare i32 @s2n_error_get_type(i32 noundef) #2

declare i32 @s2n_connection_get_alert(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @renegotiate(ptr noundef %0, i32 noundef %1, i1 noundef zeroext %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca [10240 x i8], align 16
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca %struct.fd_set, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  %15 = zext i1 %2 to i8
  store i8 %15, ptr %7, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 10240, ptr %9) #6
  call void @llvm.memset.p0.i64(ptr align 16 %9, i8 0, i64 10240, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !13
  br label %16

16:                                               ; preds = %3
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = call i32 @s2n_renegotiate_wipe(ptr noundef %17)
  %19 = icmp slt i32 %18, 0
  br i1 %19, label %20, label %21

20:                                               ; preds = %16
  call void @print_s2n_error(ptr noundef @.str.67)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %123

21:                                               ; preds = %16
  br label %22

22:                                               ; preds = %21
  br label %23

23:                                               ; preds = %22
  br label %24

24:                                               ; preds = %23
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = call i32 @s2n_connection_set_client_auth_type(ptr noundef %25, i32 noundef 2)
  %27 = icmp slt i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %24
  call void @print_s2n_error(ptr noundef @.str.68)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %123

29:                                               ; preds = %24
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30
  %32 = load ptr, ptr @stdout, align 8, !tbaa !5
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str.69) #6
  %34 = load ptr, ptr @stdout, align 8, !tbaa !5
  %35 = call i32 @fflush(ptr noundef %34)
  %36 = load i8, ptr %7, align 1, !tbaa !11, !range !15, !noundef !16
  %37 = trunc i8 %36 to i1
  br i1 %37, label %38, label %51

38:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 128, ptr %12) #6
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 128, i1 false)
  %39 = load i32, ptr %6, align 4, !tbaa !9
  %40 = srem i32 %39, 64
  %41 = zext i32 %40 to i64
  %42 = shl i64 1, %41
  %43 = getelementptr inbounds %struct.fd_set, ptr %12, i32 0, i32 0
  %44 = load i32, ptr %6, align 4, !tbaa !9
  %45 = sdiv i32 %44, 64
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [16 x i64], ptr %43, i64 0, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !13
  %49 = or i64 %48, %42
  store i64 %49, ptr %47, align 8, !tbaa !13
  %50 = call i32 @select(i32 noundef 1024, ptr noundef %12, ptr noundef null, ptr noundef null, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 128, ptr %12) #6
  br label %51

51:                                               ; preds = %38, %31
  br label %52

52:                                               ; preds = %118, %51
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds [10240 x i8], ptr %9, i64 0, i64 0
  %55 = call i32 @s2n_renegotiate(ptr noundef %53, ptr noundef %54, i64 noundef 10240, ptr noundef %10, ptr noundef %8)
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %119

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %58 = getelementptr inbounds [10240 x i8], ptr %9, i64 0, i64 0
  store ptr %58, ptr %13, align 8, !tbaa !5
  br label %59

59:                                               ; preds = %81, %57
  %60 = load i64, ptr %10, align 8, !tbaa !13
  %61 = icmp sgt i64 %60, 0
  br i1 %61, label %62, label %82

62:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = load i64, ptr %10, align 8, !tbaa !13
  %65 = call i64 @write(i32 noundef 1, ptr noundef %63, i64 noundef %64)
  store i64 %65, ptr %14, align 8, !tbaa !13
  br label %66

66:                                               ; preds = %62
  %67 = load i64, ptr %14, align 8, !tbaa !13
  %68 = icmp slt i64 %67, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %66
  call void @print_s2n_error(ptr noundef @.str.70)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %79

70:                                               ; preds = %66
  br label %71

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71
  %73 = load i64, ptr %14, align 8, !tbaa !13
  %74 = load i64, ptr %10, align 8, !tbaa !13
  %75 = sub nsw i64 %74, %73
  store i64 %75, ptr %10, align 8, !tbaa !13
  %76 = load i64, ptr %14, align 8, !tbaa !13
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %77, i64 %76
  store ptr %78, ptr %13, align 8, !tbaa !5
  store i32 0, ptr %11, align 4
  br label %79

79:                                               ; preds = %72, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %80 = load i32, ptr %11, align 4
  switch i32 %80, label %116 [
    i32 0, label %81
  ]

81:                                               ; preds = %79
  br label %59, !llvm.loop !17

82:                                               ; preds = %59
  %83 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %84 = load i32, ptr %83, align 4, !tbaa !9
  %85 = call i32 @s2n_error_get_type(i32 noundef %84)
  %86 = icmp ne i32 %85, 3
  br i1 %86, label %87, label %106

87:                                               ; preds = %82
  %88 = load ptr, ptr @stderr, align 8, !tbaa !5
  %89 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %90 = load i32, ptr %89, align 4, !tbaa !9
  %91 = call ptr @s2n_strerror(i32 noundef %90, ptr noundef null)
  %92 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %93 = load i32, ptr %92, align 4, !tbaa !9
  %94 = call ptr @s2n_strerror_debug(i32 noundef %93, ptr noundef null)
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %88, ptr noundef @.str.71, ptr noundef %91, ptr noundef %94) #6
  %96 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %97 = load i32, ptr %96, align 4, !tbaa !9
  %98 = call i32 @s2n_error_get_type(i32 noundef %97)
  %99 = icmp eq i32 %98, 4
  br i1 %99, label %100, label %105

100:                                              ; preds = %87
  %101 = load ptr, ptr @stderr, align 8, !tbaa !5
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = call i32 @s2n_connection_get_alert(ptr noundef %102)
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %101, ptr noundef @.str.65, i32 noundef %103) #6
  br label %105

105:                                              ; preds = %100, %87
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %116

106:                                              ; preds = %82
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %6, align 4, !tbaa !9
  %109 = load i32, ptr %8, align 4, !tbaa !9
  %110 = call i32 @wait_for_event(i32 noundef %108, i32 noundef %109)
  %111 = icmp slt i32 %110, 0
  br i1 %111, label %112, label %113

112:                                              ; preds = %107
  call void @print_s2n_error(ptr noundef @.str.72)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %116

113:                                              ; preds = %107
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114
  store i32 0, ptr %11, align 4
  br label %116

116:                                              ; preds = %115, %112, %105, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  %117 = load i32, ptr %11, align 4
  switch i32 %117, label %123 [
    i32 0, label %118
  ]

118:                                              ; preds = %116
  br label %52, !llvm.loop !19

119:                                              ; preds = %52
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = call i32 @print_connection_info(ptr noundef %120)
  %122 = call i32 (ptr, ...) @printf(ptr noundef @.str.73)
  store i32 0, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %123

123:                                              ; preds = %119, %116, %28, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 10240, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %124 = load i32, ptr %4, align 4
  ret i32 %124
}

declare i32 @s2n_renegotiate_wipe(ptr noundef) #2

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

declare i32 @fflush(ptr noundef) #2

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

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

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

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 = { 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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 = !{!"_Bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


; 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"

%struct.fd_set = type { [16 x i64] }

@stderr = external local_unnamed_addr global ptr, align 8
@s2n_errno = external thread_local local_unnamed_addr global i32, align 4
@stdout = external local_unnamed_addr global ptr, align 8
@.str.65 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @print_s2n_error(ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #3

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @wait_for_event(i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @print_connection_info(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

declare i32 @s2n_error_get_type(i32 noundef) local_unnamed_addr #2

declare i32 @s2n_connection_get_alert(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @renegotiate(ptr noundef %0, i32 noundef %1, i1 noundef zeroext %2) local_unnamed_addr #0 {
  %4 = alloca i32, align 4
  %5 = alloca [10240 x i8], align 16
  %6 = alloca i64, align 8
  %7 = alloca %struct.fd_set, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 10240, ptr nonnull %5) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(10240) %5, i8 0, i64 10240, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  store i64 0, ptr %6, align 8, !tbaa !9
  %8 = tail call i32 @s2n_renegotiate_wipe(ptr noundef %0) #7
  %9 = icmp slt i32 %8, 0
  br i1 %9, label %10, label %11

10:                                               ; preds = %3
  tail call void @print_s2n_error(ptr noundef nonnull @.str.67)
  br label %.critedge

11:                                               ; preds = %3
  %12 = tail call i32 @s2n_connection_set_client_auth_type(ptr noundef %0, i32 noundef 2) #7
  %13 = icmp slt i32 %12, 0
  br i1 %13, label %14, label %15

14:                                               ; preds = %11
  tail call void @print_s2n_error(ptr noundef nonnull @.str.68)
  br label %.critedge

15:                                               ; preds = %11
  %16 = load ptr, ptr @stdout, align 8, !tbaa !11
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.69) #7
  %18 = load ptr, ptr @stdout, align 8, !tbaa !11
  %19 = tail call i32 @fflush(ptr noundef %18)
  br i1 %2, label %20, label %30

20:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %7) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(128) %7, i8 0, i64 128, i1 false)
  %21 = srem i32 %1, 64
  %22 = zext nneg i32 %21 to i64
  %23 = shl nuw i64 1, %22
  %24 = sdiv i32 %1, 64
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [16 x i64], ptr %7, i64 0, i64 %25
  %27 = load i64, ptr %26, align 8, !tbaa !9
  %28 = or i64 %27, %23
  store i64 %28, ptr %26, align 8, !tbaa !9
  %29 = call i32 @select(i32 noundef 1024, ptr noundef nonnull %7, ptr noundef null, ptr noundef null, ptr noundef null) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %7) #7
  br label %30

30:                                               ; preds = %20, %15
  %31 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  br label %32

32:                                               ; preds = %59, %30
  %33 = call i32 @s2n_renegotiate(ptr noundef %0, ptr noundef nonnull %5, i64 noundef 10240, ptr noundef nonnull %6, ptr noundef nonnull %4) #7
  %.not = icmp eq i32 %33, 0
  br i1 %.not, label %64, label %thread-pre-split

thread-pre-split:                                 ; preds = %32
  %.pr = load i64, ptr %6, align 8, !tbaa !9
  %34 = icmp sgt i64 %.pr, 0
  br i1 %34, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %thread-pre-split, %38
  %.01726 = phi ptr [ %41, %38 ], [ %5, %thread-pre-split ]
  %35 = phi i64 [ %40, %38 ], [ %.pr, %thread-pre-split ]
  %36 = call i64 @write(i32 noundef 1, ptr noundef %.01726, i64 noundef %35) #7
  %37 = icmp sgt i64 %36, -1
  br i1 %37, label %38, label %.thread

.thread:                                          ; preds = %.lr.ph
  call void @print_s2n_error(ptr noundef nonnull @.str.70)
  br label %.critedge

38:                                               ; preds = %.lr.ph
  %39 = load i64, ptr %6, align 8, !tbaa !9
  %40 = sub nsw i64 %39, %36
  store i64 %40, ptr %6, align 8, !tbaa !9
  %41 = getelementptr inbounds i8, ptr %.01726, i64 %36
  %42 = icmp sgt i64 %40, 0
  br i1 %42, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %38, %thread-pre-split
  %43 = load i32, ptr %31, align 4, !tbaa !5
  %44 = call i32 @s2n_error_get_type(i32 noundef %43) #7
  %.not23 = icmp eq i32 %44, 3
  br i1 %.not23, label %59, label %45

45:                                               ; preds = %._crit_edge
  %46 = load ptr, ptr @stderr, align 8, !tbaa !11
  %47 = load i32, ptr %31, align 4, !tbaa !5
  %48 = call ptr @s2n_strerror(i32 noundef %47, ptr noundef null) #7
  %49 = load i32, ptr %31, align 4, !tbaa !5
  %50 = call ptr @s2n_strerror_debug(i32 noundef %49, ptr noundef null) #7
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.71, ptr noundef %48, ptr noundef %50) #8
  %52 = load i32, ptr %31, align 4, !tbaa !5
  %53 = call i32 @s2n_error_get_type(i32 noundef %52) #7
  %54 = icmp eq i32 %53, 4
  br i1 %54, label %55, label %.critedge

55:                                               ; preds = %45
  %56 = load ptr, ptr @stderr, align 8, !tbaa !11
  %57 = call i32 @s2n_connection_get_alert(ptr noundef %0) #7
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef nonnull @.str.65, i32 noundef %57) #8
  br label %.critedge

59:                                               ; preds = %._crit_edge
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = call i32 @wait_for_event(i32 noundef %1, i32 noundef %60)
  %62 = icmp slt i32 %61, 0
  br i1 %62, label %63, label %32, !llvm.loop !15

63:                                               ; preds = %59
  call void @print_s2n_error(ptr noundef nonnull @.str.72)
  br label %.critedge

64:                                               ; preds = %32
  %65 = call i32 @print_connection_info(ptr noundef %0)
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.73)
  br label %.critedge

.critedge:                                        ; preds = %.thread, %63, %55, %45, %64, %14, %10
  %.4 = phi i32 [ -1, %10 ], [ -1, %14 ], [ 0, %64 ], [ -1, %45 ], [ -1, %55 ], [ -1, %63 ], [ -1, %.thread ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 10240, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  ret i32 %.4
}

declare i32 @s2n_renegotiate_wipe(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #1

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

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

; Function Attrs: nofree
declare noundef i64 @write(i32 noundef, ptr nocapture noundef readonly, i64 noundef) local_unnamed_addr #6

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 = { 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 = { "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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nofree "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 #7 = { nounwind }
attributes #8 = { cold 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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