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

; 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] }
%struct.sockaddr_storage = type { i16, [118 x i8], i64 }
%union.__SOCKADDR_ARG = type { ptr }
%struct.ntttcp_stream_server = type { ptr, i32, i32, ptr, i32, i64, i8, i8, i8, i8, i8, i32, i32, %struct.fd_set, %struct.fd_set, i32, 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.timeval = type { i64, i64 }
%struct.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }
%struct.sockaddr_in6 = type { i16, i16, i32, %struct.in6_addr, i32 }
%struct.in6_addr = type { %union.anon }
%union.anon = type { [4 x i32] }

@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [29 x i8], align 1

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

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

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

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

; 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) #3

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

declare void @PRINT_ERR(ptr noundef) #5

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #6

declare void @PRINT_INFO_FREE(ptr noundef) #5

declare i32 @close(i32 noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @__bswap_16(i16 noundef zeroext) #7

declare ptr @retrive_ip_address_str(ptr noundef, ptr noundef, i64 noundef) #5

declare void @PRINT_DBG_FREE(ptr noundef) #5

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

declare i32 @set_socket_non_blocking(i32 noundef) #5

declare i32 @accept(i32 noundef, ptr, ptr noundef) #5

declare void @turn_on_light() #5

; Function Attrs: nounwind uwtable
define dso_local i32 @ntttcp_server_select(ptr noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca %struct.fd_set, align 8
  %13 = alloca %struct.fd_set, align 8
  %14 = alloca %struct.sockaddr_storage, align 8
  %15 = alloca %struct.sockaddr_storage, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %union.__SOCKADDR_ARG, align 8
  %23 = alloca i32, align 4
  %24 = alloca %union.__SOCKADDR_ARG, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 128, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 128, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 128, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 128, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 0, ptr %20, align 4, !tbaa !9
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %29, i32 0, i32 5
  %31 = load i64, ptr %30, align 8, !tbaa !11
  %32 = call noalias ptr @malloc(i64 noundef %31) #9
  store ptr %32, ptr %9, align 8, !tbaa !5
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %35

34:                                               ; preds = %1
  call void @PRINT_ERR(ptr noundef @.str.24)
  store i32 -1002, ptr %2, align 4
  store i32 1, ptr %21, align 4
  br label %310

35:                                               ; preds = %1
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 8, !tbaa !16
  %39 = icmp eq i32 %38, 2
  %40 = zext i1 %39 to i64
  %41 = select i1 %39, i32 16, i32 46
  store i32 %41, ptr %19, align 4, !tbaa !9
  %42 = load i32, ptr %19, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = call noalias ptr @malloc(i64 noundef %43) #9
  store ptr %44, ptr %18, align 8, !tbaa !5
  %45 = icmp eq ptr %44, null
  br i1 %45, label %46, label %48

46:                                               ; preds = %35
  call void @PRINT_ERR(ptr noundef @.str.25)
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %47) #8
  store i32 -1002, ptr %2, align 4
  store i32 1, ptr %21, align 4
  br label %310

48:                                               ; preds = %35
  br label %49

49:                                               ; preds = %301, %81, %48
  br label %50

50:                                               ; preds = %49
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %51, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !17
  %54 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %53, i32 0, i32 8
  %55 = load i8, ptr %54, align 8, !tbaa !18, !range !21, !noundef !22
  %56 = trunc i8 %55 to i1
  br i1 %56, label %57, label %65

57:                                               ; preds = %50
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  %61 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %60, i32 0, i32 2
  %62 = load i32, ptr %61, align 8, !tbaa !23
  %63 = icmp eq i32 %62, 13
  br i1 %63, label %64, label %65

64:                                               ; preds = %57
  br label %302

65:                                               ; preds = %57, %50
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %66, i32 0, i32 13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %67, i64 128, i1 false)
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %68, i32 0, i32 14
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %69, i64 128, i1 false)
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %70, i32 0, i32 12
  %72 = load i32, ptr %71, align 4, !tbaa !24
  %73 = add nsw i32 %72, 1
  %74 = call i32 @select(i32 noundef %73, ptr noundef %12, ptr noundef null, ptr noundef null, ptr noundef null)
  store i32 %74, ptr %6, align 4, !tbaa !9
  %75 = load i32, ptr %6, align 4, !tbaa !9
  %76 = icmp slt i32 %75, 0
  br i1 %76, label %77, label %82

77:                                               ; preds = %65
  %78 = call ptr @__errno_location() #10
  %79 = load i32, ptr %78, align 4, !tbaa !9
  %80 = icmp ne i32 %79, 4
  br i1 %80, label %81, label %82

81:                                               ; preds = %77
  call void @PRINT_ERR(ptr noundef @.str.35)
  store i32 -1106, ptr %4, align 4, !tbaa !9
  br label %49

82:                                               ; preds = %77, %65
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %83

83:                                               ; preds = %298, %82
  %84 = load i32, ptr %8, align 4, !tbaa !9
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %85, i32 0, i32 12
  %87 = load i32, ptr %86, align 4, !tbaa !24
  %88 = icmp sle i32 %84, %87
  br i1 %88, label %89, label %301

89:                                               ; preds = %83
  %90 = getelementptr inbounds %struct.fd_set, ptr %12, i32 0, i32 0
  %91 = load i32, ptr %8, align 4, !tbaa !9
  %92 = sdiv i32 %91, 64
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [16 x i64], ptr %90, i64 0, i64 %93
  %95 = load i64, ptr %94, align 8, !tbaa !25
  %96 = load i32, ptr %8, align 4, !tbaa !9
  %97 = srem i32 %96, 64
  %98 = zext i32 %97 to i64
  %99 = shl i64 1, %98
  %100 = and i64 %95, %99
  %101 = icmp ne i64 %100, 0
  br i1 %101, label %103, label %102

102:                                              ; preds = %89
  br label %298

103:                                              ; preds = %89
  %104 = load i32, ptr %8, align 4, !tbaa !9
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %105, i32 0, i32 11
  %107 = load i32, ptr %106, align 8, !tbaa !26
  %108 = icmp eq i32 %104, %107
  br i1 %108, label %109, label %220

109:                                              ; preds = %103
  store i32 128, ptr %16, align 4, !tbaa !9
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %110, i32 0, i32 11
  %112 = load i32, ptr %111, align 8, !tbaa !26
  store ptr %14, ptr %22, align 8, !tbaa !27
  %113 = getelementptr inbounds %union.__SOCKADDR_ARG, ptr %22, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8
  %115 = call i32 @accept(i32 noundef %112, ptr %114, ptr noundef %16)
  store i32 %115, ptr %7, align 4, !tbaa !9
  %116 = icmp slt i32 %115, 0
  br i1 %116, label %117, label %118

117:                                              ; preds = %109
  store i32 -1105, ptr %4, align 4, !tbaa !9
  br label %301

118:                                              ; preds = %109
  %119 = load i32, ptr %7, align 4, !tbaa !9
  %120 = call i32 @set_socket_non_blocking(i32 noundef %119)
  %121 = icmp eq i32 %120, -1
  br i1 %121, label %122, label %130

122:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %123 = load i32, ptr %7, align 4, !tbaa !9
  %124 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %5, ptr noundef @.str.30, i32 noundef %123) #8
  store i32 %124, ptr %23, align 4, !tbaa !9
  %125 = load i32, ptr %23, align 4, !tbaa !9
  %126 = icmp slt i32 %125, 0
  br i1 %126, label %127, label %128

127:                                              ; preds = %122
  call void @PRINT_ERR(ptr noundef @.str.2)
  br label %128

128:                                              ; preds = %127, %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  call void @PRINT_DBG_FREE(ptr noundef %129)
  br label %130

130:                                              ; preds = %128, %118
  %131 = load i32, ptr %7, align 4, !tbaa !9
  %132 = srem i32 %131, 64
  %133 = zext i32 %132 to i64
  %134 = shl i64 1, %133
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %135, i32 0, i32 13
  %137 = getelementptr inbounds %struct.fd_set, ptr %136, i32 0, i32 0
  %138 = load i32, ptr %7, align 4, !tbaa !9
  %139 = sdiv i32 %138, 64
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [16 x i64], ptr %137, i64 0, i64 %140
  %142 = load i64, ptr %141, align 8, !tbaa !25
  %143 = or i64 %142, %134
  store i64 %143, ptr %141, align 8, !tbaa !25
  %144 = load i32, ptr %7, align 4, !tbaa !9
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %145, i32 0, i32 12
  %147 = load i32, ptr %146, align 4, !tbaa !24
  %148 = icmp sgt i32 %144, %147
  br i1 %148, label %149, label %153

149:                                              ; preds = %130
  %150 = load i32, ptr %7, align 4, !tbaa !9
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %151, i32 0, i32 12
  store i32 %150, ptr %152, align 4, !tbaa !24
  br label %153

153:                                              ; preds = %149, %130
  store i32 128, ptr %17, align 4, !tbaa !9
  %154 = load i32, ptr %7, align 4, !tbaa !9
  store ptr %15, ptr %24, align 8, !tbaa !27
  %155 = getelementptr inbounds %union.__SOCKADDR_ARG, ptr %24, i32 0, i32 0
  %156 = load ptr, ptr %155, align 8
  %157 = call i32 @getsockname(i32 noundef %154, ptr %156, ptr noundef %17) #8
  %158 = icmp ne i32 %157, 0
  br i1 %158, label %159, label %167

159:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %160 = load i32, ptr %7, align 4, !tbaa !9
  %161 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %5, ptr noundef @.str.31, i32 noundef %160) #8
  store i32 %161, ptr %25, align 4, !tbaa !9
  %162 = load i32, ptr %25, align 4, !tbaa !9
  %163 = icmp slt i32 %162, 0
  br i1 %163, label %164, label %165

164:                                              ; preds = %159
  call void @PRINT_ERR(ptr noundef @.str.2)
  br label %165

165:                                              ; preds = %164, %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  call void @PRINT_DBG_FREE(ptr noundef %166)
  br label %213

167:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  %168 = load ptr, ptr %18, align 8, !tbaa !5
  %169 = load i32, ptr %19, align 4, !tbaa !9
  %170 = sext i32 %169 to i64
  %171 = call ptr @retrive_ip_address_str(ptr noundef %14, ptr noundef %168, i64 noundef %170)
  store ptr %171, ptr %18, align 8, !tbaa !5
  %172 = load ptr, ptr %3, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %172, i32 0, i32 1
  %174 = load i32, ptr %173, align 8, !tbaa !16
  %175 = icmp eq i32 %174, 2
  br i1 %175, label %176, label %180

176:                                              ; preds = %167
  %177 = getelementptr inbounds %struct.sockaddr_in, ptr %14, i32 0, i32 1
  %178 = load i16, ptr %177, align 2, !tbaa !28
  %179 = zext i16 %178 to i32
  br label %184

180:                                              ; preds = %167
  %181 = getelementptr inbounds %struct.sockaddr_in6, ptr %14, i32 0, i32 1
  %182 = load i16, ptr %181, align 2, !tbaa !32
  %183 = zext i16 %182 to i32
  br label %184

184:                                              ; preds = %180, %176
  %185 = phi i32 [ %179, %176 ], [ %183, %180 ]
  %186 = trunc i32 %185 to i16
  %187 = call zeroext i16 @__bswap_16(i16 noundef zeroext %186)
  %188 = zext i16 %187 to i32
  %189 = load ptr, ptr %3, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %189, i32 0, i32 1
  %191 = load i32, ptr %190, align 8, !tbaa !16
  %192 = icmp eq i32 %191, 2
  br i1 %192, label %193, label %197

193:                                              ; preds = %184
  %194 = getelementptr inbounds %struct.sockaddr_in, ptr %15, i32 0, i32 1
  %195 = load i16, ptr %194, align 2, !tbaa !28
  %196 = zext i16 %195 to i32
  br label %201

197:                                              ; preds = %184
  %198 = getelementptr inbounds %struct.sockaddr_in6, ptr %15, i32 0, i32 1
  %199 = load i16, ptr %198, align 2, !tbaa !32
  %200 = zext i16 %199 to i32
  br label %201

201:                                              ; preds = %197, %193
  %202 = phi i32 [ %196, %193 ], [ %200, %197 ]
  %203 = trunc i32 %202 to i16
  %204 = call zeroext i16 @__bswap_16(i16 noundef zeroext %203)
  %205 = zext i16 %204 to i32
  %206 = load i32, ptr %7, align 4, !tbaa !9
  %207 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %5, ptr noundef @.str.32, ptr noundef %171, i32 noundef %188, i32 noundef %205, i32 noundef %206) #8
  store i32 %207, ptr %26, align 4, !tbaa !9
  %208 = load i32, ptr %26, align 4, !tbaa !9
  %209 = icmp slt i32 %208, 0
  br i1 %209, label %210, label %211

210:                                              ; preds = %201
  call void @PRINT_ERR(ptr noundef @.str.2)
  br label %211

211:                                              ; preds = %210, %201
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  %212 = load ptr, ptr %5, align 8, !tbaa !5
  call void @PRINT_DBG_FREE(ptr noundef %212)
  br label %213

213:                                              ; preds = %211, %165
  %214 = load ptr, ptr %3, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %214, i32 0, i32 7
  %216 = load i8, ptr %215, align 1, !tbaa !35, !range !21, !noundef !22
  %217 = trunc i8 %216 to i1
  br i1 %217, label %218, label %219

218:                                              ; preds = %213
  call void @turn_on_light()
  br label %219

219:                                              ; preds = %218, %213
  br label %297

220:                                              ; preds = %103
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %221

221:                                              ; preds = %293, %220
  %222 = load i32, ptr %20, align 4, !tbaa !9
  %223 = icmp slt i32 %222, 32
  br i1 %223, label %224, label %296

224:                                              ; preds = %221
  %225 = load ptr, ptr %3, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %225, i32 0, i32 6
  %227 = load i8, ptr %226, align 8, !tbaa !36, !range !21, !noundef !22
  %228 = trunc i8 %227 to i1
  br i1 %228, label %229, label %230

229:                                              ; preds = %224
  br label %234

230:                                              ; preds = %224
  %231 = load ptr, ptr %3, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %231, i32 0, i32 5
  %233 = load i64, ptr %232, align 8, !tbaa !11
  br label %234

234:                                              ; preds = %230, %229
  %235 = phi i64 [ 1, %229 ], [ %233, %230 ]
  %236 = trunc i64 %235 to i32
  store i32 %236, ptr %11, align 4, !tbaa !9
  %237 = call ptr @__errno_location() #10
  store i32 0, ptr %237, align 4, !tbaa !9
  %238 = load i32, ptr %8, align 4, !tbaa !9
  %239 = load ptr, ptr %9, align 8, !tbaa !5
  %240 = load i32, ptr %11, align 4, !tbaa !9
  %241 = sext i32 %240 to i64
  %242 = call i32 @n_recv(i32 noundef %238, ptr noundef %239, i64 noundef %241)
  %243 = sext i32 %242 to i64
  store i64 %243, ptr %10, align 8, !tbaa !25
  %244 = load i64, ptr %10, align 8, !tbaa !25
  %245 = icmp ule i64 %244, 0
  br i1 %245, label %246, label %287

246:                                              ; preds = %234
  %247 = call ptr @__errno_location() #10
  %248 = load i32, ptr %247, align 4, !tbaa !9
  %249 = icmp ne i32 %248, 11
  br i1 %249, label %250, label %286

250:                                              ; preds = %246
  %251 = load i64, ptr %10, align 8, !tbaa !25
  %252 = icmp eq i64 %251, 0
  br i1 %252, label %253, label %261

253:                                              ; preds = %250
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %254 = load i32, ptr %8, align 4, !tbaa !9
  %255 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %5, ptr noundef @.str.33, i32 noundef %254) #8
  store i32 %255, ptr %27, align 4, !tbaa !9
  %256 = load i32, ptr %27, align 4, !tbaa !9
  %257 = icmp slt i32 %256, 0
  br i1 %257, label %258, label %259

258:                                              ; preds = %253
  call void @PRINT_ERR(ptr noundef @.str.2)
  br label %259

259:                                              ; preds = %258, %253
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  %260 = load ptr, ptr %5, align 8, !tbaa !5
  call void @PRINT_DBG_FREE(ptr noundef %260)
  br label %269

261:                                              ; preds = %250
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  %262 = load i32, ptr %8, align 4, !tbaa !9
  %263 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %5, ptr noundef @.str.34, i32 noundef %262) #8
  store i32 %263, ptr %28, align 4, !tbaa !9
  %264 = load i32, ptr %28, align 4, !tbaa !9
  %265 = icmp slt i32 %264, 0
  br i1 %265, label %266, label %267

266:                                              ; preds = %261
  call void @PRINT_ERR(ptr noundef @.str.2)
  br label %267

267:                                              ; preds = %266, %261
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  %268 = load ptr, ptr %5, align 8, !tbaa !5
  call void @PRINT_INFO_FREE(ptr noundef %268)
  store i32 -1108, ptr %4, align 4, !tbaa !9
  br label %269

269:                                              ; preds = %267, %259
  %270 = load i32, ptr %8, align 4, !tbaa !9
  %271 = call i32 @close(i32 noundef %270)
  %272 = load i32, ptr %8, align 4, !tbaa !9
  %273 = srem i32 %272, 64
  %274 = zext i32 %273 to i64
  %275 = shl i64 1, %274
  %276 = xor i64 %275, -1
  %277 = load ptr, ptr %3, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %277, i32 0, i32 13
  %279 = getelementptr inbounds %struct.fd_set, ptr %278, i32 0, i32 0
  %280 = load i32, ptr %8, align 4, !tbaa !9
  %281 = sdiv i32 %280, 64
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [16 x i64], ptr %279, i64 0, i64 %282
  %284 = load i64, ptr %283, align 8, !tbaa !25
  %285 = and i64 %284, %276
  store i64 %285, ptr %283, align 8, !tbaa !25
  br label %286

286:                                              ; preds = %269, %246
  br label %296

287:                                              ; preds = %234
  %288 = load ptr, ptr %3, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %288, i32 0, i32 16
  %290 = load i64, ptr %10, align 8, !tbaa !25
  %291 = atomicrmw add ptr %289, i64 %290 seq_cst, align 8
  br label %292

292:                                              ; preds = %287
  br label %293

293:                                              ; preds = %292
  %294 = load i32, ptr %20, align 4, !tbaa !9
  %295 = add nsw i32 %294, 1
  store i32 %295, ptr %20, align 4, !tbaa !9
  br label %221, !llvm.loop !37

296:                                              ; preds = %286, %221
  br label %297

297:                                              ; preds = %296, %219
  br label %298

298:                                              ; preds = %297, %102
  %299 = load i32, ptr %8, align 4, !tbaa !9
  %300 = add nsw i32 %299, 1
  store i32 %300, ptr %8, align 4, !tbaa !9
  br label %83, !llvm.loop !39

301:                                              ; preds = %117, %83
  br label %49

302:                                              ; preds = %64
  %303 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %303) #8
  %304 = load ptr, ptr %18, align 8, !tbaa !5
  call void @free(ptr noundef %304) #8
  %305 = load ptr, ptr %3, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %305, i32 0, i32 11
  %307 = load i32, ptr %306, align 8, !tbaa !26
  %308 = call i32 @close(i32 noundef %307)
  %309 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %309, ptr %2, align 4
  store i32 1, ptr %21, align 4
  br label %310

310:                                              ; preds = %302, %46, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 128, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 128, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 128, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 128, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  %311 = load i32, ptr %2, align 4
  ret i32 %311
}

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { "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 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 #7 = { inlinehint 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 #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { nounwind willreturn memory(none) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 32}
!12 = !{!"ntttcp_stream_server", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24, !13, i64 32, !14, i64 40, !14, i64 41, !14, i64 42, !14, i64 43, !14, i64 44, !10, i64 48, !10, i64 52, !15, i64 56, !15, i64 184, !10, i64 312, !13, i64 320}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!"", !7, i64 0}
!16 = !{!12, !10, i64 8}
!17 = !{!12, !6, i64 0}
!18 = !{!19, !14, i64 64}
!19 = !{!"ntttcp_test_endpoint", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !20, i64 24, !20, i64 40, !10, i64 56, !10, i64 60, !14, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !14, i64 96, !6, i64 104, !10, i64 112, !7, i64 116}
!20 = !{!"timeval", !13, i64 0, !13, i64 8}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!19, !10, i64 16}
!24 = !{!12, !10, i64 52}
!25 = !{!13, !13, i64 0}
!26 = !{!12, !10, i64 48}
!27 = !{!7, !7, i64 0}
!28 = !{!29, !30, i64 2}
!29 = !{!"sockaddr_in", !30, i64 0, !30, i64 2, !31, i64 4, !7, i64 8}
!30 = !{!"short", !7, i64 0}
!31 = !{!"in_addr", !10, i64 0}
!32 = !{!33, !30, i64 2}
!33 = !{!"sockaddr_in6", !30, i64 0, !30, i64 2, !10, i64 4, !34, i64 8, !10, i64 24}
!34 = !{!"in6_addr", !7, i64 0}
!35 = !{!12, !14, i64 41}
!36 = !{!12, !14, i64 40}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !38}


; 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] }
%struct.sockaddr_storage = type { i16, [118 x i8], i64 }

@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @n_recv(i32 noundef, ptr noundef, i64 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) #1

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

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

; 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) #3

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

declare void @PRINT_ERR(ptr noundef) local_unnamed_addr #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: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #7

declare i32 @close(i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @__bswap_16(i16 noundef zeroext) local_unnamed_addr #8

declare ptr @retrive_ip_address_str(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #5

declare void @PRINT_DBG_FREE(ptr noundef) local_unnamed_addr #5

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

declare i32 @set_socket_non_blocking(i32 noundef) local_unnamed_addr #5

declare i32 @accept(i32 noundef, ptr, ptr noundef) local_unnamed_addr #5

declare void @turn_on_light() local_unnamed_addr #5

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1106, 1) i32 @ntttcp_server_select(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.fd_set, align 8
  %4 = alloca %struct.sockaddr_storage, align 8
  %5 = alloca %struct.sockaddr_storage, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  store ptr null, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %5) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  %8 = getelementptr inbounds i8, ptr %0, i64 32
  %9 = load i64, ptr %8, align 8, !tbaa !9
  %10 = tail call noalias ptr @malloc(i64 noundef %9) #10
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %13

12:                                               ; preds = %1
  tail call void @PRINT_ERR(ptr noundef nonnull @.str.24) #9
  br label %147

13:                                               ; preds = %1
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = load i32, ptr %14, align 8, !tbaa !15
  %16 = icmp eq i32 %15, 2
  %17 = select i1 %16, i64 16, i64 46
  %18 = tail call noalias ptr @malloc(i64 noundef %17) #10
  %19 = icmp eq ptr %18, null
  br i1 %19, label %28, label %.preheader79

.preheader79:                                     ; preds = %13
  %20 = getelementptr inbounds i8, ptr %0, i64 56
  %21 = getelementptr inbounds i8, ptr %0, i64 52
  %22 = getelementptr inbounds i8, ptr %0, i64 48
  %23 = getelementptr inbounds i8, ptr %0, i64 40
  %24 = getelementptr inbounds i8, ptr %0, i64 320
  %25 = getelementptr inbounds i8, ptr %4, i64 2
  %26 = getelementptr inbounds i8, ptr %5, i64 2
  %27 = getelementptr inbounds i8, ptr %0, i64 41
  br label %.outer.outer

28:                                               ; preds = %13
  tail call void @PRINT_ERR(ptr noundef nonnull @.str.25) #9
  tail call void @free(ptr noundef nonnull %10) #9
  br label %147

.peel.next:                                       ; preds = %142, %42
  call void @PRINT_ERR(ptr noundef nonnull @.str.35) #9
  %29 = load ptr, ptr %0, align 8, !tbaa !16
  %30 = getelementptr inbounds i8, ptr %29, i64 64
  %31 = load i8, ptr %30, align 8, !tbaa !17, !range !20, !noundef !21
  %32 = trunc nuw i8 %31 to i1
  br i1 %32, label %33, label %37

33:                                               ; preds = %.peel.next
  %34 = getelementptr inbounds i8, ptr %29, i64 16
  %35 = load i32, ptr %34, align 8, !tbaa !22
  %36 = icmp eq i32 %35, 13
  br i1 %36, label %.loopexit93, label %37

37:                                               ; preds = %33, %.peel.next
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(128) %3, ptr noundef nonnull align 8 dereferenceable(128) %20, i64 128, i1 false)
  %38 = load i32, ptr %21, align 4, !tbaa !23
  %39 = add nsw i32 %38, 1
  %40 = call i32 @select(i32 noundef %39, ptr noundef nonnull %3, ptr noundef null, ptr noundef null, ptr noundef null) #9
  %41 = icmp slt i32 %40, 0
  br i1 %41, label %42, label %.loopexit94

42:                                               ; preds = %37
  %43 = load i32, ptr %143, align 4, !tbaa !24
  %.not = icmp eq i32 %43, 4
  br i1 %.not, label %.loopexit94, label %.peel.next, !llvm.loop !25

.loopexit94:                                      ; preds = %42, %37, %142, %137
  %.063.lcssa91 = phi i32 [ %.063.ph, %137 ], [ %.063.ph, %142 ], [ -1106, %37 ], [ -1106, %42 ]
  %44 = load i32, ptr %21, align 4, !tbaa !23
  %.not7584 = icmp slt i32 %44, 0
  br i1 %.not7584, label %.outer, label %.lr.ph

.lr.ph:                                           ; preds = %.loopexit94, %.loopexit
  %.06486 = phi i32 [ %127, %.loopexit ], [ 0, %.loopexit94 ]
  %.16685 = phi ptr [ %.368, %.loopexit ], [ %.065.ph.ph107, %.loopexit94 ]
  %45 = lshr i32 %.06486, 6
  %46 = zext nneg i32 %45 to i64
  %47 = getelementptr inbounds [16 x i64], ptr %3, i64 0, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !27
  %49 = and i32 %.06486, 63
  %50 = zext nneg i32 %49 to i64
  %51 = shl nuw i64 1, %50
  %52 = and i64 %48, %51
  %.not76 = icmp eq i64 %52, 0
  br i1 %.not76, label %.loopexit, label %53

53:                                               ; preds = %.lr.ph
  %54 = load i32, ptr %22, align 8, !tbaa !28
  %55 = icmp eq i32 %.06486, %54
  br i1 %55, label %57, label %.preheader

.preheader:                                       ; preds = %53
  %56 = tail call ptr @__errno_location() #11
  br label %100

57:                                               ; preds = %53
  store i32 128, ptr %6, align 4, !tbaa !24
  %58 = call i32 @accept(i32 noundef %.06486, ptr nonnull %4, ptr noundef nonnull %6) #9
  %59 = icmp slt i32 %58, 0
  br i1 %59, label %.outer.loopexit, label %60

60:                                               ; preds = %57
  %61 = call i32 @set_socket_non_blocking(i32 noundef %58) #9
  %62 = icmp eq i32 %61, -1
  br i1 %62, label %63, label %69

63:                                               ; preds = %60
  %64 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.30, i32 noundef %58) #9
  %65 = icmp slt i32 %64, 0
  br i1 %65, label %66, label %67

66:                                               ; preds = %63
  call void @PRINT_ERR(ptr noundef nonnull @.str.2) #9
  br label %67

67:                                               ; preds = %66, %63
  %68 = load ptr, ptr %2, align 8, !tbaa !5
  call void @PRINT_DBG_FREE(ptr noundef %68) #9
  br label %69

69:                                               ; preds = %67, %60
  %70 = and i32 %58, 63
  %71 = zext nneg i32 %70 to i64
  %72 = shl nuw i64 1, %71
  %73 = lshr i32 %58, 6
  %74 = zext nneg i32 %73 to i64
  %75 = getelementptr inbounds [16 x i64], ptr %20, i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !27
  %77 = or i64 %76, %72
  store i64 %77, ptr %75, align 8, !tbaa !27
  %78 = load i32, ptr %21, align 4, !tbaa !23
  %79 = icmp sgt i32 %58, %78
  br i1 %79, label %80, label %81

80:                                               ; preds = %69
  store i32 %58, ptr %21, align 4, !tbaa !23
  br label %81

81:                                               ; preds = %80, %69
  store i32 128, ptr %7, align 4, !tbaa !24
  %82 = call i32 @getsockname(i32 noundef %58, ptr nonnull %5, ptr noundef nonnull %7) #9
  %.not78 = icmp eq i32 %82, 0
  br i1 %.not78, label %86, label %83

83:                                               ; preds = %81
  %84 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.31, i32 noundef %58) #9
  %85 = icmp slt i32 %84, 0
  br i1 %85, label %.sink.split, label %96

86:                                               ; preds = %81
  %87 = call ptr @retrive_ip_address_str(ptr noundef nonnull %4, ptr noundef %.16685, i64 noundef %17) #9
  %88 = load i16, ptr %25, align 2
  %89 = call zeroext i16 @__bswap_16(i16 noundef zeroext %88)
  %90 = zext i16 %89 to i32
  %91 = load i16, ptr %26, align 2
  %92 = call zeroext i16 @__bswap_16(i16 noundef zeroext %91)
  %93 = zext i16 %92 to i32
  %94 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.32, ptr noundef %87, i32 noundef %90, i32 noundef %93, i32 noundef %58) #9
  %95 = icmp slt i32 %94, 0
  br i1 %95, label %.sink.split, label %96

.sink.split:                                      ; preds = %86, %83
  %.267.ph = phi ptr [ %.16685, %83 ], [ %87, %86 ]
  call void @PRINT_ERR(ptr noundef nonnull @.str.2) #9
  br label %96

96:                                               ; preds = %.sink.split, %86, %83
  %.267 = phi ptr [ %.16685, %83 ], [ %87, %86 ], [ %.267.ph, %.sink.split ]
  %.sink = load ptr, ptr %2, align 8, !tbaa !5
  call void @PRINT_DBG_FREE(ptr noundef %.sink) #9
  %97 = load i8, ptr %27, align 1, !tbaa !29, !range !20, !noundef !21
  %98 = trunc nuw i8 %97 to i1
  br i1 %98, label %99, label %.loopexit

99:                                               ; preds = %96
  call void @turn_on_light() #9
  br label %.loopexit

100:                                              ; preds = %.preheader, %123
  %.06983 = phi i32 [ 0, %.preheader ], [ %126, %123 ]
  %101 = load i8, ptr %23, align 8, !tbaa !30, !range !20, !noundef !21
  %102 = trunc nuw i8 %101 to i1
  br i1 %102, label %105, label %103

103:                                              ; preds = %100
  %104 = load i64, ptr %8, align 8, !tbaa !9
  br label %105

105:                                              ; preds = %100, %103
  %106 = phi i64 [ %104, %103 ], [ 1, %100 ]
  store i32 0, ptr %56, align 4, !tbaa !24
  %sext = shl i64 %106, 32
  %107 = ashr exact i64 %sext, 32
  %108 = call i32 @n_recv(i32 noundef %.06486, ptr noundef nonnull %10, i64 noundef %107)
  %109 = icmp eq i32 %108, 0
  br i1 %109, label %110, label %123

110:                                              ; preds = %105
  %111 = load i32, ptr %56, align 4, !tbaa !24
  %.not77 = icmp eq i32 %111, 11
  br i1 %.not77, label %.loopexit, label %112

112:                                              ; preds = %110
  %113 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.33, i32 noundef %.06486) #9
  %114 = icmp slt i32 %113, 0
  br i1 %114, label %115, label %116

115:                                              ; preds = %112
  call void @PRINT_ERR(ptr noundef nonnull @.str.2) #9
  br label %116

116:                                              ; preds = %115, %112
  %117 = load ptr, ptr %2, align 8, !tbaa !5
  call void @PRINT_DBG_FREE(ptr noundef %117) #9
  %118 = call i32 @close(i32 noundef %.06486) #9
  %119 = xor i64 %51, -1
  %120 = getelementptr inbounds [16 x i64], ptr %20, i64 0, i64 %46
  %121 = load i64, ptr %120, align 8, !tbaa !27
  %122 = and i64 %121, %119
  store i64 %122, ptr %120, align 8, !tbaa !27
  br label %.loopexit

123:                                              ; preds = %105
  %124 = sext i32 %108 to i64
  %125 = atomicrmw add ptr %24, i64 %124 seq_cst, align 8
  %126 = add nuw nsw i32 %.06983, 1
  %exitcond.not = icmp eq i32 %126, 32
  br i1 %exitcond.not, label %.loopexit, label %100, !llvm.loop !31

.loopexit:                                        ; preds = %123, %99, %96, %110, %116, %.lr.ph
  %.368 = phi ptr [ %.267, %99 ], [ %.267, %96 ], [ %.16685, %116 ], [ %.16685, %110 ], [ %.16685, %.lr.ph ], [ %.16685, %123 ]
  %127 = add nuw nsw i32 %.06486, 1
  %128 = load i32, ptr %21, align 4, !tbaa !23
  %.not75.not = icmp slt i32 %.06486, %128
  br i1 %.not75.not, label %.lr.ph, label %.outer.loopexit, !llvm.loop !33

.outer.loopexit:                                  ; preds = %.loopexit, %57
  %.065.ph.ph = phi ptr [ %.16685, %57 ], [ %.368, %.loopexit ]
  %.063.ph.ph = phi i32 [ -1105, %57 ], [ %.063.lcssa91, %.loopexit ]
  br label %.outer.outer

.outer.outer:                                     ; preds = %.outer.loopexit, %.preheader79
  %.065.ph.ph107 = phi ptr [ %.065.ph.ph, %.outer.loopexit ], [ %18, %.preheader79 ]
  %.063.ph.ph108 = phi i32 [ %.063.ph.ph, %.outer.loopexit ], [ 0, %.preheader79 ]
  br label %.outer

.outer:                                           ; preds = %.outer.outer, %.loopexit94
  %.063.ph = phi i32 [ %.063.lcssa91, %.loopexit94 ], [ %.063.ph.ph108, %.outer.outer ]
  %129 = load ptr, ptr %0, align 8, !tbaa !16
  %130 = getelementptr inbounds i8, ptr %129, i64 64
  %131 = load i8, ptr %130, align 8, !tbaa !17, !range !20, !noundef !21
  %132 = trunc nuw i8 %131 to i1
  br i1 %132, label %133, label %137

133:                                              ; preds = %.outer
  %134 = getelementptr inbounds i8, ptr %129, i64 16
  %135 = load i32, ptr %134, align 8, !tbaa !22
  %136 = icmp eq i32 %135, 13
  br i1 %136, label %.loopexit93, label %137

137:                                              ; preds = %133, %.outer
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(128) %3, ptr noundef nonnull align 8 dereferenceable(128) %20, i64 128, i1 false)
  %138 = load i32, ptr %21, align 4, !tbaa !23
  %139 = add nsw i32 %138, 1
  %140 = call i32 @select(i32 noundef %139, ptr noundef nonnull %3, ptr noundef null, ptr noundef null, ptr noundef null) #9
  %141 = icmp slt i32 %140, 0
  br i1 %141, label %142, label %.loopexit94

142:                                              ; preds = %137
  %143 = tail call ptr @__errno_location() #11
  %144 = load i32, ptr %143, align 4, !tbaa !24
  %.not.peel = icmp eq i32 %144, 4
  br i1 %.not.peel, label %.loopexit94, label %.peel.next

.loopexit93:                                      ; preds = %133, %33
  %.063.lcssa = phi i32 [ -1106, %33 ], [ %.063.ph, %133 ]
  call void @free(ptr noundef %10) #9
  call void @free(ptr noundef %.065.ph.ph107) #9
  %145 = load i32, ptr %22, align 8, !tbaa !28
  %146 = call i32 @close(i32 noundef %145) #9
  br label %147

147:                                              ; preds = %.loopexit93, %28, %12
  %.0 = phi i32 [ -1002, %12 ], [ -1002, %28 ], [ %.063.lcssa, %.loopexit93 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  ret i32 %.0
}

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 = { 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 #8 = { inlinehint 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 #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
attributes #11 = { nounwind willreturn memory(none) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !12, i64 32}
!10 = !{!"ntttcp_stream_server", !6, i64 0, !11, i64 8, !11, i64 12, !6, i64 16, !11, i64 24, !12, i64 32, !13, i64 40, !13, i64 41, !13, i64 42, !13, i64 43, !13, i64 44, !11, i64 48, !11, i64 52, !14, i64 56, !14, i64 184, !11, i64 312, !12, i64 320}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!"", !7, i64 0}
!15 = !{!10, !11, i64 8}
!16 = !{!10, !6, i64 0}
!17 = !{!18, !13, i64 64}
!18 = !{!"ntttcp_test_endpoint", !11, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !19, i64 24, !19, i64 40, !11, i64 56, !11, i64 60, !13, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !13, i64 96, !6, i64 104, !11, i64 112, !7, i64 116}
!19 = !{!"timeval", !12, i64 0, !12, i64 8}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!18, !11, i64 16}
!23 = !{!10, !11, i64 52}
!24 = !{!11, !11, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.peeled.count", i32 1}
!27 = !{!12, !12, i64 0}
!28 = !{!10, !11, i64 48}
!29 = !{!10, !13, i64 41}
!30 = !{!10, !13, i64 40}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = distinct !{!33, !32}


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