; LLVM IR from microsoft/ntttcp-for-linux :: src (ntttcp)

; 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.timeval = type { i64, i64 }
%struct.ntttcp_test_endpoint = type { i32, ptr, i32, i32, %struct.timeval, %struct.timeval, i32, i32, i8, ptr, ptr, ptr, i8, ptr, i32, [8 x i32] }
%struct.ntttcp_test = type { i8, i8, i8, i8, i8, i8, i8, ptr, i32, i32, ptr, i32, i32, i8, i32, i32, i32, i32, i64, i64, i64, i64, i32, i32, i32, i8, ptr, ptr, i8, ptr, i8, ptr, i8, ptr, i8, i8 }
%struct.ntttcp_test_endpoint_results = type { ptr, i64, double, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64, i64, i64, ptr, double, double, double, double, double, double, double, double, double, double, double, double, double, double, i64, double, double, double, double, double, double, i64, i64, i64, double, i32, i32 }
%struct.ntttcp_test_endpoint_thread_result = type { i8, i64, double, double, double, double }

; 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

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @is_running_tty() #3

; Function Attrs: nounwind uwtable
define dso_local ptr @new_ntttcp_test_endpoint(ptr noundef %0, i32 noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.timeval, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  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 8, ptr %9) #6
  %11 = call noalias ptr @malloc(i64 noundef 152) #7
  store ptr %11, ptr %9, align 8, !tbaa !5
  %12 = load ptr, ptr %9, align 8, !tbaa !5
  %13 = icmp ne ptr %12, null
  br i1 %13, label %15, label %14

14:                                               ; preds = %2
  store ptr null, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %362

15:                                               ; preds = %2
  %16 = call i32 @gettimeofday(ptr noundef %7, ptr noundef null) #6
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %17, i8 0, i64 152, i1 false)
  %18 = load i32, ptr %5, align 4, !tbaa !9
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %19, i32 0, i32 0
  store i32 %18, ptr %20, align 8, !tbaa !11
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %22, i32 0, i32 1
  store ptr %21, ptr %23, align 8, !tbaa !16
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %24, i32 0, i32 2
  store i32 11, ptr %25, align 8, !tbaa !17
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.ntttcp_test, ptr %26, i32 0, i32 6
  %28 = load i8, ptr %27, align 2, !tbaa !18, !range !20, !noundef !21
  %29 = trunc i8 %28 to i1
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %30, i32 0, i32 8
  %32 = zext i1 %29 to i8
  store i8 %32, ptr %31, align 8, !tbaa !22
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ntttcp_test, ptr %33, i32 0, i32 22
  %35 = load i32, ptr %34, align 8, !tbaa !23
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.ntttcp_test, ptr %36, i32 0, i32 23
  %38 = load i32, ptr %37, align 4, !tbaa !24
  %39 = add nsw i32 %35, %38
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.ntttcp_test, ptr %40, i32 0, i32 24
  %42 = load i32, ptr %41, align 8, !tbaa !25
  %43 = add nsw i32 %39, %42
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %44, i32 0, i32 3
  store i32 %43, ptr %45, align 4, !tbaa !26
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %46, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %47, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !27
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %48, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %49, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !27
  %50 = call zeroext i1 @is_running_tty()
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %51, i32 0, i32 12
  %53 = zext i1 %50 to i8
  store i8 %53, ptr %52, align 8, !tbaa !29
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %54, i32 0, i32 6
  store i32 0, ptr %55, align 8, !tbaa !30
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %56, i32 0, i32 14
  store i32 0, ptr %57, align 8, !tbaa !31
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %67, %15
  %59 = load i32, ptr %6, align 4, !tbaa !9
  %60 = icmp ult i32 %59, 8
  br i1 %60, label %61, label %70

61:                                               ; preds = %58
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %62, i32 0, i32 15
  %64 = load i32, ptr %6, align 4, !tbaa !9
  %65 = zext i32 %64 to i64
  %66 = getelementptr inbounds [8 x i32], ptr %63, i64 0, i64 %65
  store i32 -1, ptr %66, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %61
  %68 = load i32, ptr %6, align 4, !tbaa !9
  %69 = add i32 %68, 1
  store i32 %69, ptr %6, align 4, !tbaa !9
  br label %58, !llvm.loop !32

70:                                               ; preds = %58
  %71 = load i32, ptr %5, align 4, !tbaa !9
  %72 = icmp eq i32 %71, 1
  br i1 %72, label %73, label %152

73:                                               ; preds = %70
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.ntttcp_test, ptr %74, i32 0, i32 8
  %76 = load i32, ptr %75, align 8, !tbaa !34
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.ntttcp_test, ptr %77, i32 0, i32 11
  %79 = load i32, ptr %78, align 8, !tbaa !35
  %80 = mul i32 %76, %79
  store i32 %80, ptr %8, align 4, !tbaa !9
  %81 = load i32, ptr %8, align 4, !tbaa !9
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %82, i32 0, i32 7
  store i32 %81, ptr %83, align 4, !tbaa !36
  %84 = load i32, ptr %8, align 4, !tbaa !9
  %85 = zext i32 %84 to i64
  %86 = mul i64 8, %85
  %87 = call noalias ptr @malloc(i64 noundef %86) #7
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %88, i32 0, i32 9
  store ptr %87, ptr %89, align 8, !tbaa !37
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %90, i32 0, i32 9
  %92 = load ptr, ptr %91, align 8, !tbaa !37
  %93 = icmp ne ptr %92, null
  br i1 %93, label %96, label %94

94:                                               ; preds = %73
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %95) #6
  store ptr null, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %362

96:                                               ; preds = %73
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %97, i32 0, i32 9
  %99 = load ptr, ptr %98, align 8, !tbaa !37
  %100 = load i32, ptr %8, align 4, !tbaa !9
  %101 = zext i32 %100 to i64
  %102 = mul i64 8, %101
  call void @llvm.memset.p0.i64(ptr align 8 %99, i8 0, i64 %102, i1 false)
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %103

103:                                              ; preds = %116, %96
  %104 = load i32, ptr %6, align 4, !tbaa !9
  %105 = load i32, ptr %8, align 4, !tbaa !9
  %106 = icmp ult i32 %104, %105
  br i1 %106, label %107, label %119

107:                                              ; preds = %103
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = call ptr @new_ntttcp_client_stream(ptr noundef %108)
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %110, i32 0, i32 9
  %112 = load ptr, ptr %111, align 8, !tbaa !37
  %113 = load i32, ptr %6, align 4, !tbaa !9
  %114 = zext i32 %113 to i64
  %115 = getelementptr inbounds ptr, ptr %112, i64 %114
  store ptr %109, ptr %115, align 8, !tbaa !5
  br label %116

116:                                              ; preds = %107
  %117 = load i32, ptr %6, align 4, !tbaa !9
  %118 = add i32 %117, 1
  store i32 %118, ptr %6, align 4, !tbaa !9
  br label %103, !llvm.loop !38

119:                                              ; preds = %103
  %120 = load i32, ptr %8, align 4, !tbaa !9
  %121 = zext i32 %120 to i64
  %122 = mul i64 %121, 8
  %123 = call noalias ptr @malloc(i64 noundef %122) #7
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %124, i32 0, i32 11
  store ptr %123, ptr %125, align 8, !tbaa !39
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %126, i32 0, i32 11
  %128 = load ptr, ptr %127, align 8, !tbaa !39
  %129 = icmp ne ptr %128, null
  br i1 %129, label %151, label %130

130:                                              ; preds = %119
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %131

131:                                              ; preds = %143, %130
  %132 = load i32, ptr %6, align 4, !tbaa !9
  %133 = load i32, ptr %8, align 4, !tbaa !9
  %134 = icmp ult i32 %132, %133
  br i1 %134, label %135, label %146

135:                                              ; preds = %131
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %136, i32 0, i32 9
  %138 = load ptr, ptr %137, align 8, !tbaa !37
  %139 = load i32, ptr %6, align 4, !tbaa !9
  %140 = zext i32 %139 to i64
  %141 = getelementptr inbounds ptr, ptr %138, i64 %140
  %142 = load ptr, ptr %141, align 8, !tbaa !5
  call void @free(ptr noundef %142) #6
  br label %143

143:                                              ; preds = %135
  %144 = load i32, ptr %6, align 4, !tbaa !9
  %145 = add i32 %144, 1
  store i32 %145, ptr %6, align 4, !tbaa !9
  br label %131, !llvm.loop !40

146:                                              ; preds = %131
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %147, i32 0, i32 9
  %149 = load ptr, ptr %148, align 8, !tbaa !37
  call void @free(ptr noundef %149) #6
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %150) #6
  store ptr null, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %362

151:                                              ; preds = %119
  br label %240

152:                                              ; preds = %70
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.ntttcp_test, ptr %153, i32 0, i32 13
  %155 = load i8, ptr %154, align 8, !tbaa !41, !range !20, !noundef !21
  %156 = trunc i8 %155 to i1
  %157 = zext i1 %156 to i32
  %158 = icmp eq i32 %157, 1
  br i1 %158, label %159, label %163

159:                                              ; preds = %152
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.ntttcp_test, ptr %160, i32 0, i32 8
  %162 = load i32, ptr %161, align 8, !tbaa !34
  store i32 %162, ptr %8, align 4, !tbaa !9
  br label %168

163:                                              ; preds = %152
  %164 = load ptr, ptr %4, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.ntttcp_test, ptr %164, i32 0, i32 8
  %166 = load i32, ptr %165, align 8, !tbaa !34
  %167 = add i32 %166, 1
  store i32 %167, ptr %8, align 4, !tbaa !9
  br label %168

168:                                              ; preds = %163, %159
  %169 = load i32, ptr %8, align 4, !tbaa !9
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %170, i32 0, i32 7
  store i32 %169, ptr %171, align 4, !tbaa !36
  %172 = load i32, ptr %8, align 4, !tbaa !9
  %173 = zext i32 %172 to i64
  %174 = mul i64 8, %173
  %175 = call noalias ptr @malloc(i64 noundef %174) #7
  %176 = load ptr, ptr %9, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %176, i32 0, i32 10
  store ptr %175, ptr %177, align 8, !tbaa !42
  %178 = load ptr, ptr %9, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %178, i32 0, i32 10
  %180 = load ptr, ptr %179, align 8, !tbaa !42
  %181 = icmp ne ptr %180, null
  br i1 %181, label %184, label %182

182:                                              ; preds = %168
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %183) #6
  store ptr null, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %362

184:                                              ; preds = %168
  %185 = load ptr, ptr %9, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %185, i32 0, i32 10
  %187 = load ptr, ptr %186, align 8, !tbaa !42
  %188 = load i32, ptr %8, align 4, !tbaa !9
  %189 = zext i32 %188 to i64
  %190 = mul i64 8, %189
  call void @llvm.memset.p0.i64(ptr align 8 %187, i8 0, i64 %190, i1 false)
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %191

191:                                              ; preds = %204, %184
  %192 = load i32, ptr %6, align 4, !tbaa !9
  %193 = load i32, ptr %8, align 4, !tbaa !9
  %194 = icmp ult i32 %192, %193
  br i1 %194, label %195, label %207

195:                                              ; preds = %191
  %196 = load ptr, ptr %9, align 8, !tbaa !5
  %197 = call ptr @new_ntttcp_server_stream(ptr noundef %196)
  %198 = load ptr, ptr %9, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %198, i32 0, i32 10
  %200 = load ptr, ptr %199, align 8, !tbaa !42
  %201 = load i32, ptr %6, align 4, !tbaa !9
  %202 = zext i32 %201 to i64
  %203 = getelementptr inbounds ptr, ptr %200, i64 %202
  store ptr %197, ptr %203, align 8, !tbaa !5
  br label %204

204:                                              ; preds = %195
  %205 = load i32, ptr %6, align 4, !tbaa !9
  %206 = add i32 %205, 1
  store i32 %206, ptr %6, align 4, !tbaa !9
  br label %191, !llvm.loop !43

207:                                              ; preds = %191
  %208 = load i32, ptr %8, align 4, !tbaa !9
  %209 = zext i32 %208 to i64
  %210 = mul i64 %209, 8
  %211 = call noalias ptr @malloc(i64 noundef %210) #7
  %212 = load ptr, ptr %9, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %212, i32 0, i32 11
  store ptr %211, ptr %213, align 8, !tbaa !39
  %214 = load ptr, ptr %9, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %214, i32 0, i32 11
  %216 = load ptr, ptr %215, align 8, !tbaa !39
  %217 = icmp ne ptr %216, null
  br i1 %217, label %239, label %218

218:                                              ; preds = %207
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %219

219:                                              ; preds = %231, %218
  %220 = load i32, ptr %6, align 4, !tbaa !9
  %221 = load i32, ptr %8, align 4, !tbaa !9
  %222 = icmp ult i32 %220, %221
  br i1 %222, label %223, label %234

223:                                              ; preds = %219
  %224 = load ptr, ptr %9, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %224, i32 0, i32 10
  %226 = load ptr, ptr %225, align 8, !tbaa !42
  %227 = load i32, ptr %6, align 4, !tbaa !9
  %228 = zext i32 %227 to i64
  %229 = getelementptr inbounds ptr, ptr %226, i64 %228
  %230 = load ptr, ptr %229, align 8, !tbaa !5
  call void @free(ptr noundef %230) #6
  br label %231

231:                                              ; preds = %223
  %232 = load i32, ptr %6, align 4, !tbaa !9
  %233 = add i32 %232, 1
  store i32 %233, ptr %6, align 4, !tbaa !9
  br label %219, !llvm.loop !44

234:                                              ; preds = %219
  %235 = load ptr, ptr %9, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %235, i32 0, i32 10
  %237 = load ptr, ptr %236, align 8, !tbaa !42
  call void @free(ptr noundef %237) #6
  %238 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %238) #6
  store ptr null, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %362

239:                                              ; preds = %207
  br label %240

240:                                              ; preds = %239, %151
  %241 = call noalias ptr @malloc(i64 noundef 336) #7
  %242 = load ptr, ptr %9, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %242, i32 0, i32 13
  store ptr %241, ptr %243, align 8, !tbaa !45
  %244 = load ptr, ptr %9, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %244, i32 0, i32 13
  %246 = load ptr, ptr %245, align 8, !tbaa !45
  call void @llvm.memset.p0.i64(ptr align 8 %246, i8 0, i64 336, i1 false)
  %247 = load ptr, ptr %9, align 8, !tbaa !5
  %248 = load ptr, ptr %9, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %248, i32 0, i32 13
  %250 = load ptr, ptr %249, align 8, !tbaa !45
  %251 = getelementptr inbounds %struct.ntttcp_test_endpoint_results, ptr %250, i32 0, i32 0
  store ptr %247, ptr %251, align 8, !tbaa !46
  %252 = load ptr, ptr %9, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %252, i32 0, i32 13
  %254 = load ptr, ptr %253, align 8, !tbaa !45
  %255 = getelementptr inbounds %struct.ntttcp_test_endpoint_results, ptr %254, i32 0, i32 42
  store i32 -1, ptr %255, align 4, !tbaa !49
  %256 = load i32, ptr %8, align 4, !tbaa !9
  %257 = zext i32 %256 to i64
  %258 = mul i64 8, %257
  %259 = call noalias ptr @malloc(i64 noundef %258) #7
  %260 = load ptr, ptr %9, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %260, i32 0, i32 13
  %262 = load ptr, ptr %261, align 8, !tbaa !45
  %263 = getelementptr inbounds %struct.ntttcp_test_endpoint_results, ptr %262, i32 0, i32 15
  store ptr %259, ptr %263, align 8, !tbaa !50
  %264 = load ptr, ptr %9, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %264, i32 0, i32 13
  %266 = load ptr, ptr %265, align 8, !tbaa !45
  %267 = getelementptr inbounds %struct.ntttcp_test_endpoint_results, ptr %266, i32 0, i32 15
  %268 = load ptr, ptr %267, align 8, !tbaa !50
  %269 = load i32, ptr %8, align 4, !tbaa !9
  %270 = zext i32 %269 to i64
  %271 = mul i64 8, %270
  call void @llvm.memset.p0.i64(ptr align 8 %268, i8 0, i64 %271, i1 false)
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %272

272:                                              ; preds = %327, %240
  %273 = load i32, ptr %6, align 4, !tbaa !9
  %274 = load i32, ptr %8, align 4, !tbaa !9
  %275 = icmp ult i32 %273, %274
  br i1 %275, label %276, label %330

276:                                              ; preds = %272
  %277 = call noalias ptr @malloc(i64 noundef 48) #7
  %278 = load ptr, ptr %9, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %278, i32 0, i32 13
  %280 = load ptr, ptr %279, align 8, !tbaa !45
  %281 = getelementptr inbounds %struct.ntttcp_test_endpoint_results, ptr %280, i32 0, i32 15
  %282 = load ptr, ptr %281, align 8, !tbaa !50
  %283 = load i32, ptr %6, align 4, !tbaa !9
  %284 = zext i32 %283 to i64
  %285 = getelementptr inbounds ptr, ptr %282, i64 %284
  store ptr %277, ptr %285, align 8, !tbaa !5
  %286 = load i32, ptr %6, align 4, !tbaa !9
  %287 = load i32, ptr %8, align 4, !tbaa !9
  %288 = sub i32 %287, 1
  %289 = icmp eq i32 %286, %288
  br i1 %289, label %290, label %315

290:                                              ; preds = %276
  %291 = load ptr, ptr %9, align 8, !tbaa !5
  %292 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %291, i32 0, i32 0
  %293 = load i32, ptr %292, align 8, !tbaa !11
  %294 = icmp eq i32 %293, 2
  br i1 %294, label %295, label %315

295:                                              ; preds = %290
  %296 = load ptr, ptr %9, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %296, i32 0, i32 1
  %298 = load ptr, ptr %297, align 8, !tbaa !16
  %299 = getelementptr inbounds %struct.ntttcp_test, ptr %298, i32 0, i32 13
  %300 = load i8, ptr %299, align 8, !tbaa !41, !range !20, !noundef !21
  %301 = trunc i8 %300 to i1
  %302 = zext i1 %301 to i32
  %303 = icmp eq i32 %302, 0
  br i1 %303, label %304, label %315

304:                                              ; preds = %295
  %305 = load ptr, ptr %9, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %305, i32 0, i32 13
  %307 = load ptr, ptr %306, align 8, !tbaa !45
  %308 = getelementptr inbounds %struct.ntttcp_test_endpoint_results, ptr %307, i32 0, i32 15
  %309 = load ptr, ptr %308, align 8, !tbaa !50
  %310 = load i32, ptr %6, align 4, !tbaa !9
  %311 = zext i32 %310 to i64
  %312 = getelementptr inbounds ptr, ptr %309, i64 %311
  %313 = load ptr, ptr %312, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.ntttcp_test_endpoint_thread_result, ptr %313, i32 0, i32 0
  store i8 1, ptr %314, align 8, !tbaa !51
  br label %326

315:                                              ; preds = %295, %290, %276
  %316 = load ptr, ptr %9, align 8, !tbaa !5
  %317 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %316, i32 0, i32 13
  %318 = load ptr, ptr %317, align 8, !tbaa !45
  %319 = getelementptr inbounds %struct.ntttcp_test_endpoint_results, ptr %318, i32 0, i32 15
  %320 = load ptr, ptr %319, align 8, !tbaa !50
  %321 = load i32, ptr %6, align 4, !tbaa !9
  %322 = zext i32 %321 to i64
  %323 = getelementptr inbounds ptr, ptr %320, i64 %322
  %324 = load ptr, ptr %323, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.ntttcp_test_endpoint_thread_result, ptr %324, i32 0, i32 0
  store i8 0, ptr %325, align 8, !tbaa !51
  br label %326

326:                                              ; preds = %315, %304
  br label %327

327:                                              ; preds = %326
  %328 = load i32, ptr %6, align 4, !tbaa !9
  %329 = add i32 %328, 1
  store i32 %329, ptr %6, align 4, !tbaa !9
  br label %272, !llvm.loop !53

330:                                              ; preds = %272
  %331 = call noalias ptr @malloc(i64 noundef 32) #7
  %332 = load ptr, ptr %9, align 8, !tbaa !5
  %333 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %332, i32 0, i32 13
  %334 = load ptr, ptr %333, align 8, !tbaa !45
  %335 = getelementptr inbounds %struct.ntttcp_test_endpoint_results, ptr %334, i32 0, i32 3
  store ptr %331, ptr %335, align 8, !tbaa !54
  %336 = call noalias ptr @malloc(i64 noundef 32) #7
  %337 = load ptr, ptr %9, align 8, !tbaa !5
  %338 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %337, i32 0, i32 13
  %339 = load ptr, ptr %338, align 8, !tbaa !45
  %340 = getelementptr inbounds %struct.ntttcp_test_endpoint_results, ptr %339, i32 0, i32 4
  store ptr %336, ptr %340, align 8, !tbaa !55
  %341 = call noalias ptr @malloc(i64 noundef 56) #7
  %342 = load ptr, ptr %9, align 8, !tbaa !5
  %343 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %342, i32 0, i32 13
  %344 = load ptr, ptr %343, align 8, !tbaa !45
  %345 = getelementptr inbounds %struct.ntttcp_test_endpoint_results, ptr %344, i32 0, i32 5
  store ptr %341, ptr %345, align 8, !tbaa !56
  %346 = call noalias ptr @malloc(i64 noundef 56) #7
  %347 = load ptr, ptr %9, align 8, !tbaa !5
  %348 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %347, i32 0, i32 13
  %349 = load ptr, ptr %348, align 8, !tbaa !45
  %350 = getelementptr inbounds %struct.ntttcp_test_endpoint_results, ptr %349, i32 0, i32 6
  store ptr %346, ptr %350, align 8, !tbaa !57
  %351 = call noalias ptr @malloc(i64 noundef 56) #7
  %352 = load ptr, ptr %9, align 8, !tbaa !5
  %353 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %352, i32 0, i32 13
  %354 = load ptr, ptr %353, align 8, !tbaa !45
  %355 = getelementptr inbounds %struct.ntttcp_test_endpoint_results, ptr %354, i32 0, i32 7
  store ptr %351, ptr %355, align 8, !tbaa !58
  %356 = call noalias ptr @malloc(i64 noundef 56) #7
  %357 = load ptr, ptr %9, align 8, !tbaa !5
  %358 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %357, i32 0, i32 13
  %359 = load ptr, ptr %358, align 8, !tbaa !45
  %360 = getelementptr inbounds %struct.ntttcp_test_endpoint_results, ptr %359, i32 0, i32 8
  store ptr %356, ptr %360, align 8, !tbaa !59
  %361 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %361, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %362

362:                                              ; preds = %330, %234, %182, %146, %94, %14
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %363 = load ptr, ptr %3, align 8
  ret ptr %363
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @new_ntttcp_client_stream(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local ptr @new_ntttcp_server_stream(ptr noundef) #3

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { 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, !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, !10, i64 0}
!12 = !{!"ntttcp_test_endpoint", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !13, i64 24, !13, i64 40, !10, i64 56, !10, i64 60, !15, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !15, i64 96, !6, i64 104, !10, i64 112, !7, i64 116}
!13 = !{!"timeval", !14, i64 0, !14, i64 8}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!12, !6, i64 8}
!17 = !{!12, !10, i64 16}
!18 = !{!19, !15, i64 6}
!19 = !{!"ntttcp_test", !15, i64 0, !15, i64 1, !15, i64 2, !15, i64 3, !15, i64 4, !15, i64 5, !15, i64 6, !6, i64 8, !10, i64 16, !10, i64 20, !6, i64 24, !10, i64 32, !10, i64 36, !15, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !10, i64 96, !10, i64 100, !10, i64 104, !15, i64 108, !6, i64 112, !6, i64 120, !15, i64 128, !6, i64 136, !15, i64 144, !6, i64 152, !15, i64 160, !6, i64 168, !15, i64 176, !15, i64 177}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!12, !15, i64 64}
!23 = !{!19, !10, i64 96}
!24 = !{!19, !10, i64 100}
!25 = !{!19, !10, i64 104}
!26 = !{!12, !10, i64 20}
!27 = !{i64 0, i64 8, !28, i64 8, i64 8, !28}
!28 = !{!14, !14, i64 0}
!29 = !{!12, !15, i64 96}
!30 = !{!12, !10, i64 56}
!31 = !{!12, !10, i64 112}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!19, !10, i64 16}
!35 = !{!19, !10, i64 32}
!36 = !{!12, !10, i64 60}
!37 = !{!12, !6, i64 72}
!38 = distinct !{!38, !33}
!39 = !{!12, !6, i64 88}
!40 = distinct !{!40, !33}
!41 = !{!19, !15, i64 40}
!42 = !{!12, !6, i64 80}
!43 = distinct !{!43, !33}
!44 = distinct !{!44, !33}
!45 = !{!12, !6, i64 104}
!46 = !{!47, !6, i64 0}
!47 = !{!"ntttcp_test_endpoint_results", !6, i64 0, !14, i64 8, !48, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !14, i64 104, !14, i64 112, !6, i64 120, !48, i64 128, !48, i64 136, !48, i64 144, !48, i64 152, !48, i64 160, !48, i64 168, !48, i64 176, !48, i64 184, !48, i64 192, !48, i64 200, !48, i64 208, !48, i64 216, !48, i64 224, !48, i64 232, !14, i64 240, !48, i64 248, !48, i64 256, !48, i64 264, !48, i64 272, !48, i64 280, !48, i64 288, !14, i64 296, !14, i64 304, !14, i64 312, !48, i64 320, !10, i64 328, !10, i64 332}
!48 = !{!"double", !7, i64 0}
!49 = !{!47, !10, i64 332}
!50 = !{!47, !6, i64 120}
!51 = !{!52, !15, i64 0}
!52 = !{!"ntttcp_test_endpoint_thread_result", !15, i64 0, !14, i64 8, !48, i64 16, !48, i64 24, !48, i64 32, !48, i64 40}
!53 = distinct !{!53, !33}
!54 = !{!47, !6, i64 24}
!55 = !{!47, !6, i64 32}
!56 = !{!47, !6, i64 40}
!57 = !{!47, !6, i64 48}
!58 = !{!47, !6, i64 56}
!59 = !{!47, !6, i64 64}


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

; 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

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @is_running_tty() local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @new_ntttcp_test_endpoint(ptr noundef %0, i32 noundef %1) local_unnamed_addr #3 {
  %3 = alloca %struct.timeval, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #8
  %calloc166 = tail call dereferenceable_or_null(152) ptr @calloc(i64 1, i64 152)
  %.not = icmp eq ptr %calloc166, null
  br i1 %.not, label %114, label %4

4:                                                ; preds = %2
  %5 = call i32 @gettimeofday(ptr noundef nonnull %3, ptr noundef null) #8
  store i32 %1, ptr %calloc166, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %calloc166, i64 8
  store ptr %0, ptr %6, align 8, !tbaa !14
  %7 = getelementptr inbounds i8, ptr %calloc166, i64 16
  store i32 11, ptr %7, align 8, !tbaa !15
  %8 = getelementptr inbounds i8, ptr %0, i64 6
  %9 = load i8, ptr %8, align 2, !tbaa !16, !range !18, !noundef !19
  %10 = getelementptr inbounds i8, ptr %calloc166, i64 64
  store i8 %9, ptr %10, align 8, !tbaa !20
  %11 = getelementptr inbounds i8, ptr %0, i64 96
  %12 = load i32, ptr %11, align 8, !tbaa !21
  %13 = getelementptr inbounds i8, ptr %0, i64 100
  %14 = load i32, ptr %13, align 4, !tbaa !22
  %15 = add nsw i32 %14, %12
  %16 = getelementptr inbounds i8, ptr %0, i64 104
  %17 = load i32, ptr %16, align 8, !tbaa !23
  %18 = add nsw i32 %15, %17
  %19 = getelementptr inbounds i8, ptr %calloc166, i64 20
  store i32 %18, ptr %19, align 4, !tbaa !24
  %20 = getelementptr inbounds i8, ptr %calloc166, i64 24
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(16) %3, i64 16, i1 false), !tbaa.struct !25
  %21 = getelementptr inbounds i8, ptr %calloc166, i64 40
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %3, i64 16, i1 false), !tbaa.struct !25
  %22 = tail call zeroext i1 @is_running_tty()
  %23 = getelementptr inbounds i8, ptr %calloc166, i64 96
  %24 = zext i1 %22 to i8
  store i8 %24, ptr %23, align 8, !tbaa !27
  %25 = getelementptr inbounds i8, ptr %calloc166, i64 116
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %25, i8 -1, i64 32, i1 false), !tbaa !28
  %26 = icmp eq i32 %1, 1
  br i1 %26, label %27, label %50

27:                                               ; preds = %4
  %28 = getelementptr inbounds i8, ptr %0, i64 16
  %29 = load i32, ptr %28, align 8, !tbaa !29
  %30 = getelementptr inbounds i8, ptr %0, i64 32
  %31 = load i32, ptr %30, align 8, !tbaa !30
  %32 = mul i32 %31, %29
  %33 = getelementptr inbounds i8, ptr %calloc166, i64 60
  store i32 %32, ptr %33, align 4, !tbaa !31
  %34 = zext i32 %32 to i64
  %35 = shl nuw nsw i64 %34, 3
  %calloc164 = tail call ptr @calloc(i64 1, i64 %35)
  %36 = getelementptr inbounds i8, ptr %calloc166, i64 72
  store ptr %calloc164, ptr %36, align 8, !tbaa !32
  %.not114 = icmp eq ptr %calloc164, null
  br i1 %.not114, label %37, label %38

37:                                               ; preds = %27
  tail call void @free(ptr noundef nonnull %calloc166) #8
  br label %114

38:                                               ; preds = %27
  %.not135 = icmp eq i32 %32, 0
  br i1 %.not135, label %._crit_edge125.thread, label %.lr.ph124

.lr.ph124:                                        ; preds = %38, %.lr.ph124
  %indvars.iv145 = phi i64 [ %indvars.iv.next146, %.lr.ph124 ], [ 0, %38 ]
  %39 = tail call ptr @new_ntttcp_client_stream(ptr noundef nonnull %calloc166)
  %40 = load ptr, ptr %36, align 8, !tbaa !32
  %41 = getelementptr inbounds ptr, ptr %40, i64 %indvars.iv145
  store ptr %39, ptr %41, align 8, !tbaa !33
  %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
  %exitcond149.not = icmp eq i64 %indvars.iv.next146, %34
  br i1 %exitcond149.not, label %._crit_edge125, label %.lr.ph124, !llvm.loop !34

._crit_edge125:                                   ; preds = %.lr.ph124
  %42 = tail call noalias ptr @malloc(i64 noundef %35) #9
  %43 = getelementptr inbounds i8, ptr %calloc166, i64 88
  store ptr %42, ptr %43, align 8, !tbaa !36
  %.not115 = icmp eq ptr %42, null
  br i1 %.not115, label %.preheader, label %73

._crit_edge125.thread:                            ; preds = %38
  %44 = tail call noalias ptr @malloc(i64 noundef %35) #9
  %45 = getelementptr inbounds i8, ptr %calloc166, i64 88
  store ptr %44, ptr %45, align 8, !tbaa !36
  %.not115161 = icmp eq ptr %44, null
  br i1 %.not115161, label %._crit_edge132, label %73

.preheader:                                       ; preds = %._crit_edge125
  br i1 %.not135, label %._crit_edge132, label %.lr.ph131

.lr.ph131:                                        ; preds = %.preheader, %.lr.ph131
  %indvars.iv155 = phi i64 [ %indvars.iv.next156, %.lr.ph131 ], [ 0, %.preheader ]
  %46 = load ptr, ptr %36, align 8, !tbaa !32
  %47 = getelementptr inbounds ptr, ptr %46, i64 %indvars.iv155
  %48 = load ptr, ptr %47, align 8, !tbaa !33
  tail call void @free(ptr noundef %48) #8
  %indvars.iv.next156 = add nuw nsw i64 %indvars.iv155, 1
  %exitcond159.not = icmp eq i64 %indvars.iv.next156, %34
  br i1 %exitcond159.not, label %._crit_edge132, label %.lr.ph131, !llvm.loop !37

._crit_edge132:                                   ; preds = %.lr.ph131, %._crit_edge125.thread, %.preheader
  %49 = load ptr, ptr %36, align 8, !tbaa !32
  tail call void @free(ptr noundef %49) #8
  tail call void @free(ptr noundef nonnull %calloc166) #8
  br label %114

50:                                               ; preds = %4
  %51 = getelementptr inbounds i8, ptr %0, i64 40
  %52 = load i8, ptr %51, align 8, !tbaa !38, !range !18, !noundef !19
  %53 = getelementptr inbounds i8, ptr %0, i64 16
  %54 = load i32, ptr %53, align 8, !tbaa !29
  %55 = xor i8 %52, 1
  %not. = zext nneg i8 %55 to i32
  %.0105 = add i32 %54, %not.
  %56 = getelementptr inbounds i8, ptr %calloc166, i64 60
  store i32 %.0105, ptr %56, align 4, !tbaa !31
  %57 = zext i32 %.0105 to i64
  %58 = shl nuw nsw i64 %57, 3
  %calloc165 = tail call ptr @calloc(i64 1, i64 %58)
  %59 = getelementptr inbounds i8, ptr %calloc166, i64 80
  store ptr %calloc165, ptr %59, align 8, !tbaa !39
  %.not112 = icmp eq ptr %calloc165, null
  br i1 %.not112, label %60, label %61

60:                                               ; preds = %50
  tail call void @free(ptr noundef nonnull %calloc166) #8
  br label %114

61:                                               ; preds = %50
  %.not133 = icmp eq i32 %.0105, 0
  br i1 %.not133, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %61, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %61 ]
  %62 = tail call ptr @new_ntttcp_server_stream(ptr noundef nonnull %calloc166)
  %63 = load ptr, ptr %59, align 8, !tbaa !39
  %64 = getelementptr inbounds ptr, ptr %63, i64 %indvars.iv
  store ptr %62, ptr %64, align 8, !tbaa !33
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %57
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !40

._crit_edge:                                      ; preds = %.lr.ph
  %65 = tail call noalias ptr @malloc(i64 noundef %58) #9
  %66 = getelementptr inbounds i8, ptr %calloc166, i64 88
  store ptr %65, ptr %66, align 8, !tbaa !36
  %.not113 = icmp eq ptr %65, null
  br i1 %.not113, label %.preheader116, label %73

._crit_edge.thread:                               ; preds = %61
  %67 = tail call noalias ptr @malloc(i64 noundef %58) #9
  %68 = getelementptr inbounds i8, ptr %calloc166, i64 88
  store ptr %67, ptr %68, align 8, !tbaa !36
  %.not113162 = icmp eq ptr %67, null
  br i1 %.not113162, label %._crit_edge121, label %73

.preheader116:                                    ; preds = %._crit_edge
  br i1 %.not133, label %._crit_edge121, label %.lr.ph120

.lr.ph120:                                        ; preds = %.preheader116, %.lr.ph120
  %indvars.iv140 = phi i64 [ %indvars.iv.next141, %.lr.ph120 ], [ 0, %.preheader116 ]
  %69 = load ptr, ptr %59, align 8, !tbaa !39
  %70 = getelementptr inbounds ptr, ptr %69, i64 %indvars.iv140
  %71 = load ptr, ptr %70, align 8, !tbaa !33
  tail call void @free(ptr noundef %71) #8
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %exitcond144.not = icmp eq i64 %indvars.iv.next141, %57
  br i1 %exitcond144.not, label %._crit_edge121, label %.lr.ph120, !llvm.loop !41

._crit_edge121:                                   ; preds = %.lr.ph120, %._crit_edge.thread, %.preheader116
  %72 = load ptr, ptr %59, align 8, !tbaa !39
  tail call void @free(ptr noundef %72) #8
  tail call void @free(ptr noundef nonnull %calloc166) #8
  br label %114

73:                                               ; preds = %._crit_edge.thread, %._crit_edge125.thread, %._crit_edge, %._crit_edge125
  %.pre-phi160 = phi i64 [ %58, %._crit_edge ], [ %35, %._crit_edge125 ], [ %35, %._crit_edge125.thread ], [ %58, %._crit_edge.thread ]
  %.pre-phi = phi i64 [ %57, %._crit_edge ], [ %34, %._crit_edge125 ], [ 0, %._crit_edge125.thread ], [ 0, %._crit_edge.thread ]
  %.1 = phi i32 [ %.0105, %._crit_edge ], [ %32, %._crit_edge125 ], [ 0, %._crit_edge125.thread ], [ 0, %._crit_edge.thread ]
  %calloc = tail call dereferenceable_or_null(336) ptr @calloc(i64 1, i64 336)
  %74 = getelementptr inbounds i8, ptr %calloc166, i64 104
  store ptr %calloc, ptr %74, align 8, !tbaa !42
  store ptr %calloc166, ptr %calloc, align 8, !tbaa !43
  %75 = getelementptr inbounds i8, ptr %calloc, i64 332
  store i32 -1, ptr %75, align 4, !tbaa !46
  %calloc163 = tail call ptr @calloc(i64 1, i64 %.pre-phi160)
  %76 = getelementptr inbounds i8, ptr %calloc, i64 120
  store ptr %calloc163, ptr %76, align 8, !tbaa !47
  %.not136 = icmp eq i32 %.1, 0
  br i1 %.not136, label %._crit_edge129, label %.lr.ph128

.lr.ph128:                                        ; preds = %73
  %77 = add i32 %.1, -1
  %78 = zext i32 %77 to i64
  br label %79

79:                                               ; preds = %.lr.ph128, %95
  %80 = phi ptr [ %calloc, %.lr.ph128 ], [ %96, %95 ]
  %indvars.iv150 = phi i64 [ 0, %.lr.ph128 ], [ %indvars.iv.next151, %95 ]
  %81 = tail call noalias dereferenceable_or_null(48) ptr @malloc(i64 noundef 48) #9
  %82 = getelementptr inbounds i8, ptr %80, i64 120
  %83 = load ptr, ptr %82, align 8, !tbaa !47
  %84 = getelementptr inbounds ptr, ptr %83, i64 %indvars.iv150
  store ptr %81, ptr %84, align 8, !tbaa !33
  %85 = icmp eq i64 %indvars.iv150, %78
  br i1 %85, label %86, label %94

86:                                               ; preds = %79
  %87 = load i32, ptr %calloc166, align 8, !tbaa !5
  %88 = icmp eq i32 %87, 2
  br i1 %88, label %89, label %94

89:                                               ; preds = %86
  %90 = load ptr, ptr %6, align 8, !tbaa !14
  %91 = getelementptr inbounds i8, ptr %90, i64 40
  %92 = load i8, ptr %91, align 8, !tbaa !38, !range !18, !noundef !19
  %93 = icmp eq i8 %92, 0
  br i1 %93, label %95, label %94

94:                                               ; preds = %89, %86, %79
  br label %95

95:                                               ; preds = %89, %94
  %.sink170 = phi i64 [ %indvars.iv150, %94 ], [ %78, %89 ]
  %.sink = phi i8 [ 0, %94 ], [ 1, %89 ]
  %96 = load ptr, ptr %74, align 8, !tbaa !42
  %97 = getelementptr inbounds i8, ptr %96, i64 120
  %98 = load ptr, ptr %97, align 8, !tbaa !47
  %99 = getelementptr inbounds ptr, ptr %98, i64 %.sink170
  %100 = load ptr, ptr %99, align 8, !tbaa !33
  store i8 %.sink, ptr %100, align 8, !tbaa !48
  %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
  %exitcond154.not = icmp eq i64 %indvars.iv.next151, %.pre-phi
  br i1 %exitcond154.not, label %._crit_edge129, label %79, !llvm.loop !50

._crit_edge129:                                   ; preds = %95, %73
  %101 = phi ptr [ %calloc, %73 ], [ %96, %95 ]
  %102 = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9
  %103 = getelementptr inbounds i8, ptr %101, i64 24
  store ptr %102, ptr %103, align 8, !tbaa !51
  %104 = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9
  %105 = getelementptr inbounds i8, ptr %101, i64 32
  store ptr %104, ptr %105, align 8, !tbaa !52
  %106 = tail call noalias dereferenceable_or_null(56) ptr @malloc(i64 noundef 56) #9
  %107 = getelementptr inbounds i8, ptr %101, i64 40
  store ptr %106, ptr %107, align 8, !tbaa !53
  %108 = tail call noalias dereferenceable_or_null(56) ptr @malloc(i64 noundef 56) #9
  %109 = getelementptr inbounds i8, ptr %101, i64 48
  store ptr %108, ptr %109, align 8, !tbaa !54
  %110 = tail call noalias dereferenceable_or_null(56) ptr @malloc(i64 noundef 56) #9
  %111 = getelementptr inbounds i8, ptr %101, i64 56
  store ptr %110, ptr %111, align 8, !tbaa !55
  %112 = tail call noalias dereferenceable_or_null(56) ptr @malloc(i64 noundef 56) #9
  %113 = getelementptr inbounds i8, ptr %101, i64 64
  store ptr %112, ptr %113, align 8, !tbaa !56
  br label %114

114:                                              ; preds = %2, %._crit_edge129, %._crit_edge121, %60, %._crit_edge132, %37
  %.0 = phi ptr [ %calloc166, %._crit_edge129 ], [ null, %._crit_edge132 ], [ null, %37 ], [ null, %._crit_edge121 ], [ null, %60 ], [ null, %2 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  ret ptr %.0
}

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @new_ntttcp_client_stream(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local ptr @new_ntttcp_server_stream(ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
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, !7, i64 0}
!6 = !{!"ntttcp_test_endpoint", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 20, !11, i64 24, !11, i64 40, !7, i64 56, !7, i64 60, !13, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !13, i64 96, !10, i64 104, !7, i64 112, !8, i64 116}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"timeval", !12, i64 0, !12, i64 8}
!12 = !{!"long", !8, i64 0}
!13 = !{!"_Bool", !8, i64 0}
!14 = !{!6, !10, i64 8}
!15 = !{!6, !7, i64 16}
!16 = !{!17, !13, i64 6}
!17 = !{!"ntttcp_test", !13, i64 0, !13, i64 1, !13, i64 2, !13, i64 3, !13, i64 4, !13, i64 5, !13, i64 6, !10, i64 8, !7, i64 16, !7, i64 20, !10, i64 24, !7, i64 32, !7, i64 36, !13, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !7, i64 96, !7, i64 100, !7, i64 104, !13, i64 108, !10, i64 112, !10, i64 120, !13, i64 128, !10, i64 136, !13, i64 144, !10, i64 152, !13, i64 160, !10, i64 168, !13, i64 176, !13, i64 177}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!6, !13, i64 64}
!21 = !{!17, !7, i64 96}
!22 = !{!17, !7, i64 100}
!23 = !{!17, !7, i64 104}
!24 = !{!6, !7, i64 20}
!25 = !{i64 0, i64 8, !26, i64 8, i64 8, !26}
!26 = !{!12, !12, i64 0}
!27 = !{!6, !13, i64 96}
!28 = !{!7, !7, i64 0}
!29 = !{!17, !7, i64 16}
!30 = !{!17, !7, i64 32}
!31 = !{!6, !7, i64 60}
!32 = !{!6, !10, i64 72}
!33 = !{!10, !10, i64 0}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{!6, !10, i64 88}
!37 = distinct !{!37, !35}
!38 = !{!17, !13, i64 40}
!39 = !{!6, !10, i64 80}
!40 = distinct !{!40, !35}
!41 = distinct !{!41, !35}
!42 = !{!6, !10, i64 104}
!43 = !{!44, !10, i64 0}
!44 = !{!"ntttcp_test_endpoint_results", !10, i64 0, !12, i64 8, !45, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !10, i64 120, !45, i64 128, !45, i64 136, !45, i64 144, !45, i64 152, !45, i64 160, !45, i64 168, !45, i64 176, !45, i64 184, !45, i64 192, !45, i64 200, !45, i64 208, !45, i64 216, !45, i64 224, !45, i64 232, !12, i64 240, !45, i64 248, !45, i64 256, !45, i64 264, !45, i64 272, !45, i64 280, !45, i64 288, !12, i64 296, !12, i64 304, !12, i64 312, !45, i64 320, !7, i64 328, !7, i64 332}
!45 = !{!"double", !8, i64 0}
!46 = !{!44, !7, i64 332}
!47 = !{!44, !10, i64 120}
!48 = !{!49, !13, i64 0}
!49 = !{!"ntttcp_test_endpoint_thread_result", !13, i64 0, !12, i64 8, !45, i64 16, !45, i64 24, !45, i64 32, !45, i64 40}
!50 = distinct !{!50, !35}
!51 = !{!44, !10, i64 24}
!52 = !{!44, !10, i64 32}
!53 = !{!44, !10, i64 40}
!54 = !{!44, !10, i64 48}
!55 = !{!44, !10, i64 56}
!56 = !{!44, !10, i64 64}


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