; LLVM IR from aws/s2n-tls :: tests/unit (s2n_self_talk_nonblocking_test)

; 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.iovec = type { ptr, i64 }

@.str = external hidden unnamed_addr constant [9 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 allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

declare i32 @sleep(i32 noundef) #2

declare ptr @s2n_connection_new(i32 noundef) #2

declare ptr @s2n_config_new() #2

declare i32 @s2n_config_disable_x509_verification(ptr noundef) #2

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

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

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

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

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

; Function Attrs: nounwind
declare i32 @raise(i32 noundef) #3

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

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

declare i32 @s2n_connection_free(ptr noundef) #2

declare i32 @s2n_config_free(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @mock_client_iov(ptr noundef %0, ptr noundef %1, i32 noundef %2) #4 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %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
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 1, ptr %14, align 4, !tbaa !9
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %37, %3
  %23 = load i32, ptr %13, align 4, !tbaa !9
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = icmp ult i32 %23, %24
  br i1 %25, label %26, label %40

26:                                               ; preds = %22
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = load i32, ptr %13, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds %struct.iovec, ptr %27, i64 %29
  %31 = getelementptr inbounds %struct.iovec, ptr %30, i32 0, i32 1
  %32 = load i64, ptr %31, align 8, !tbaa !11
  %33 = load i32, ptr %12, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = add i64 %34, %32
  %36 = trunc i64 %35 to i32
  store i32 %36, ptr %12, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %26
  %38 = load i32, ptr %13, align 4, !tbaa !9
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %13, align 4, !tbaa !9
  br label %22, !llvm.loop !14

40:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %41 = load i32, ptr %12, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.iovec, ptr %43, i64 0
  %45 = getelementptr inbounds %struct.iovec, ptr %44, i32 0, i32 1
  %46 = load i64, ptr %45, align 8, !tbaa !11
  %47 = add i64 %42, %46
  %48 = call noalias ptr @malloc(i64 noundef %47) #7
  store ptr %48, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !9
  %49 = call i32 @sleep(i32 noundef 1)
  %50 = call ptr @s2n_connection_new(i32 noundef 1)
  store ptr %50, ptr %8, align 8, !tbaa !5
  %51 = call ptr @s2n_config_new()
  store ptr %51, ptr %9, align 8, !tbaa !5
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = call i32 @s2n_config_disable_x509_verification(ptr noundef %52)
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = call i32 @s2n_connection_set_config(ptr noundef %54, ptr noundef %55)
  br label %57

57:                                               ; preds = %40
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = call i32 @s2n_config_set_cipher_preferences(ptr noundef %58, ptr noundef @.str)
  %60 = icmp sgt i32 %59, -1
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %219

62:                                               ; preds = %57
  br label %63

63:                                               ; preds = %62
  br label %64

64:                                               ; preds = %63
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = call i32 @s2n_connection_set_io_pair(ptr noundef %65, ptr noundef %66)
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = call i32 @s2n_negotiate(ptr noundef %68, ptr noundef %10)
  store i32 %69, ptr %11, align 4, !tbaa !9
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = icmp slt i32 %70, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %64
  store i32 1, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %219

73:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %74 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %74, ptr %18, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %116, %73
  %76 = load i32, ptr %18, align 4, !tbaa !9
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %117

78:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = load ptr, ptr %15, align 8, !tbaa !5
  %81 = load i32, ptr %16, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i8, ptr %80, i64 %82
  %84 = load i32, ptr %18, align 4, !tbaa !9
  %85 = zext i32 %84 to i64
  %86 = call i64 @s2n_recv(ptr noundef %79, ptr noundef %83, i64 noundef %85, ptr noundef %10)
  %87 = trunc i64 %86 to i32
  store i32 %87, ptr %19, align 4, !tbaa !9
  %88 = load i32, ptr %19, align 4, !tbaa !9
  %89 = icmp slt i32 %88, 0
  br i1 %89, label %90, label %91

90:                                               ; preds = %78
  store i32 1, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %114

91:                                               ; preds = %78
  %92 = load i32, ptr %19, align 4, !tbaa !9
  %93 = load i32, ptr %18, align 4, !tbaa !9
  %94 = sub i32 %93, %92
  store i32 %94, ptr %18, align 4, !tbaa !9
  %95 = load i32, ptr %19, align 4, !tbaa !9
  %96 = load i32, ptr %16, align 4, !tbaa !9
  %97 = add nsw i32 %96, %95
  store i32 %97, ptr %16, align 4, !tbaa !9
  %98 = load i32, ptr %14, align 4, !tbaa !9
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %113

100:                                              ; preds = %91
  %101 = load i32, ptr %12, align 4, !tbaa !9
  %102 = load i32, ptr %18, align 4, !tbaa !9
  %103 = sub i32 %101, %102
  %104 = uitofp i32 %103 to double
  %105 = load i32, ptr %12, align 4, !tbaa !9
  %106 = sitofp i32 %105 to double
  %107 = fmul double %106, 1.000000e+00
  %108 = fdiv double %104, %107
  %109 = fmul double %108, 1.000000e+02
  %110 = fcmp ogt double %109, 5.000000e+00
  br i1 %110, label %111, label %113

111:                                              ; preds = %100
  %112 = call i32 @raise(i32 noundef 19) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %113

113:                                              ; preds = %111, %100, %91
  store i32 0, ptr %17, align 4
  br label %114

114:                                              ; preds = %113, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %115 = load i32, ptr %17, align 4
  switch i32 %115, label %218 [
    i32 0, label %116
  ]

116:                                              ; preds = %114
  br label %75, !llvm.loop !16

117:                                              ; preds = %75
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.iovec, ptr %118, i64 0
  %120 = getelementptr inbounds %struct.iovec, ptr %119, i32 0, i32 1
  %121 = load i64, ptr %120, align 8, !tbaa !11
  %122 = trunc i64 %121 to i32
  store i32 %122, ptr %18, align 4, !tbaa !9
  br label %123

123:                                              ; preds = %148, %117
  %124 = load i32, ptr %18, align 4, !tbaa !9
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %149

126:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = load ptr, ptr %15, align 8, !tbaa !5
  %129 = load i32, ptr %16, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i8, ptr %128, i64 %130
  %132 = load i32, ptr %18, align 4, !tbaa !9
  %133 = zext i32 %132 to i64
  %134 = call i64 @s2n_recv(ptr noundef %127, ptr noundef %131, i64 noundef %133, ptr noundef %10)
  %135 = trunc i64 %134 to i32
  store i32 %135, ptr %20, align 4, !tbaa !9
  %136 = load i32, ptr %20, align 4, !tbaa !9
  %137 = icmp slt i32 %136, 0
  br i1 %137, label %138, label %139

138:                                              ; preds = %126
  store i32 1, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %146

139:                                              ; preds = %126
  %140 = load i32, ptr %20, align 4, !tbaa !9
  %141 = load i32, ptr %18, align 4, !tbaa !9
  %142 = sub i32 %141, %140
  store i32 %142, ptr %18, align 4, !tbaa !9
  %143 = load i32, ptr %20, align 4, !tbaa !9
  %144 = load i32, ptr %16, align 4, !tbaa !9
  %145 = add nsw i32 %144, %143
  store i32 %145, ptr %16, align 4, !tbaa !9
  store i32 0, ptr %17, align 4
  br label %146

146:                                              ; preds = %139, %138
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  %147 = load i32, ptr %17, align 4
  switch i32 %147, label %218 [
    i32 0, label %148
  ]

148:                                              ; preds = %146
  br label %123, !llvm.loop !17

149:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 -1, ptr %21, align 4, !tbaa !9
  br label %150

150:                                              ; preds = %153, %149
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = call i32 @s2n_shutdown(ptr noundef %151, ptr noundef %10)
  store i32 %152, ptr %21, align 4, !tbaa !9
  br label %153

153:                                              ; preds = %150
  %154 = load i32, ptr %21, align 4, !tbaa !9
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %150, label %156, !llvm.loop !18

156:                                              ; preds = %153
  store i32 0, ptr %13, align 4, !tbaa !9
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %157

157:                                              ; preds = %192, %156
  %158 = load i32, ptr %13, align 4, !tbaa !9
  %159 = load i32, ptr %7, align 4, !tbaa !9
  %160 = icmp ult i32 %158, %159
  br i1 %160, label %161, label %195

161:                                              ; preds = %157
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = load i32, ptr %13, align 4, !tbaa !9
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds %struct.iovec, ptr %162, i64 %164
  %166 = getelementptr inbounds %struct.iovec, ptr %165, i32 0, i32 0
  %167 = load ptr, ptr %166, align 8, !tbaa !19
  %168 = load ptr, ptr %15, align 8, !tbaa !5
  %169 = load i32, ptr %16, align 4, !tbaa !9
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds i8, ptr %168, i64 %170
  %172 = load ptr, ptr %6, align 8, !tbaa !5
  %173 = load i32, ptr %13, align 4, !tbaa !9
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds %struct.iovec, ptr %172, i64 %174
  %176 = getelementptr inbounds %struct.iovec, ptr %175, i32 0, i32 1
  %177 = load i64, ptr %176, align 8, !tbaa !11
  %178 = call i32 @memcmp(ptr noundef %167, ptr noundef %171, i64 noundef %177) #8
  %179 = icmp ne i32 %178, 0
  br i1 %179, label %180, label %181

180:                                              ; preds = %161
  store i32 1, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %217

181:                                              ; preds = %161
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = load i32, ptr %13, align 4, !tbaa !9
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds %struct.iovec, ptr %182, i64 %184
  %186 = getelementptr inbounds %struct.iovec, ptr %185, i32 0, i32 1
  %187 = load i64, ptr %186, align 8, !tbaa !11
  %188 = load i32, ptr %16, align 4, !tbaa !9
  %189 = sext i32 %188 to i64
  %190 = add i64 %189, %187
  %191 = trunc i64 %190 to i32
  store i32 %191, ptr %16, align 4, !tbaa !9
  br label %192

192:                                              ; preds = %181
  %193 = load i32, ptr %13, align 4, !tbaa !9
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %13, align 4, !tbaa !9
  br label %157, !llvm.loop !20

195:                                              ; preds = %157
  %196 = load ptr, ptr %6, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.iovec, ptr %196, i64 0
  %198 = getelementptr inbounds %struct.iovec, ptr %197, i32 0, i32 0
  %199 = load ptr, ptr %198, align 8, !tbaa !19
  %200 = load ptr, ptr %15, align 8, !tbaa !5
  %201 = load i32, ptr %16, align 4, !tbaa !9
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds i8, ptr %200, i64 %202
  %204 = load ptr, ptr %6, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.iovec, ptr %204, i64 0
  %206 = getelementptr inbounds %struct.iovec, ptr %205, i32 0, i32 1
  %207 = load i64, ptr %206, align 8, !tbaa !11
  %208 = call i32 @memcmp(ptr noundef %199, ptr noundef %203, i64 noundef %207) #8
  %209 = icmp ne i32 %208, 0
  br i1 %209, label %210, label %211

210:                                              ; preds = %195
  store i32 1, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %217

211:                                              ; preds = %195
  %212 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %212) #6
  %213 = load ptr, ptr %8, align 8, !tbaa !5
  %214 = call i32 @s2n_connection_free(ptr noundef %213)
  %215 = load ptr, ptr %9, align 8, !tbaa !5
  %216 = call i32 @s2n_config_free(ptr noundef %215)
  store i32 0, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %217

217:                                              ; preds = %211, %210, %180
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %218

218:                                              ; preds = %217, %146, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %219

219:                                              ; preds = %218, %72, %61
  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 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, 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
  %220 = load i32, ptr %4, align 4
  ret i32 %220
}

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 "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 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }
attributes #8 = { 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, !13, i64 8}
!12 = !{!"iovec", !6, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}
!19 = !{!12, !6, i64 0}
!20 = distinct !{!20, !15}


; 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.iovec = type { ptr, i64 }

@.str = external hidden unnamed_addr constant [9 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: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

declare i32 @sleep(i32 noundef) local_unnamed_addr #2

declare ptr @s2n_connection_new(i32 noundef) local_unnamed_addr #2

declare ptr @s2n_config_new() local_unnamed_addr #2

declare i32 @s2n_config_disable_x509_verification(ptr noundef) local_unnamed_addr #2

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

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

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

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

declare i64 @s2n_recv(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @raise(i32 noundef) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

declare i32 @s2n_connection_free(ptr noundef) local_unnamed_addr #2

declare i32 @s2n_config_free(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @mock_client_iov(ptr noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #5 {
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %.not115 = icmp eq i32 %2, 0
  br i1 %.not115, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %3
  %wide.trip.count = zext i32 %2 to i64
  %min.iters.check = icmp ult i32 %2, 5
  br i1 %min.iters.check, label %.lr.ph.preheader141, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.mod.vf = and i64 %wide.trip.count, 3
  %5 = icmp eq i64 %n.mod.vf, 0
  %6 = select i1 %5, i64 4, i64 %n.mod.vf
  %n.vec = sub nsw i64 %wide.trip.count, %6
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ]
  %vec.phi135 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
  %7 = or disjoint i64 %index, 2
  %8 = getelementptr inbounds %struct.iovec, ptr %1, i64 %index, i32 1
  %9 = getelementptr inbounds %struct.iovec, ptr %1, i64 %7, i32 1
  %wide.vec = load <4 x i64>, ptr %8, align 8, !tbaa !5
  %wide.vec136 = load <4 x i64>, ptr %9, align 8, !tbaa !5
  %strided.vec = shufflevector <4 x i64> %wide.vec, <4 x i64> poison, <2 x i32> <i32 0, i32 2>
  %strided.vec137 = shufflevector <4 x i64> %wide.vec136, <4 x i64> poison, <2 x i32> <i32 0, i32 2>
  %10 = trunc <2 x i64> %strided.vec to <2 x i32>
  %11 = trunc <2 x i64> %strided.vec137 to <2 x i32>
  %12 = add <2 x i32> %vec.phi, %10
  %13 = add <2 x i32> %vec.phi135, %11
  %index.next = add nuw i64 %index, 4
  %14 = icmp eq i64 %index.next, %n.vec
  br i1 %14, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i32> %13, %12
  %15 = tail call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx)
  br label %.lr.ph.preheader141

.lr.ph.preheader141:                              ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %.082101.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %15, %middle.block ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader141, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader141 ]
  %.082101 = phi i32 [ %19, %.lr.ph ], [ %.082101.ph, %.lr.ph.preheader141 ]
  %16 = getelementptr inbounds %struct.iovec, ptr %1, i64 %indvars.iv, i32 1
  %17 = load i64, ptr %16, align 8, !tbaa !5
  %18 = trunc i64 %17 to i32
  %19 = add i32 %.082101, %18
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph, %3
  %.082.lcssa = phi i32 [ 0, %3 ], [ %19, %.lr.ph ]
  %20 = sext i32 %.082.lcssa to i64
  %21 = getelementptr inbounds i8, ptr %1, i64 8
  %22 = load i64, ptr %21, align 8, !tbaa !5
  %23 = add i64 %22, %20
  %24 = tail call noalias ptr @malloc(i64 noundef %23) #9
  %25 = tail call i32 @sleep(i32 noundef 1) #8
  %26 = tail call ptr @s2n_connection_new(i32 noundef 1) #8
  %27 = tail call ptr @s2n_config_new() #8
  %28 = tail call i32 @s2n_config_disable_x509_verification(ptr noundef %27) #8
  %29 = tail call i32 @s2n_connection_set_config(ptr noundef %26, ptr noundef %27) #8
  %30 = tail call i32 @s2n_config_set_cipher_preferences(ptr noundef %27, ptr noundef nonnull @.str) #8
  %31 = icmp sgt i32 %30, -1
  br i1 %31, label %32, label %.thread

32:                                               ; preds = %._crit_edge
  %33 = tail call i32 @s2n_connection_set_io_pair(ptr noundef %26, ptr noundef %0) #8
  %34 = call i32 @s2n_negotiate(ptr noundef %26, ptr noundef nonnull %4) #8
  %35 = icmp slt i32 %34, 0
  br i1 %35, label %.thread, label %.preheader97

.preheader97:                                     ; preds = %32
  %.not103 = icmp eq i32 %.082.lcssa, 0
  br i1 %.not103, label %._crit_edge108, label %.lr.ph107

.lr.ph107:                                        ; preds = %.preheader97
  %36 = sitofp i32 %.082.lcssa to double
  br label %37

37:                                               ; preds = %.lr.ph107, %55
  %.066106 = phi i32 [ %.082.lcssa, %.lr.ph107 ], [ %45, %55 ]
  %.072105 = phi i32 [ 0, %.lr.ph107 ], [ %46, %55 ]
  %.077104 = phi i32 [ 1, %.lr.ph107 ], [ %.279, %55 ]
  %38 = zext nneg i32 %.072105 to i64
  %39 = getelementptr inbounds i8, ptr %24, i64 %38
  %40 = zext i32 %.066106 to i64
  %41 = call i64 @s2n_recv(ptr noundef %26, ptr noundef %39, i64 noundef %40, ptr noundef nonnull %4) #8
  %42 = trunc i64 %41 to i32
  %43 = icmp sgt i32 %42, -1
  br i1 %43, label %44, label %.thread

44:                                               ; preds = %37
  %45 = sub i32 %.066106, %42
  %46 = add nuw nsw i32 %.072105, %42
  %.not91 = icmp eq i32 %.077104, 0
  br i1 %.not91, label %55, label %47

47:                                               ; preds = %44
  %48 = sub i32 %.082.lcssa, %45
  %49 = uitofp i32 %48 to double
  %50 = fdiv double %49, %36
  %51 = fmul double %50, 1.000000e+02
  %52 = fcmp ogt double %51, 5.000000e+00
  br i1 %52, label %53, label %55

53:                                               ; preds = %47
  %54 = call i32 @raise(i32 noundef 19) #8
  br label %55

55:                                               ; preds = %44, %47, %53
  %.279 = phi i32 [ 0, %53 ], [ 1, %47 ], [ 0, %44 ]
  %.not = icmp eq i32 %45, 0
  br i1 %.not, label %._crit_edge108, label %37, !llvm.loop !16

._crit_edge108:                                   ; preds = %55, %.preheader97
  %.072.lcssa = phi i32 [ 0, %.preheader97 ], [ %46, %55 ]
  %56 = load i64, ptr %21, align 8, !tbaa !5
  %57 = trunc i64 %56 to i32
  br label %58

58:                                               ; preds = %59, %._crit_edge108
  %.274 = phi i32 [ %.072.lcssa, %._crit_edge108 ], [ %67, %59 ]
  %.268 = phi i32 [ %57, %._crit_edge108 ], [ %66, %59 ]
  %.not86 = icmp eq i32 %.268, 0
  br i1 %.not86, label %.preheader95, label %59

59:                                               ; preds = %58
  %60 = zext nneg i32 %.274 to i64
  %61 = getelementptr inbounds i8, ptr %24, i64 %60
  %62 = zext i32 %.268 to i64
  %63 = call i64 @s2n_recv(ptr noundef %26, ptr noundef %61, i64 noundef %62, ptr noundef nonnull %4) #8
  %64 = trunc i64 %63 to i32
  %65 = icmp sgt i32 %64, -1
  %66 = sub i32 %.268, %64
  %67 = add nuw nsw i32 %.274, %64
  br i1 %65, label %58, label %.thread, !llvm.loop !17

.preheader95:                                     ; preds = %58, %.preheader95
  %68 = call i32 @s2n_shutdown(ptr noundef %26, ptr noundef nonnull %4) #8
  %.not87 = icmp eq i32 %68, 0
  br i1 %.not87, label %.preheader, label %.preheader95, !llvm.loop !18

.preheader:                                       ; preds = %.preheader95
  br i1 %.not115, label %._crit_edge113, label %.lr.ph112.preheader

.lr.ph112.preheader:                              ; preds = %.preheader
  %wide.trip.count125 = zext i32 %2 to i64
  br label %.lr.ph112

.lr.ph112:                                        ; preds = %.lr.ph112.preheader, %75
  %indvars.iv122 = phi i64 [ 0, %.lr.ph112.preheader ], [ %indvars.iv.next123, %75 ]
  %.476111 = phi i32 [ 0, %.lr.ph112.preheader ], [ %77, %75 ]
  %69 = getelementptr inbounds %struct.iovec, ptr %1, i64 %indvars.iv122
  %70 = load ptr, ptr %69, align 8, !tbaa !19
  %71 = sext i32 %.476111 to i64
  %72 = getelementptr inbounds i8, ptr %24, i64 %71
  %73 = getelementptr inbounds i8, ptr %69, i64 8
  %74 = load i64, ptr %73, align 8, !tbaa !5
  %bcmp89 = call i32 @bcmp(ptr %70, ptr %72, i64 %74)
  %.not90 = icmp eq i32 %bcmp89, 0
  br i1 %.not90, label %75, label %.thread

75:                                               ; preds = %.lr.ph112
  %76 = trunc i64 %74 to i32
  %77 = add i32 %.476111, %76
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %exitcond126.not = icmp eq i64 %indvars.iv.next123, %wide.trip.count125
  br i1 %exitcond126.not, label %._crit_edge113.loopexit, label %.lr.ph112, !llvm.loop !20

._crit_edge113.loopexit:                          ; preds = %75
  %78 = sext i32 %77 to i64
  br label %._crit_edge113

._crit_edge113:                                   ; preds = %._crit_edge113.loopexit, %.preheader
  %.476.lcssa = phi i64 [ 0, %.preheader ], [ %78, %._crit_edge113.loopexit ]
  %79 = load ptr, ptr %1, align 8, !tbaa !19
  %80 = getelementptr inbounds i8, ptr %24, i64 %.476.lcssa
  %81 = load i64, ptr %21, align 8, !tbaa !5
  %bcmp = call i32 @bcmp(ptr %79, ptr %80, i64 %81)
  %.not88 = icmp eq i32 %bcmp, 0
  br i1 %.not88, label %82, label %.thread

82:                                               ; preds = %._crit_edge113
  call void @free(ptr noundef %24) #8
  %83 = call i32 @s2n_connection_free(ptr noundef %26) #8
  %84 = call i32 @s2n_config_free(ptr noundef %27) #8
  br label %.thread

.thread:                                          ; preds = %37, %59, %.lr.ph112, %._crit_edge113, %82, %32, %._crit_edge
  %.6 = phi i32 [ -1, %._crit_edge ], [ 1, %32 ], [ 0, %82 ], [ 1, %._crit_edge113 ], [ 1, %.lr.ph112 ], [ 1, %59 ], [ 1, %37 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  ret i32 %.6
}

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v2i32(<2 x i32>) #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 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 #6 = { nofree nounwind willreturn memory(argmem: read) }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }

!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, !10, i64 8}
!6 = !{!"iovec", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !14, !13}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = !{!6, !7, i64 0}
!20 = distinct !{!20, !12}


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