; 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.timeval = type { i64, i64 }
%struct.sockaddr_storage = type { i16, [118 x i8], i64 }
%struct.addrinfo = type { i32, i32, i32, i32, i32, ptr, ptr, ptr }
%struct.tcp_info = type { i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%union.__CONST_SOCKADDR_ARG = type { ptr }
%union.__SOCKADDR_ARG = type { ptr }
%struct.ntttcp_stream_client = type { ptr, i32, i32, ptr, i32, i32, i32, i64, i64, i64, i8, i8, i8, i8, i8, i32, i32, 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] }

@__const.run_ntttcp_sender_tcp_stream.timeout = external hidden unnamed_addr constant %struct.timeval, align 8
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [29 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @run_ntttcp_sender_tcp_stream(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca [1000 x i32], align 16
  %14 = alloca %struct.sockaddr_storage, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca %struct.addrinfo, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca %struct.timeval, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %struct.tcp_info, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca %union.__CONST_SOCKADDR_ARG, align 8
  %32 = alloca i32, align 4
  %33 = alloca %union.__CONST_SOCKADDR_ARG, align 8
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca %union.__SOCKADDR_ARG, align 8
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #9
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4000, ptr %13) #9
  call void @llvm.memset.p0.i64(ptr align 16 %13, i8 0, i64 4000, i1 false)
  %40 = getelementptr inbounds <{ i32, [999 x i32] }>, ptr %13, i32 0, i32 0
  store i32 -1, ptr %40, align 16
  call void @llvm.lifetime.start.p0(i64 128, ptr %14) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  store i32 128, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  call void @llvm.lifetime.start.p0(i64 48, ptr %19) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 @__const.run_ntttcp_sender_tcp_stream.timeout, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  store i32 0, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  store i32 0, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 104, ptr %25) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  store i32 104, ptr %26, align 4, !tbaa !9
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %41, ptr %11, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %19, i8 0, i64 48, i1 false)
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %42, i32 0, i32 1
  %44 = load i32, ptr %43, align 8, !tbaa !11
  %45 = getelementptr inbounds %struct.addrinfo, ptr %19, i32 0, i32 1
  store i32 %44, ptr %45, align 4, !tbaa !15
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %46, i32 0, i32 2
  %48 = load i32, ptr %47, align 4, !tbaa !17
  %49 = getelementptr inbounds %struct.addrinfo, ptr %19, i32 0, i32 2
  store i32 %48, ptr %49, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #9
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %50, i32 0, i32 4
  %52 = load i32, ptr %51, align 8, !tbaa !19
  %53 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %18, ptr noundef @.str.1, i32 noundef %52) #9
  store i32 %53, ptr %27, align 4, !tbaa !9
  %54 = load i32, ptr %27, align 4, !tbaa !9
  %55 = icmp slt i32 %54, 0
  br i1 %55, label %56, label %57

56:                                               ; preds = %1
  call void @PRINT_ERR(ptr noundef @.str.2)
  br label %57

57:                                               ; preds = %56, %1
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #9
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %58, i32 0, i32 3
  %60 = load ptr, ptr %59, align 8, !tbaa !20
  %61 = load ptr, ptr %18, align 8, !tbaa !5
  %62 = call i32 @getaddrinfo(ptr noundef %60, ptr noundef %61, ptr noundef %19, ptr noundef %20)
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %65

64:                                               ; preds = %57
  call void @PRINT_ERR(ptr noundef @.str.3)
  store ptr null, ptr %2, align 8
  store i32 1, ptr %28, align 4
  br label %460

65:                                               ; preds = %57
  %66 = load ptr, ptr %18, align 8, !tbaa !5
  call void @free(ptr noundef %66) #9
  %67 = load ptr, ptr %11, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %67, i32 0, i32 1
  %69 = load i32, ptr %68, align 8, !tbaa !11
  %70 = icmp eq i32 %69, 2
  %71 = zext i1 %70 to i64
  %72 = select i1 %70, i32 16, i32 46
  store i32 %72, ptr %17, align 4, !tbaa !9
  %73 = load i32, ptr %17, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = call noalias ptr @malloc(i64 noundef %74) #10
  store ptr %75, ptr %16, align 8, !tbaa !5
  %76 = load ptr, ptr %16, align 8, !tbaa !5
  %77 = icmp eq ptr %76, null
  br i1 %77, label %78, label %80

78:                                               ; preds = %65
  call void @PRINT_ERR(ptr noundef @.str.4)
  %79 = load ptr, ptr %20, align 8, !tbaa !5
  call void @freeaddrinfo(ptr noundef %79) #9
  store ptr null, ptr %2, align 8
  store i32 1, ptr %28, align 4
  br label %460

80:                                               ; preds = %65
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %325, %80
  %82 = load i32, ptr %6, align 4, !tbaa !9
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %83, i32 0, i32 6
  %85 = load i32, ptr %84, align 8, !tbaa !21
  %86 = icmp ult i32 %82, %85
  br i1 %86, label %87, label %328

87:                                               ; preds = %81
  %88 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %88, ptr %21, align 8, !tbaa !5
  br label %89

89:                                               ; preds = %320, %87
  %90 = load ptr, ptr %21, align 8, !tbaa !5
  %91 = icmp ne ptr %90, null
  br i1 %91, label %92, label %324

92:                                               ; preds = %89
  %93 = load ptr, ptr %21, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.addrinfo, ptr %93, i32 0, i32 1
  %95 = load i32, ptr %94, align 4, !tbaa !15
  %96 = load ptr, ptr %21, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.addrinfo, ptr %96, i32 0, i32 2
  %98 = load i32, ptr %97, align 8, !tbaa !18
  %99 = load ptr, ptr %21, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.addrinfo, ptr %99, i32 0, i32 3
  %101 = load i32, ptr %100, align 4, !tbaa !22
  %102 = call i32 @socket(i32 noundef %95, i32 noundef %98, i32 noundef %101) #9
  store i32 %102, ptr %5, align 4, !tbaa !9
  %103 = icmp slt i32 %102, 0
  br i1 %103, label %104, label %108

104:                                              ; preds = %92
  call void @PRINT_ERR(ptr noundef @.str.5)
  %105 = load i32, ptr %6, align 4, !tbaa !9
  %106 = zext i32 %105 to i64
  %107 = getelementptr inbounds [1000 x i32], ptr %13, i64 0, i64 %106
  store i32 -1, ptr %107, align 4, !tbaa !9
  br label %320

108:                                              ; preds = %92
  %109 = load i32, ptr %5, align 4, !tbaa !9
  %110 = call i32 @setsockopt(i32 noundef %109, i32 noundef 1, i32 noundef 21, ptr noundef %22, i32 noundef 16) #9
  %111 = icmp slt i32 %110, 0
  br i1 %111, label %112, label %125

112:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #9
  %113 = load i32, ptr %5, align 4, !tbaa !9
  %114 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %4, ptr noundef @.str.6, i32 noundef %113) #9
  store i32 %114, ptr %29, align 4, !tbaa !9
  %115 = load i32, ptr %29, align 4, !tbaa !9
  %116 = icmp slt i32 %115, 0
  br i1 %116, label %117, label %118

117:                                              ; preds = %112
  call void @PRINT_ERR(ptr noundef @.str.2)
  br label %118

118:                                              ; preds = %117, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #9
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  call void @PRINT_INFO_FREE(ptr noundef %119)
  %120 = load i32, ptr %5, align 4, !tbaa !9
  %121 = call i32 @close(i32 noundef %120)
  %122 = load i32, ptr %6, align 4, !tbaa !9
  %123 = zext i32 %122 to i64
  %124 = getelementptr inbounds [1000 x i32], ptr %13, i64 0, i64 %123
  store i32 -1, ptr %124, align 4, !tbaa !9
  br label %320

125:                                              ; preds = %108
  %126 = load i32, ptr %5, align 4, !tbaa !9
  %127 = call i32 @setsockopt(i32 noundef %126, i32 noundef 1, i32 noundef 20, ptr noundef %22, i32 noundef 16) #9
  %128 = icmp slt i32 %127, 0
  br i1 %128, label %129, label %142

129:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #9
  %130 = load i32, ptr %5, align 4, !tbaa !9
  %131 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %4, ptr noundef @.str.7, i32 noundef %130) #9
  store i32 %131, ptr %30, align 4, !tbaa !9
  %132 = load i32, ptr %30, align 4, !tbaa !9
  %133 = icmp slt i32 %132, 0
  br i1 %133, label %134, label %135

134:                                              ; preds = %129
  call void @PRINT_ERR(ptr noundef @.str.2)
  br label %135

135:                                              ; preds = %134, %129
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #9
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  call void @PRINT_INFO_FREE(ptr noundef %136)
  %137 = load i32, ptr %5, align 4, !tbaa !9
  %138 = call i32 @close(i32 noundef %137)
  %139 = load i32, ptr %6, align 4, !tbaa !9
  %140 = zext i32 %139 to i64
  %141 = getelementptr inbounds [1000 x i32], ptr %13, i64 0, i64 %140
  store i32 -1, ptr %141, align 4, !tbaa !9
  br label %320

142:                                              ; preds = %125
  br label %143

143:                                              ; preds = %142
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %144, i32 0, i32 5
  %146 = load i32, ptr %145, align 4, !tbaa !23
  %147 = icmp ne i32 %146, 0
  br i1 %147, label %148, label %201

148:                                              ; preds = %143
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %149, i32 0, i32 5
  %151 = load i32, ptr %150, align 4, !tbaa !23
  %152 = load i32, ptr %6, align 4, !tbaa !9
  %153 = add i32 %151, %152
  store i32 %153, ptr %12, align 4, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 128, i1 false)
  %154 = load ptr, ptr %11, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %154, i32 0, i32 1
  %156 = load i32, ptr %155, align 8, !tbaa !11
  %157 = icmp eq i32 %156, 2
  br i1 %157, label %158, label %164

158:                                              ; preds = %148
  %159 = getelementptr inbounds %struct.sockaddr_in, ptr %14, i32 0, i32 0
  store i16 2, ptr %159, align 8, !tbaa !24
  %160 = load i32, ptr %12, align 4, !tbaa !9
  %161 = trunc i32 %160 to i16
  %162 = call zeroext i16 @__bswap_16(i16 noundef zeroext %161)
  %163 = getelementptr inbounds %struct.sockaddr_in, ptr %14, i32 0, i32 1
  store i16 %162, ptr %163, align 2, !tbaa !28
  br label %170

164:                                              ; preds = %148
  %165 = getelementptr inbounds %struct.sockaddr_in6, ptr %14, i32 0, i32 0
  store i16 10, ptr %165, align 8, !tbaa !29
  %166 = load i32, ptr %12, align 4, !tbaa !9
  %167 = trunc i32 %166 to i16
  %168 = call zeroext i16 @__bswap_16(i16 noundef zeroext %167)
  %169 = getelementptr inbounds %struct.sockaddr_in6, ptr %14, i32 0, i32 1
  store i16 %168, ptr %169, align 2, !tbaa !32
  br label %170

170:                                              ; preds = %164, %158
  %171 = load i32, ptr %5, align 4, !tbaa !9
  store ptr %14, ptr %31, align 8, !tbaa !33
  %172 = load i32, ptr %15, align 4, !tbaa !9
  %173 = getelementptr inbounds %union.__CONST_SOCKADDR_ARG, ptr %31, i32 0, i32 0
  %174 = load ptr, ptr %173, align 8
  %175 = call i32 @bind(i32 noundef %171, ptr %174, i32 noundef %172) #9
  store i32 %175, ptr %9, align 4, !tbaa !9
  %176 = icmp slt i32 %175, 0
  br i1 %176, label %177, label %200

177:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #9
  %178 = load i32, ptr %5, align 4, !tbaa !9
  %179 = load ptr, ptr %11, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %179, i32 0, i32 1
  %181 = load i32, ptr %180, align 8, !tbaa !11
  %182 = icmp eq i32 %181, 2
  br i1 %182, label %183, label %188

183:                                              ; preds = %177
  %184 = getelementptr inbounds %struct.sockaddr_in, ptr %14, i32 0, i32 2
  %185 = getelementptr inbounds %struct.in_addr, ptr %184, i32 0, i32 0
  %186 = load i32, ptr %185, align 4
  %187 = call ptr @inet_ntoa(i32 %186) #9
  br label %189

188:                                              ; preds = %177
  br label %189

189:                                              ; preds = %188, %183
  %190 = phi ptr [ %187, %183 ], [ @.str.9, %188 ]
  %191 = load i32, ptr %12, align 4, !tbaa !9
  %192 = call ptr @__errno_location() #11
  %193 = load i32, ptr %192, align 4, !tbaa !9
  %194 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %4, ptr noundef @.str.8, i32 noundef %178, ptr noundef %190, i32 noundef %191, i32 noundef %193) #9
  store i32 %194, ptr %32, align 4, !tbaa !9
  %195 = load i32, ptr %32, align 4, !tbaa !9
  %196 = icmp slt i32 %195, 0
  br i1 %196, label %197, label %198

197:                                              ; preds = %189
  call void @PRINT_ERR(ptr noundef @.str.2)
  br label %198

198:                                              ; preds = %197, %189
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #9
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  call void @PRINT_INFO_FREE(ptr noundef %199)
  br label %200

200:                                              ; preds = %198, %170
  br label %201

201:                                              ; preds = %200, %143
  %202 = load ptr, ptr %21, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.addrinfo, ptr %202, i32 0, i32 5
  %204 = load ptr, ptr %203, align 8, !tbaa !34
  %205 = load ptr, ptr %16, align 8, !tbaa !5
  %206 = load i32, ptr %17, align 4, !tbaa !9
  %207 = sext i32 %206 to i64
  %208 = call ptr @retrive_ip_address_str(ptr noundef %204, ptr noundef %205, i64 noundef %207)
  store ptr %208, ptr %16, align 8, !tbaa !5
  %209 = load i32, ptr %5, align 4, !tbaa !9
  %210 = load ptr, ptr %21, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.addrinfo, ptr %210, i32 0, i32 5
  %212 = load ptr, ptr %211, align 8, !tbaa !34
  store ptr %212, ptr %33, align 8, !tbaa !33
  %213 = load ptr, ptr %21, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.addrinfo, ptr %213, i32 0, i32 4
  %215 = load i32, ptr %214, align 8, !tbaa !35
  %216 = getelementptr inbounds %union.__CONST_SOCKADDR_ARG, ptr %33, i32 0, i32 0
  %217 = load ptr, ptr %216, align 8
  %218 = call i32 @connect(i32 noundef %209, ptr %217, i32 noundef %215)
  store i32 %218, ptr %9, align 4, !tbaa !9
  %219 = icmp slt i32 %218, 0
  br i1 %219, label %220, label %263

220:                                              ; preds = %201
  %221 = call ptr @__errno_location() #11
  %222 = load i32, ptr %221, align 4, !tbaa !9
  %223 = icmp eq i32 %222, 115
  br i1 %223, label %224, label %243

224:                                              ; preds = %220
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #9
  %225 = load ptr, ptr %16, align 8, !tbaa !5
  %226 = load ptr, ptr %11, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %226, i32 0, i32 4
  %228 = load i32, ptr %227, align 8, !tbaa !19
  %229 = load i32, ptr %5, align 4, !tbaa !9
  %230 = load i32, ptr %9, align 4, !tbaa !9
  %231 = call ptr @__errno_location() #11
  %232 = load i32, ptr %231, align 4, !tbaa !9
  %233 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %4, ptr noundef @.str.10, ptr noundef %225, i32 noundef %228, i32 noundef %229, i32 noundef %230, i32 noundef %232) #9
  store i32 %233, ptr %34, align 4, !tbaa !9
  %234 = load i32, ptr %34, align 4, !tbaa !9
  %235 = icmp slt i32 %234, 0
  br i1 %235, label %236, label %237

236:                                              ; preds = %224
  call void @PRINT_ERR(ptr noundef @.str.2)
  br label %237

237:                                              ; preds = %236, %224
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #9
  %238 = load ptr, ptr %4, align 8, !tbaa !5
  call void @PRINT_DBG_FREE(ptr noundef %238)
  %239 = load i32, ptr %5, align 4, !tbaa !9
  %240 = call i32 @close(i32 noundef %239)
  %241 = load i32, ptr %6, align 4, !tbaa !9
  %242 = add i32 %241, -1
  store i32 %242, ptr %6, align 4, !tbaa !9
  br label %324

243:                                              ; preds = %220
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #9
  %244 = load ptr, ptr %16, align 8, !tbaa !5
  %245 = load ptr, ptr %11, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %245, i32 0, i32 4
  %247 = load i32, ptr %246, align 8, !tbaa !19
  %248 = load i32, ptr %5, align 4, !tbaa !9
  %249 = load i32, ptr %9, align 4, !tbaa !9
  %250 = call ptr @__errno_location() #11
  %251 = load i32, ptr %250, align 4, !tbaa !9
  %252 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %4, ptr noundef @.str.11, ptr noundef %244, i32 noundef %247, i32 noundef %248, i32 noundef %249, i32 noundef %251) #9
  store i32 %252, ptr %35, align 4, !tbaa !9
  %253 = load i32, ptr %35, align 4, !tbaa !9
  %254 = icmp slt i32 %253, 0
  br i1 %254, label %255, label %256

255:                                              ; preds = %243
  call void @PRINT_ERR(ptr noundef @.str.2)
  br label %256

256:                                              ; preds = %255, %243
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #9
  %257 = load ptr, ptr %4, align 8, !tbaa !5
  call void @PRINT_INFO_FREE(ptr noundef %257)
  %258 = load i32, ptr %5, align 4, !tbaa !9
  %259 = call i32 @close(i32 noundef %258)
  %260 = load i32, ptr %6, align 4, !tbaa !9
  %261 = zext i32 %260 to i64
  %262 = getelementptr inbounds [1000 x i32], ptr %13, i64 0, i64 %261
  store i32 -1, ptr %262, align 4, !tbaa !9
  br label %320

263:                                              ; preds = %201
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 128, i1 false)
  %264 = load i32, ptr %5, align 4, !tbaa !9
  store ptr %14, ptr %36, align 8, !tbaa !33
  %265 = getelementptr inbounds %union.__SOCKADDR_ARG, ptr %36, i32 0, i32 0
  %266 = load ptr, ptr %265, align 8
  %267 = call i32 @getsockname(i32 noundef %264, ptr %266, ptr noundef %15) #9
  %268 = icmp ne i32 %267, 0
  br i1 %268, label %269, label %277

269:                                              ; preds = %263
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #9
  %270 = load i32, ptr %5, align 4, !tbaa !9
  %271 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %4, ptr noundef @.str.12, i32 noundef %270) #9
  store i32 %271, ptr %37, align 4, !tbaa !9
  %272 = load i32, ptr %37, align 4, !tbaa !9
  %273 = icmp slt i32 %272, 0
  br i1 %273, label %274, label %275

274:                                              ; preds = %269
  call void @PRINT_ERR(ptr noundef @.str.2)
  br label %275

275:                                              ; preds = %274, %269
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #9
  %276 = load ptr, ptr %4, align 8, !tbaa !5
  call void @PRINT_INFO_FREE(ptr noundef %276)
  br label %277

277:                                              ; preds = %275, %263
  %278 = load ptr, ptr %11, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %278, i32 0, i32 9
  %280 = load i64, ptr %279, align 8, !tbaa !36
  %281 = icmp ne i64 %280, 0
  br i1 %281, label %282, label %285

282:                                              ; preds = %277
  %283 = load ptr, ptr %11, align 8, !tbaa !5
  %284 = load i32, ptr %5, align 4, !tbaa !9
  call void @enable_fq_rate_limit(ptr noundef %283, i32 noundef %284)
  br label %285

285:                                              ; preds = %282, %277
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #9
  %286 = load ptr, ptr %11, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %286, i32 0, i32 1
  %288 = load i32, ptr %287, align 8, !tbaa !11
  %289 = icmp eq i32 %288, 2
  br i1 %289, label %290, label %294

290:                                              ; preds = %285
  %291 = getelementptr inbounds %struct.sockaddr_in, ptr %14, i32 0, i32 1
  %292 = load i16, ptr %291, align 2, !tbaa !28
  %293 = zext i16 %292 to i32
  br label %298

294:                                              ; preds = %285
  %295 = getelementptr inbounds %struct.sockaddr_in6, ptr %14, i32 0, i32 1
  %296 = load i16, ptr %295, align 2, !tbaa !32
  %297 = zext i16 %296 to i32
  br label %298

298:                                              ; preds = %294, %290
  %299 = phi i32 [ %293, %290 ], [ %297, %294 ]
  %300 = trunc i32 %299 to i16
  %301 = call zeroext i16 @__bswap_16(i16 noundef zeroext %300)
  %302 = zext i16 %301 to i32
  %303 = load i32, ptr %5, align 4, !tbaa !9
  %304 = load ptr, ptr %16, align 8, !tbaa !5
  %305 = load ptr, ptr %11, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %305, i32 0, i32 4
  %307 = load i32, ptr %306, align 8, !tbaa !19
  %308 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %4, ptr noundef @.str.13, i32 noundef %302, i32 noundef %303, ptr noundef %304, i32 noundef %307) #9
  store i32 %308, ptr %38, align 4, !tbaa !9
  %309 = load i32, ptr %38, align 4, !tbaa !9
  %310 = icmp slt i32 %309, 0
  br i1 %310, label %311, label %312

311:                                              ; preds = %298
  call void @PRINT_ERR(ptr noundef @.str.2)
  br label %312

312:                                              ; preds = %311, %298
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #9
  %313 = load ptr, ptr %4, align 8, !tbaa !5
  call void @PRINT_DBG_FREE(ptr noundef %313)
  %314 = load i32, ptr %5, align 4, !tbaa !9
  %315 = load i32, ptr %6, align 4, !tbaa !9
  %316 = zext i32 %315 to i64
  %317 = getelementptr inbounds [1000 x i32], ptr %13, i64 0, i64 %316
  store i32 %314, ptr %317, align 4, !tbaa !9
  %318 = load i32, ptr %10, align 4, !tbaa !9
  %319 = add i32 %318, 1
  store i32 %319, ptr %10, align 4, !tbaa !9
  br label %324

320:                                              ; preds = %256, %135, %118, %104
  %321 = load ptr, ptr %21, align 8, !tbaa !5
  %322 = getelementptr inbounds %struct.addrinfo, ptr %321, i32 0, i32 7
  %323 = load ptr, ptr %322, align 8, !tbaa !37
  store ptr %323, ptr %21, align 8, !tbaa !5
  br label %89, !llvm.loop !38

324:                                              ; preds = %312, %237, %89
  br label %325

325:                                              ; preds = %324
  %326 = load i32, ptr %6, align 4, !tbaa !9
  %327 = add i32 %326, 1
  store i32 %327, ptr %6, align 4, !tbaa !9
  br label %81, !llvm.loop !40

328:                                              ; preds = %81
  %329 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %329) #9
  %330 = load ptr, ptr %20, align 8, !tbaa !5
  call void @freeaddrinfo(ptr noundef %330) #9
  %331 = load i32, ptr %10, align 4, !tbaa !9
  %332 = icmp eq i32 %331, 0
  br i1 %332, label %333, label %334

333:                                              ; preds = %328
  br label %436

334:                                              ; preds = %328
  %335 = load i32, ptr %10, align 4, !tbaa !9
  %336 = load ptr, ptr %11, align 8, !tbaa !5
  %337 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %336, i32 0, i32 16
  store i32 %335, ptr %337, align 4, !tbaa !41
  call void @wait_light_on()
  %338 = load ptr, ptr %11, align 8, !tbaa !5
  %339 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %338, i32 0, i32 7
  %340 = load i64, ptr %339, align 8, !tbaa !42
  %341 = mul i64 %340, 1
  store i64 %341, ptr %39, align 8, !tbaa !43
  %342 = load i64, ptr %39, align 8, !tbaa !43
  %343 = call noalias ptr @malloc(i64 noundef %342) #10
  store ptr %343, ptr %7, align 8, !tbaa !5
  %344 = icmp eq ptr %343, null
  br i1 %344, label %345, label %346

345:                                              ; preds = %334
  call void @PRINT_ERR(ptr noundef @.str.14)
  br label %436

346:                                              ; preds = %334
  %347 = load ptr, ptr %7, align 8, !tbaa !5
  %348 = load i64, ptr %39, align 8, !tbaa !43
  call void @llvm.memset.p0.i64(ptr align 1 %347, i8 65, i64 %348, i1 false)
  br label %349

349:                                              ; preds = %391, %357, %346
  %350 = call i32 @is_light_turned_on()
  %351 = icmp ne i32 %350, 0
  br i1 %351, label %352, label %392

352:                                              ; preds = %349
  %353 = load ptr, ptr %11, align 8, !tbaa !5
  %354 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %353, i32 0, i32 10
  %355 = load i8, ptr %354, align 8, !tbaa !44, !range !45, !noundef !46
  %356 = trunc i8 %355 to i1
  br i1 %356, label %357, label %358

357:                                              ; preds = %352
  br label %349, !llvm.loop !47

358:                                              ; preds = %352
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %359

359:                                              ; preds = %388, %358
  %360 = load i32, ptr %6, align 4, !tbaa !9
  %361 = load ptr, ptr %11, align 8, !tbaa !5
  %362 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %361, i32 0, i32 6
  %363 = load i32, ptr %362, align 8, !tbaa !21
  %364 = icmp ult i32 %360, %363
  br i1 %364, label %365, label %391

365:                                              ; preds = %359
  %366 = load i32, ptr %6, align 4, !tbaa !9
  %367 = zext i32 %366 to i64
  %368 = getelementptr inbounds [1000 x i32], ptr %13, i64 0, i64 %367
  %369 = load i32, ptr %368, align 4, !tbaa !9
  store i32 %369, ptr %5, align 4, !tbaa !9
  %370 = load i32, ptr %5, align 4, !tbaa !9
  %371 = icmp slt i32 %370, 0
  br i1 %371, label %372, label %373

372:                                              ; preds = %365
  br label %388

373:                                              ; preds = %365
  %374 = load i32, ptr %5, align 4, !tbaa !9
  %375 = load ptr, ptr %7, align 8, !tbaa !5
  %376 = load i64, ptr %39, align 8, !tbaa !43
  %377 = call i32 @n_send(i32 noundef %374, ptr noundef %375, i64 noundef %376)
  store i32 %377, ptr %8, align 4, !tbaa !9
  %378 = load i32, ptr %8, align 4, !tbaa !9
  %379 = icmp slt i32 %378, 0
  br i1 %379, label %380, label %381

380:                                              ; preds = %373
  br label %388

381:                                              ; preds = %373
  %382 = load i32, ptr %8, align 4, !tbaa !9
  %383 = sext i32 %382 to i64
  %384 = load ptr, ptr %11, align 8, !tbaa !5
  %385 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %384, i32 0, i32 17
  %386 = load i64, ptr %385, align 8, !tbaa !48
  %387 = add i64 %386, %383
  store i64 %387, ptr %385, align 8, !tbaa !48
  br label %388

388:                                              ; preds = %381, %380, %372
  %389 = load i32, ptr %6, align 4, !tbaa !9
  %390 = add i32 %389, 1
  store i32 %390, ptr %6, align 4, !tbaa !9
  br label %359, !llvm.loop !49

391:                                              ; preds = %359
  br label %349, !llvm.loop !47

392:                                              ; preds = %349
  %393 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %393) #9
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %394

394:                                              ; preds = %423, %392
  %395 = load i32, ptr %6, align 4, !tbaa !9
  %396 = load ptr, ptr %11, align 8, !tbaa !5
  %397 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %396, i32 0, i32 6
  %398 = load i32, ptr %397, align 8, !tbaa !21
  %399 = icmp ult i32 %395, %398
  br i1 %399, label %400, label %426

400:                                              ; preds = %394
  %401 = load i32, ptr %6, align 4, !tbaa !9
  %402 = zext i32 %401 to i64
  %403 = getelementptr inbounds [1000 x i32], ptr %13, i64 0, i64 %402
  %404 = load i32, ptr %403, align 4, !tbaa !9
  %405 = icmp sge i32 %404, 0
  br i1 %405, label %406, label %422

406:                                              ; preds = %400
  %407 = load i32, ptr %6, align 4, !tbaa !9
  %408 = zext i32 %407 to i64
  %409 = getelementptr inbounds [1000 x i32], ptr %13, i64 0, i64 %408
  %410 = load i32, ptr %409, align 4, !tbaa !9
  %411 = call i32 @getsockopt(i32 noundef %410, i32 noundef 6, i32 noundef 11, ptr noundef %25, ptr noundef %26) #9
  %412 = icmp ne i32 %411, 0
  br i1 %412, label %413, label %414

413:                                              ; preds = %406
  call void @PRINT_INFO(ptr noundef @.str.15)
  br label %421

414:                                              ; preds = %406
  %415 = getelementptr inbounds %struct.tcp_info, ptr %25, i32 0, i32 22
  %416 = load i32, ptr %415, align 4, !tbaa !50
  %417 = load i32, ptr %23, align 4, !tbaa !9
  %418 = add i32 %417, %416
  store i32 %418, ptr %23, align 4, !tbaa !9
  %419 = load i32, ptr %24, align 4, !tbaa !9
  %420 = add i32 %419, 1
  store i32 %420, ptr %24, align 4, !tbaa !9
  br label %421

421:                                              ; preds = %414, %413
  br label %422

422:                                              ; preds = %421, %400
  br label %423

423:                                              ; preds = %422
  %424 = load i32, ptr %6, align 4, !tbaa !9
  %425 = add i32 %424, 1
  store i32 %425, ptr %6, align 4, !tbaa !9
  br label %394, !llvm.loop !52

426:                                              ; preds = %394
  %427 = load i32, ptr %24, align 4, !tbaa !9
  %428 = icmp ugt i32 %427, 0
  br i1 %428, label %429, label %435

429:                                              ; preds = %426
  %430 = load i32, ptr %23, align 4, !tbaa !9
  %431 = load i32, ptr %24, align 4, !tbaa !9
  %432 = udiv i32 %430, %431
  %433 = load ptr, ptr %11, align 8, !tbaa !5
  %434 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %433, i32 0, i32 15
  store i32 %432, ptr %434, align 8, !tbaa !53
  br label %435

435:                                              ; preds = %429, %426
  br label %436

436:                                              ; preds = %435, %345, %333
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %437

437:                                              ; preds = %456, %436
  %438 = load i32, ptr %6, align 4, !tbaa !9
  %439 = load ptr, ptr %11, align 8, !tbaa !5
  %440 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %439, i32 0, i32 6
  %441 = load i32, ptr %440, align 8, !tbaa !21
  %442 = icmp ult i32 %438, %441
  br i1 %442, label %443, label %459

443:                                              ; preds = %437
  %444 = load i32, ptr %6, align 4, !tbaa !9
  %445 = zext i32 %444 to i64
  %446 = getelementptr inbounds [1000 x i32], ptr %13, i64 0, i64 %445
  %447 = load i32, ptr %446, align 4, !tbaa !9
  %448 = icmp sge i32 %447, 0
  br i1 %448, label %449, label %455

449:                                              ; preds = %443
  %450 = load i32, ptr %6, align 4, !tbaa !9
  %451 = zext i32 %450 to i64
  %452 = getelementptr inbounds [1000 x i32], ptr %13, i64 0, i64 %451
  %453 = load i32, ptr %452, align 4, !tbaa !9
  %454 = call i32 @close(i32 noundef %453)
  br label %455

455:                                              ; preds = %449, %443
  br label %456

456:                                              ; preds = %455
  %457 = load i32, ptr %6, align 4, !tbaa !9
  %458 = add i32 %457, 1
  store i32 %458, ptr %6, align 4, !tbaa !9
  br label %437, !llvm.loop !54

459:                                              ; preds = %437
  store ptr null, ptr %2, align 8
  store i32 1, ptr %28, align 4
  br label %460

460:                                              ; preds = %459, %78, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 104, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 128, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4000, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #9
  %461 = load ptr, ptr %2, align 8
  ret ptr %461
}

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

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

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

declare void @PRINT_ERR(ptr noundef) #6

declare i32 @getaddrinfo(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #6

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

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

; Function Attrs: nounwind
declare void @freeaddrinfo(ptr noundef) #5

; Function Attrs: nounwind
declare i32 @socket(i32 noundef, i32 noundef, i32 noundef) #5

; Function Attrs: nounwind
declare i32 @setsockopt(i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) #5

declare void @PRINT_INFO_FREE(ptr noundef) #6

declare i32 @close(i32 noundef) #6

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

; Function Attrs: nounwind
declare i32 @bind(i32 noundef, ptr, i32 noundef) #5

; Function Attrs: nounwind
declare ptr @inet_ntoa(i32) #5

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

declare i32 @connect(i32 noundef, ptr, i32 noundef) #6

declare void @PRINT_DBG_FREE(ptr noundef) #6

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

declare void @enable_fq_rate_limit(ptr noundef, i32 noundef) #6

declare void @wait_light_on() #6

declare i32 @is_light_turned_on() #6

; Function Attrs: nounwind
declare i32 @getsockopt(i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #5

declare void @PRINT_INFO(ptr noundef) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind 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 #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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"ntttcp_stream_client", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !14, i64 64, !14, i64 65, !14, i64 66, !14, i64 67, !14, i64 68, !10, i64 72, !10, i64 76, !13, i64 80}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!16, !10, i64 4}
!16 = !{!"addrinfo", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!17 = !{!12, !10, i64 12}
!18 = !{!16, !10, i64 8}
!19 = !{!12, !10, i64 24}
!20 = !{!12, !6, i64 16}
!21 = !{!12, !10, i64 32}
!22 = !{!16, !10, i64 12}
!23 = !{!12, !10, i64 28}
!24 = !{!25, !26, i64 0}
!25 = !{!"sockaddr_in", !26, i64 0, !26, i64 2, !27, i64 4, !7, i64 8}
!26 = !{!"short", !7, i64 0}
!27 = !{!"in_addr", !10, i64 0}
!28 = !{!25, !26, i64 2}
!29 = !{!30, !26, i64 0}
!30 = !{!"sockaddr_in6", !26, i64 0, !26, i64 2, !10, i64 4, !31, i64 8, !10, i64 24}
!31 = !{!"in6_addr", !7, i64 0}
!32 = !{!30, !26, i64 2}
!33 = !{!7, !7, i64 0}
!34 = !{!16, !6, i64 24}
!35 = !{!16, !10, i64 16}
!36 = !{!12, !13, i64 56}
!37 = !{!16, !6, i64 40}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}
!40 = distinct !{!40, !39}
!41 = !{!12, !10, i64 76}
!42 = !{!12, !13, i64 40}
!43 = !{!13, !13, i64 0}
!44 = !{!12, !14, i64 64}
!45 = !{i8 0, i8 2}
!46 = !{}
!47 = distinct !{!47, !39}
!48 = !{!12, !13, i64 80}
!49 = distinct !{!49, !39}
!50 = !{!51, !10, i64 68}
!51 = !{!"tcp_info", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 6, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100}
!52 = distinct !{!52, !39}
!53 = !{!12, !10, i64 72}
!54 = distinct !{!54, !39}


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

@__const.run_ntttcp_sender_tcp_stream.timeout = external hidden unnamed_addr constant %struct.timeval, align 8
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [29 x i8], align 1

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

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

; 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 i32 @n_send(i32 noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noalias noundef ptr @run_ntttcp_sender_tcp_stream(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca ptr, align 8
  %3 = alloca [1000 x i32], align 16
  %4 = alloca %struct.sockaddr_storage, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %struct.addrinfo, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.timeval, align 8
  %10 = alloca %struct.tcp_info, align 4
  %11 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #10
  store ptr null, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %3) #10
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) %3, i8 0, i64 4000, i1 false)
  store i32 -1, ptr %3, align 16
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %4) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #10
  store i32 128, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #10
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #10
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) @__const.run_ntttcp_sender_tcp_stream.timeout, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %10) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #10
  store i32 104, ptr %11, align 4, !tbaa !9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %7, i8 0, i64 48, i1 false)
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = getelementptr inbounds i8, ptr %7, i64 4
  %14 = load <2 x i32>, ptr %12, align 8, !tbaa !9
  store <2 x i32> %14, ptr %13, align 4, !tbaa !9
  %15 = getelementptr inbounds i8, ptr %0, i64 24
  %16 = load i32, ptr %15, align 8, !tbaa !11
  %17 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %6, ptr noundef nonnull @.str.1, i32 noundef %16) #10
  %18 = icmp slt i32 %17, 0
  br i1 %18, label %19, label %20

19:                                               ; preds = %1
  call void @PRINT_ERR(ptr noundef nonnull @.str.2) #10
  br label %20

20:                                               ; preds = %19, %1
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  %22 = load ptr, ptr %21, align 8, !tbaa !15
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = call i32 @getaddrinfo(ptr noundef %22, ptr noundef %23, ptr noundef nonnull %7, ptr noundef nonnull %8) #10
  %.not = icmp eq i32 %24, 0
  br i1 %.not, label %26, label %25

25:                                               ; preds = %20
  call void @PRINT_ERR(ptr noundef nonnull @.str.3) #10
  br label %.loopexit

26:                                               ; preds = %20
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  call void @free(ptr noundef %27) #10
  %28 = load i32, ptr %12, align 8, !tbaa !16
  %29 = icmp eq i32 %28, 2
  %30 = select i1 %29, i64 16, i64 46
  %31 = call noalias ptr @malloc(i64 noundef %30) #11
  %32 = icmp eq ptr %31, null
  br i1 %32, label %41, label %.preheader144

.preheader144:                                    ; preds = %26
  %33 = getelementptr inbounds i8, ptr %0, i64 32
  %34 = load i32, ptr %33, align 8, !tbaa !17
  %.not180 = icmp eq i32 %34, 0
  br i1 %.not180, label %._crit_edge, label %.preheader142.lr.ph

.preheader142.lr.ph:                              ; preds = %.preheader144
  %35 = getelementptr inbounds i8, ptr %0, i64 28
  %36 = getelementptr inbounds i8, ptr %4, i64 2
  %37 = getelementptr inbounds i8, ptr %4, i64 4
  %38 = getelementptr inbounds i8, ptr %0, i64 56
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = icmp eq ptr %39, null
  br i1 %40, label %._crit_edge, label %.preheader142

41:                                               ; preds = %26
  call void @PRINT_ERR(ptr noundef nonnull @.str.4) #10
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  call void @freeaddrinfo(ptr noundef %42) #10
  br label %.loopexit

.preheader142thread-pre-split:                    ; preds = %.loopexit143
  %.0119153.pr = load ptr, ptr %8, align 8, !tbaa !5
  br label %.preheader142

.preheader142:                                    ; preds = %.preheader142.lr.ph, %.preheader142thread-pre-split
  %.0119153 = phi ptr [ %.0119153.pr, %.preheader142thread-pre-split ], [ %39, %.preheader142.lr.ph ]
  %.0112159 = phi i32 [ %154, %.preheader142thread-pre-split ], [ 0, %.preheader142.lr.ph ]
  %.0113158 = phi i32 [ %.1114, %.preheader142thread-pre-split ], [ 0, %.preheader142.lr.ph ]
  %.0115157 = phi ptr [ %.3118, %.preheader142thread-pre-split ], [ %31, %.preheader142.lr.ph ]
  %.not137154 = icmp eq ptr %.0119153, null
  br i1 %.not137154, label %.loopexit143, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader142
  %43 = zext i32 %.0112159 to i64
  %44 = getelementptr inbounds [1000 x i32], ptr %3, i64 0, i64 %43
  br label %45

45:                                               ; preds = %.lr.ph, %152
  %.0119156 = phi ptr [ %.0119153, %.lr.ph ], [ %.0119, %152 ]
  %.1116155 = phi ptr [ %.0115157, %.lr.ph ], [ %.2117, %152 ]
  %46 = getelementptr inbounds i8, ptr %.0119156, i64 4
  %47 = load i32, ptr %46, align 4, !tbaa !18
  %48 = getelementptr inbounds i8, ptr %.0119156, i64 8
  %49 = load i32, ptr %48, align 8, !tbaa !20
  %50 = getelementptr inbounds i8, ptr %.0119156, i64 12
  %51 = load i32, ptr %50, align 4, !tbaa !21
  %52 = call i32 @socket(i32 noundef %47, i32 noundef %49, i32 noundef %51) #10
  %53 = icmp slt i32 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %45
  call void @PRINT_ERR(ptr noundef nonnull @.str.5) #10
  br label %152

55:                                               ; preds = %45
  %56 = call i32 @setsockopt(i32 noundef %52, i32 noundef 1, i32 noundef 21, ptr noundef nonnull %9, i32 noundef 16) #10
  %57 = icmp slt i32 %56, 0
  br i1 %57, label %58, label %65

58:                                               ; preds = %55
  %59 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.6, i32 noundef %52) #10
  %60 = icmp slt i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %58
  call void @PRINT_ERR(ptr noundef nonnull @.str.2) #10
  br label %62

62:                                               ; preds = %61, %58
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  call void @PRINT_INFO_FREE(ptr noundef %63) #10
  %64 = call i32 @close(i32 noundef %52) #10
  br label %152

65:                                               ; preds = %55
  %66 = call i32 @setsockopt(i32 noundef %52, i32 noundef 1, i32 noundef 20, ptr noundef nonnull %9, i32 noundef 16) #10
  %67 = icmp slt i32 %66, 0
  br i1 %67, label %68, label %75

68:                                               ; preds = %65
  %69 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.7, i32 noundef %52) #10
  %70 = icmp slt i32 %69, 0
  br i1 %70, label %71, label %72

71:                                               ; preds = %68
  call void @PRINT_ERR(ptr noundef nonnull @.str.2) #10
  br label %72

72:                                               ; preds = %71, %68
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  call void @PRINT_INFO_FREE(ptr noundef %73) #10
  %74 = call i32 @close(i32 noundef %52) #10
  br label %152

75:                                               ; preds = %65
  %76 = load i32, ptr %35, align 4, !tbaa !22
  %.not138 = icmp eq i32 %76, 0
  br i1 %.not138, label %101, label %77

77:                                               ; preds = %75
  %78 = add i32 %76, %.0112159
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(128) %4, i8 0, i64 128, i1 false)
  %79 = load i32, ptr %12, align 8, !tbaa !16
  %80 = icmp eq i32 %79, 2
  %81 = trunc i32 %78 to i16
  %. = select i1 %80, i16 2, i16 10
  store i16 %., ptr %4, align 8, !tbaa !23
  %82 = call zeroext i16 @__bswap_16(i16 noundef zeroext %81)
  store i16 %82, ptr %36, align 2, !tbaa !23
  %83 = load i32, ptr %5, align 4, !tbaa !9
  %84 = call i32 @bind(i32 noundef %52, ptr nonnull %4, i32 noundef %83) #10
  %85 = icmp slt i32 %84, 0
  br i1 %85, label %86, label %101

86:                                               ; preds = %77
  %87 = load i32, ptr %12, align 8, !tbaa !16
  %88 = icmp eq i32 %87, 2
  br i1 %88, label %89, label %92

89:                                               ; preds = %86
  %90 = load i32, ptr %37, align 4
  %91 = call ptr @inet_ntoa(i32 %90) #10
  br label %92

92:                                               ; preds = %86, %89
  %93 = phi ptr [ %91, %89 ], [ @.str.9, %86 ]
  %94 = tail call ptr @__errno_location() #12
  %95 = load i32, ptr %94, align 4, !tbaa !9
  %96 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.8, i32 noundef %52, ptr noundef %93, i32 noundef %78, i32 noundef %95) #10
  %97 = icmp slt i32 %96, 0
  br i1 %97, label %98, label %99

98:                                               ; preds = %92
  call void @PRINT_ERR(ptr noundef nonnull @.str.2) #10
  br label %99

99:                                               ; preds = %98, %92
  %100 = load ptr, ptr %2, align 8, !tbaa !5
  call void @PRINT_INFO_FREE(ptr noundef %100) #10
  br label %101

101:                                              ; preds = %77, %99, %75
  %102 = getelementptr inbounds i8, ptr %.0119156, i64 24
  %103 = load ptr, ptr %102, align 8, !tbaa !25
  %104 = call ptr @retrive_ip_address_str(ptr noundef %103, ptr noundef %.1116155, i64 noundef %30) #10
  %105 = load ptr, ptr %102, align 8, !tbaa !25
  %106 = getelementptr inbounds i8, ptr %.0119156, i64 16
  %107 = load i32, ptr %106, align 8, !tbaa !26
  %108 = call i32 @connect(i32 noundef %52, ptr %105, i32 noundef %107) #10
  %109 = icmp slt i32 %108, 0
  br i1 %109, label %110, label %130

110:                                              ; preds = %101
  %111 = tail call ptr @__errno_location() #12
  %112 = load i32, ptr %111, align 4, !tbaa !9
  %113 = icmp eq i32 %112, 115
  %114 = load i32, ptr %15, align 8, !tbaa !11
  br i1 %113, label %115, label %123

115:                                              ; preds = %110
  %116 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.10, ptr noundef %104, i32 noundef %114, i32 noundef %52, i32 noundef %108, i32 noundef 115) #10
  %117 = icmp slt i32 %116, 0
  br i1 %117, label %118, label %119

118:                                              ; preds = %115
  call void @PRINT_ERR(ptr noundef nonnull @.str.2) #10
  br label %119

119:                                              ; preds = %118, %115
  %120 = load ptr, ptr %2, align 8, !tbaa !5
  call void @PRINT_DBG_FREE(ptr noundef %120) #10
  %121 = call i32 @close(i32 noundef %52) #10
  %122 = add i32 %.0112159, -1
  br label %.loopexit143

123:                                              ; preds = %110
  %124 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.11, ptr noundef %104, i32 noundef %114, i32 noundef %52, i32 noundef %108, i32 noundef %112) #10
  %125 = icmp slt i32 %124, 0
  br i1 %125, label %126, label %127

126:                                              ; preds = %123
  call void @PRINT_ERR(ptr noundef nonnull @.str.2) #10
  br label %127

127:                                              ; preds = %126, %123
  %128 = load ptr, ptr %2, align 8, !tbaa !5
  call void @PRINT_INFO_FREE(ptr noundef %128) #10
  %129 = call i32 @close(i32 noundef %52) #10
  br label %152

130:                                              ; preds = %101
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(128) %4, i8 0, i64 128, i1 false)
  %131 = call i32 @getsockname(i32 noundef %52, ptr nonnull %4, ptr noundef nonnull %5) #10
  %.not139 = icmp eq i32 %131, 0
  br i1 %.not139, label %138, label %132

132:                                              ; preds = %130
  %133 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.12, i32 noundef %52) #10
  %134 = icmp slt i32 %133, 0
  br i1 %134, label %135, label %136

135:                                              ; preds = %132
  call void @PRINT_ERR(ptr noundef nonnull @.str.2) #10
  br label %136

136:                                              ; preds = %135, %132
  %137 = load ptr, ptr %2, align 8, !tbaa !5
  call void @PRINT_INFO_FREE(ptr noundef %137) #10
  br label %138

138:                                              ; preds = %136, %130
  %139 = load i64, ptr %38, align 8, !tbaa !27
  %.not140 = icmp eq i64 %139, 0
  br i1 %.not140, label %141, label %140

140:                                              ; preds = %138
  call void @enable_fq_rate_limit(ptr noundef nonnull %0, i32 noundef %52) #10
  br label %141

141:                                              ; preds = %140, %138
  %142 = load i16, ptr %36, align 2
  %143 = call zeroext i16 @__bswap_16(i16 noundef zeroext %142)
  %144 = zext i16 %143 to i32
  %145 = load i32, ptr %15, align 8, !tbaa !11
  %146 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.13, i32 noundef %144, i32 noundef %52, ptr noundef %104, i32 noundef %145) #10
  %147 = icmp slt i32 %146, 0
  br i1 %147, label %148, label %149

148:                                              ; preds = %141
  call void @PRINT_ERR(ptr noundef nonnull @.str.2) #10
  br label %149

149:                                              ; preds = %148, %141
  %150 = load ptr, ptr %2, align 8, !tbaa !5
  call void @PRINT_DBG_FREE(ptr noundef %150) #10
  store i32 %52, ptr %44, align 4, !tbaa !9
  %151 = add i32 %.0113158, 1
  br label %.loopexit143

152:                                              ; preds = %127, %72, %62, %54
  %.2117 = phi ptr [ %.1116155, %54 ], [ %.1116155, %62 ], [ %.1116155, %72 ], [ %104, %127 ]
  store i32 -1, ptr %44, align 4, !tbaa !9
  %153 = getelementptr inbounds i8, ptr %.0119156, i64 40
  %.0119 = load ptr, ptr %153, align 8, !tbaa !5
  %.not137 = icmp eq ptr %.0119, null
  br i1 %.not137, label %.loopexit143, label %45, !llvm.loop !28

.loopexit143:                                     ; preds = %152, %.preheader142, %119, %149
  %.3118 = phi ptr [ %104, %119 ], [ %104, %149 ], [ %.0115157, %.preheader142 ], [ %.2117, %152 ]
  %.1114 = phi i32 [ %.0113158, %119 ], [ %151, %149 ], [ %.0113158, %.preheader142 ], [ %.0113158, %152 ]
  %.1 = phi i32 [ %122, %119 ], [ %.0112159, %149 ], [ %.0112159, %.preheader142 ], [ %.0112159, %152 ]
  %154 = add i32 %.1, 1
  %155 = load i32, ptr %33, align 8, !tbaa !17
  %156 = icmp ult i32 %154, %155
  br i1 %156, label %.preheader142thread-pre-split, label %._crit_edge, !llvm.loop !30

._crit_edge:                                      ; preds = %.loopexit143, %.preheader142.lr.ph, %.preheader144
  %.0115.lcssa = phi ptr [ %31, %.preheader144 ], [ %31, %.preheader142.lr.ph ], [ %.3118, %.loopexit143 ]
  %.0113.lcssa = phi i32 [ 0, %.preheader144 ], [ 0, %.preheader142.lr.ph ], [ %.1114, %.loopexit143 ]
  call void @free(ptr noundef %.0115.lcssa) #10
  %157 = load ptr, ptr %8, align 8, !tbaa !5
  call void @freeaddrinfo(ptr noundef %157) #10
  %158 = icmp eq i32 %.0113.lcssa, 0
  br i1 %158, label %209, label %159

159:                                              ; preds = %._crit_edge
  %160 = getelementptr inbounds i8, ptr %0, i64 76
  store i32 %.0113.lcssa, ptr %160, align 4, !tbaa !32
  call void @wait_light_on() #10
  %161 = getelementptr inbounds i8, ptr %0, i64 40
  %162 = load i64, ptr %161, align 8, !tbaa !33
  %163 = call noalias ptr @malloc(i64 noundef %162) #11
  %164 = icmp eq ptr %163, null
  br i1 %164, label %165, label %166

165:                                              ; preds = %159
  call void @PRINT_ERR(ptr noundef nonnull @.str.14) #10
  br label %209

166:                                              ; preds = %159
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %163, i8 65, i64 %162, i1 false)
  %167 = call i32 @is_light_turned_on() #10
  %.not134165 = icmp eq i32 %167, 0
  br i1 %.not134165, label %._crit_edge168, label %.lr.ph167

.lr.ph167:                                        ; preds = %166
  %168 = getelementptr inbounds i8, ptr %0, i64 64
  %169 = getelementptr inbounds i8, ptr %0, i64 80
  br label %170

170:                                              ; preds = %.lr.ph167, %.backedge
  %171 = load i8, ptr %168, align 8, !tbaa !34, !range !35, !noundef !36
  %172 = trunc nuw i8 %171 to i1
  br i1 %172, label %.backedge, label %.preheader

.backedge:                                        ; preds = %185, %.preheader, %170
  %173 = call i32 @is_light_turned_on() #10
  %.not134 = icmp eq i32 %173, 0
  br i1 %.not134, label %._crit_edge168, label %170, !llvm.loop !37

.preheader:                                       ; preds = %170
  %174 = load i32, ptr %33, align 8, !tbaa !17
  %.not181 = icmp eq i32 %174, 0
  br i1 %.not181, label %.backedge, label %.lr.ph164, !llvm.loop !37

.lr.ph164:                                        ; preds = %.preheader, %185
  %indvars.iv = phi i64 [ %indvars.iv.next, %185 ], [ 0, %.preheader ]
  %175 = getelementptr inbounds [1000 x i32], ptr %3, i64 0, i64 %indvars.iv
  %176 = load i32, ptr %175, align 4, !tbaa !9
  %177 = icmp slt i32 %176, 0
  br i1 %177, label %185, label %178

178:                                              ; preds = %.lr.ph164
  %179 = call i32 @n_send(i32 noundef %176, ptr noundef nonnull %163, i64 noundef %162)
  %180 = icmp slt i32 %179, 0
  br i1 %180, label %185, label %181

181:                                              ; preds = %178
  %182 = zext nneg i32 %179 to i64
  %183 = load i64, ptr %169, align 8, !tbaa !38
  %184 = add i64 %183, %182
  store i64 %184, ptr %169, align 8, !tbaa !38
  br label %185

185:                                              ; preds = %178, %.lr.ph164, %181
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %186 = load i32, ptr %33, align 8, !tbaa !17
  %187 = zext i32 %186 to i64
  %188 = icmp ult i64 %indvars.iv.next, %187
  br i1 %188, label %.lr.ph164, label %.backedge, !llvm.loop !39

._crit_edge168:                                   ; preds = %.backedge, %166
  call void @free(ptr noundef %163) #10
  %189 = load i32, ptr %33, align 8, !tbaa !17
  %.not182 = icmp eq i32 %189, 0
  br i1 %.not182, label %.loopexit, label %.lr.ph173

.lr.ph173:                                        ; preds = %._crit_edge168
  %190 = getelementptr inbounds i8, ptr %10, i64 68
  br label %191

191:                                              ; preds = %.lr.ph173, %202
  %indvars.iv192 = phi i64 [ 0, %.lr.ph173 ], [ %indvars.iv.next193, %202 ]
  %.0120170 = phi i32 [ 0, %.lr.ph173 ], [ %.1121, %202 ]
  %.0122169 = phi i32 [ 0, %.lr.ph173 ], [ %.1123, %202 ]
  %192 = getelementptr inbounds [1000 x i32], ptr %3, i64 0, i64 %indvars.iv192
  %193 = load i32, ptr %192, align 4, !tbaa !9
  %194 = icmp sgt i32 %193, -1
  br i1 %194, label %195, label %202

195:                                              ; preds = %191
  %196 = call i32 @getsockopt(i32 noundef %193, i32 noundef 6, i32 noundef 11, ptr noundef nonnull %10, ptr noundef nonnull %11) #10
  %.not136 = icmp eq i32 %196, 0
  br i1 %.not136, label %198, label %197

197:                                              ; preds = %195
  call void @PRINT_INFO(ptr noundef nonnull @.str.15) #10
  br label %202

198:                                              ; preds = %195
  %199 = load i32, ptr %190, align 4, !tbaa !40
  %200 = add i32 %199, %.0120170
  %201 = add i32 %.0122169, 1
  br label %202

202:                                              ; preds = %191, %198, %197
  %.1123 = phi i32 [ %.0122169, %197 ], [ %201, %198 ], [ %.0122169, %191 ]
  %.1121 = phi i32 [ %.0120170, %197 ], [ %200, %198 ], [ %.0120170, %191 ]
  %indvars.iv.next193 = add nuw nsw i64 %indvars.iv192, 1
  %203 = load i32, ptr %33, align 8, !tbaa !17
  %204 = zext i32 %203 to i64
  %205 = icmp ult i64 %indvars.iv.next193, %204
  br i1 %205, label %191, label %._crit_edge174, !llvm.loop !42

._crit_edge174:                                   ; preds = %202
  %.not135 = icmp eq i32 %.1123, 0
  br i1 %.not135, label %209, label %206

206:                                              ; preds = %._crit_edge174
  %207 = udiv i32 %.1121, %.1123
  %208 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 %207, ptr %208, align 8, !tbaa !43
  br label %209

209:                                              ; preds = %._crit_edge174, %206, %._crit_edge, %165
  %.pr = load i32, ptr %33, align 8, !tbaa !17
  %.not183 = icmp eq i32 %.pr, 0
  br i1 %.not183, label %.loopexit, label %.lr.ph179

.lr.ph179:                                        ; preds = %209, %216
  %210 = phi i32 [ %217, %216 ], [ %.pr, %209 ]
  %indvars.iv195 = phi i64 [ %indvars.iv.next196, %216 ], [ 0, %209 ]
  %211 = getelementptr inbounds [1000 x i32], ptr %3, i64 0, i64 %indvars.iv195
  %212 = load i32, ptr %211, align 4, !tbaa !9
  %213 = icmp sgt i32 %212, -1
  br i1 %213, label %214, label %216

214:                                              ; preds = %.lr.ph179
  %215 = call i32 @close(i32 noundef %212) #10
  %.pre = load i32, ptr %33, align 8, !tbaa !17
  br label %216

216:                                              ; preds = %.lr.ph179, %214
  %217 = phi i32 [ %210, %.lr.ph179 ], [ %.pre, %214 ]
  %indvars.iv.next196 = add nuw nsw i64 %indvars.iv195, 1
  %218 = zext i32 %217 to i64
  %219 = icmp ult i64 %indvars.iv.next196, %218
  br i1 %219, label %.lr.ph179, label %.loopexit, !llvm.loop !44

.loopexit:                                        ; preds = %216, %._crit_edge168, %209, %41, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #10
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %10) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #10
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %4) #10
  call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #10
  ret ptr null
}

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

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

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

declare void @PRINT_ERR(ptr noundef) local_unnamed_addr #6

declare i32 @getaddrinfo(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #8

; Function Attrs: nounwind
declare void @freeaddrinfo(ptr noundef) local_unnamed_addr #5

; Function Attrs: nounwind
declare i32 @socket(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: nounwind
declare i32 @setsockopt(i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

declare void @PRINT_INFO_FREE(ptr noundef) local_unnamed_addr #6

declare i32 @close(i32 noundef) local_unnamed_addr #6

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

; Function Attrs: nounwind
declare i32 @bind(i32 noundef, ptr, i32 noundef) local_unnamed_addr #5

; Function Attrs: nounwind
declare ptr @inet_ntoa(i32) local_unnamed_addr #5

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

declare i32 @connect(i32 noundef, ptr, i32 noundef) local_unnamed_addr #6

declare void @PRINT_DBG_FREE(ptr noundef) local_unnamed_addr #6

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

declare void @enable_fq_rate_limit(ptr noundef, i32 noundef) local_unnamed_addr #6

declare void @wait_light_on() local_unnamed_addr #6

declare i32 @is_light_turned_on() local_unnamed_addr #6

; Function Attrs: nounwind
declare i32 @getsockopt(i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

declare void @PRINT_INFO(ptr noundef) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { "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 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 #8 = { 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 #9 = { 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 #10 = { nounwind }
attributes #11 = { nounwind allocsize(0) }
attributes #12 = { 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, !10, i64 24}
!12 = !{!"ntttcp_stream_client", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !14, i64 64, !14, i64 65, !14, i64 66, !14, i64 67, !14, i64 68, !10, i64 72, !10, i64 76, !13, i64 80}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!12, !6, i64 16}
!16 = !{!12, !10, i64 8}
!17 = !{!12, !10, i64 32}
!18 = !{!19, !10, i64 4}
!19 = !{!"addrinfo", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!20 = !{!19, !10, i64 8}
!21 = !{!19, !10, i64 12}
!22 = !{!12, !10, i64 28}
!23 = !{!24, !24, i64 0}
!24 = !{!"short", !7, i64 0}
!25 = !{!19, !6, i64 24}
!26 = !{!19, !10, i64 16}
!27 = !{!12, !13, i64 56}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29, !31}
!31 = !{!"llvm.loop.unswitch.partial.disable"}
!32 = !{!12, !10, i64 76}
!33 = !{!12, !13, i64 40}
!34 = !{!12, !14, i64 64}
!35 = !{i8 0, i8 2}
!36 = !{}
!37 = distinct !{!37, !29}
!38 = !{!12, !13, i64 80}
!39 = distinct !{!39, !29}
!40 = !{!41, !10, i64 68}
!41 = !{!"tcp_info", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 6, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100}
!42 = distinct !{!42, !29}
!43 = !{!12, !10, i64 72}
!44 = distinct !{!44, !29}


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