; LLVM IR from rigtorp/ipc-bench :: src (tcp_lat)

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

@.str = external hidden unnamed_addr constant [49 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@stderr = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca %struct.timespec, align 8
  %12 = alloca %struct.timespec, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.sockaddr_storage, align 8
  %18 = alloca i32, align 4
  %19 = alloca %struct.addrinfo, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 1, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 128, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = icmp ne i32 %24, 3
  br i1 %25, label %26, label %28

26:                                               ; preds = %2
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

28:                                               ; preds = %2
  %29 = load ptr, ptr %5, align 8, !tbaa !9
  %30 = getelementptr inbounds ptr, ptr %29, i64 1
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = call i32 @atoi(ptr noundef %31) #8
  store i32 %32, ptr %6, align 4, !tbaa !5
  %33 = load ptr, ptr %5, align 8, !tbaa !9
  %34 = getelementptr inbounds ptr, ptr %33, i64 2
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  %36 = call i64 @atol(ptr noundef %35) #8
  store i64 %36, ptr %8, align 8, !tbaa !11
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = call noalias ptr @malloc(i64 noundef %38) #9
  store ptr %39, ptr %7, align 8, !tbaa !9
  %40 = load ptr, ptr %7, align 8, !tbaa !9
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %43

42:                                               ; preds = %28
  call void @perror(ptr noundef @.str.1)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

43:                                               ; preds = %28
  call void @llvm.memset.p0.i64(ptr align 8 %19, i8 0, i64 48, i1 false)
  %44 = getelementptr inbounds %struct.addrinfo, ptr %19, i32 0, i32 1
  store i32 0, ptr %44, align 4, !tbaa !13
  %45 = getelementptr inbounds %struct.addrinfo, ptr %19, i32 0, i32 2
  store i32 1, ptr %45, align 8, !tbaa !15
  %46 = getelementptr inbounds %struct.addrinfo, ptr %19, i32 0, i32 0
  store i32 1, ptr %46, align 8, !tbaa !16
  %47 = call i32 @getaddrinfo(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %19, ptr noundef %20)
  store i32 %47, ptr %16, align 4, !tbaa !5
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %54

49:                                               ; preds = %43
  %50 = load ptr, ptr @stderr, align 8, !tbaa !9
  %51 = load i32, ptr %16, align 4, !tbaa !5
  %52 = call ptr @gai_strerror(i32 noundef %51) #7
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef @.str.4, ptr noundef %52) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

54:                                               ; preds = %43
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %55)
  %57 = load i64, ptr %8, align 8, !tbaa !11
  %58 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i64 noundef %57)
  %59 = call i32 @fork() #7
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %141, label %61

61:                                               ; preds = %54
  %62 = load ptr, ptr %20, align 8, !tbaa !9
  %63 = getelementptr inbounds %struct.addrinfo, ptr %62, i32 0, i32 1
  %64 = load i32, ptr %63, align 4, !tbaa !13
  %65 = load ptr, ptr %20, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct.addrinfo, ptr %65, i32 0, i32 2
  %67 = load i32, ptr %66, align 8, !tbaa !15
  %68 = load ptr, ptr %20, align 8, !tbaa !9
  %69 = getelementptr inbounds %struct.addrinfo, ptr %68, i32 0, i32 3
  %70 = load i32, ptr %69, align 4, !tbaa !17
  %71 = call i32 @socket(i32 noundef %64, i32 noundef %67, i32 noundef %70) #7
  store i32 %71, ptr %21, align 4, !tbaa !5
  %72 = icmp eq i32 %71, -1
  br i1 %72, label %73, label %74

73:                                               ; preds = %61
  call void @perror(ptr noundef @.str.7)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

74:                                               ; preds = %61
  %75 = load i32, ptr %21, align 4, !tbaa !5
  %76 = call i32 @setsockopt(i32 noundef %75, i32 noundef 1, i32 noundef 2, ptr noundef %15, i32 noundef 4) #7
  %77 = icmp eq i32 %76, -1
  br i1 %77, label %78, label %79

78:                                               ; preds = %74
  call void @perror(ptr noundef @.str.8)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

79:                                               ; preds = %74
  %80 = load i32, ptr %21, align 4, !tbaa !5
  %81 = load ptr, ptr %20, align 8, !tbaa !9
  %82 = getelementptr inbounds %struct.addrinfo, ptr %81, i32 0, i32 5
  %83 = load ptr, ptr %82, align 8, !tbaa !18
  %84 = load ptr, ptr %20, align 8, !tbaa !9
  %85 = getelementptr inbounds %struct.addrinfo, ptr %84, i32 0, i32 4
  %86 = load i32, ptr %85, align 8, !tbaa !19
  %87 = call i32 @bind(i32 noundef %80, ptr noundef %83, i32 noundef %86) #7
  %88 = icmp eq i32 %87, -1
  br i1 %88, label %89, label %90

89:                                               ; preds = %79
  call void @perror(ptr noundef @.str.9)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

90:                                               ; preds = %79
  %91 = load i32, ptr %21, align 4, !tbaa !5
  %92 = call i32 @listen(i32 noundef %91, i32 noundef 1) #7
  %93 = icmp eq i32 %92, -1
  br i1 %93, label %94, label %95

94:                                               ; preds = %90
  call void @perror(ptr noundef @.str.10)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

95:                                               ; preds = %90
  store i32 128, ptr %18, align 4, !tbaa !5
  %96 = load i32, ptr %21, align 4, !tbaa !5
  %97 = call i32 @accept(i32 noundef %96, ptr noundef %17, ptr noundef %18)
  store i32 %97, ptr %22, align 4, !tbaa !5
  %98 = icmp eq i32 %97, -1
  br i1 %98, label %99, label %100

99:                                               ; preds = %95
  call void @perror(ptr noundef @.str.11)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

100:                                              ; preds = %95
  store i64 0, ptr %9, align 8, !tbaa !11
  br label %101

101:                                              ; preds = %137, %100
  %102 = load i64, ptr %9, align 8, !tbaa !11
  %103 = load i64, ptr %8, align 8, !tbaa !11
  %104 = icmp slt i64 %102, %103
  br i1 %104, label %105, label %140

105:                                              ; preds = %101
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %106

106:                                              ; preds = %122, %105
  %107 = load i64, ptr %14, align 8, !tbaa !11
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = icmp ult i64 %107, %109
  br i1 %110, label %111, label %126

111:                                              ; preds = %106
  %112 = load i32, ptr %22, align 4, !tbaa !5
  %113 = load ptr, ptr %7, align 8, !tbaa !9
  %114 = load i32, ptr %6, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = load i64, ptr %14, align 8, !tbaa !11
  %117 = sub i64 %115, %116
  %118 = call i64 @read(i32 noundef %112, ptr noundef %113, i64 noundef %117)
  store i64 %118, ptr %13, align 8, !tbaa !11
  %119 = load i64, ptr %13, align 8, !tbaa !11
  %120 = icmp eq i64 %119, -1
  br i1 %120, label %121, label %122

121:                                              ; preds = %111
  call void @perror(ptr noundef @.str.12)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

122:                                              ; preds = %111
  %123 = load i64, ptr %13, align 8, !tbaa !11
  %124 = load i64, ptr %14, align 8, !tbaa !11
  %125 = add i64 %124, %123
  store i64 %125, ptr %14, align 8, !tbaa !11
  br label %106, !llvm.loop !20

126:                                              ; preds = %106
  %127 = load i32, ptr %22, align 4, !tbaa !5
  %128 = load ptr, ptr %7, align 8, !tbaa !9
  %129 = load i32, ptr %6, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = call i64 @write(i32 noundef %127, ptr noundef %128, i64 noundef %130)
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = icmp ne i64 %131, %133
  br i1 %134, label %135, label %136

135:                                              ; preds = %126
  call void @perror(ptr noundef @.str.13)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

136:                                              ; preds = %126
  br label %137

137:                                              ; preds = %136
  %138 = load i64, ptr %9, align 8, !tbaa !11
  %139 = add nsw i64 %138, 1
  store i64 %139, ptr %9, align 8, !tbaa !11
  br label %101, !llvm.loop !22

140:                                              ; preds = %101
  br label %232

141:                                              ; preds = %54
  %142 = call i32 @sleep(i32 noundef 1)
  %143 = load ptr, ptr %20, align 8, !tbaa !9
  %144 = getelementptr inbounds %struct.addrinfo, ptr %143, i32 0, i32 1
  %145 = load i32, ptr %144, align 4, !tbaa !13
  %146 = load ptr, ptr %20, align 8, !tbaa !9
  %147 = getelementptr inbounds %struct.addrinfo, ptr %146, i32 0, i32 2
  %148 = load i32, ptr %147, align 8, !tbaa !15
  %149 = load ptr, ptr %20, align 8, !tbaa !9
  %150 = getelementptr inbounds %struct.addrinfo, ptr %149, i32 0, i32 3
  %151 = load i32, ptr %150, align 4, !tbaa !17
  %152 = call i32 @socket(i32 noundef %145, i32 noundef %148, i32 noundef %151) #7
  store i32 %152, ptr %21, align 4, !tbaa !5
  %153 = icmp eq i32 %152, -1
  br i1 %153, label %154, label %155

154:                                              ; preds = %141
  call void @perror(ptr noundef @.str.7)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

155:                                              ; preds = %141
  %156 = load i32, ptr %21, align 4, !tbaa !5
  %157 = load ptr, ptr %20, align 8, !tbaa !9
  %158 = getelementptr inbounds %struct.addrinfo, ptr %157, i32 0, i32 5
  %159 = load ptr, ptr %158, align 8, !tbaa !18
  %160 = load ptr, ptr %20, align 8, !tbaa !9
  %161 = getelementptr inbounds %struct.addrinfo, ptr %160, i32 0, i32 4
  %162 = load i32, ptr %161, align 8, !tbaa !19
  %163 = call i32 @connect(i32 noundef %156, ptr noundef %159, i32 noundef %162)
  %164 = icmp eq i32 %163, -1
  br i1 %164, label %165, label %166

165:                                              ; preds = %155
  call void @perror(ptr noundef @.str.14)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

166:                                              ; preds = %155
  %167 = call i32 @clock_gettime(i32 noundef 1, ptr noundef %11) #7
  %168 = icmp eq i32 %167, -1
  br i1 %168, label %169, label %170

169:                                              ; preds = %166
  call void @perror(ptr noundef @.str.15)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

170:                                              ; preds = %166
  store i64 0, ptr %9, align 8, !tbaa !11
  br label %171

171:                                              ; preds = %207, %170
  %172 = load i64, ptr %9, align 8, !tbaa !11
  %173 = load i64, ptr %8, align 8, !tbaa !11
  %174 = icmp slt i64 %172, %173
  br i1 %174, label %175, label %210

175:                                              ; preds = %171
  %176 = load i32, ptr %21, align 4, !tbaa !5
  %177 = load ptr, ptr %7, align 8, !tbaa !9
  %178 = load i32, ptr %6, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = call i64 @write(i32 noundef %176, ptr noundef %177, i64 noundef %179)
  %181 = load i32, ptr %6, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = icmp ne i64 %180, %182
  br i1 %183, label %184, label %185

184:                                              ; preds = %175
  call void @perror(ptr noundef @.str.13)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

185:                                              ; preds = %175
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %186

186:                                              ; preds = %202, %185
  %187 = load i64, ptr %14, align 8, !tbaa !11
  %188 = load i32, ptr %6, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = icmp ult i64 %187, %189
  br i1 %190, label %191, label %206

191:                                              ; preds = %186
  %192 = load i32, ptr %21, align 4, !tbaa !5
  %193 = load ptr, ptr %7, align 8, !tbaa !9
  %194 = load i32, ptr %6, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = load i64, ptr %14, align 8, !tbaa !11
  %197 = sub i64 %195, %196
  %198 = call i64 @read(i32 noundef %192, ptr noundef %193, i64 noundef %197)
  store i64 %198, ptr %13, align 8, !tbaa !11
  %199 = load i64, ptr %13, align 8, !tbaa !11
  %200 = icmp eq i64 %199, -1
  br i1 %200, label %201, label %202

201:                                              ; preds = %191
  call void @perror(ptr noundef @.str.12)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

202:                                              ; preds = %191
  %203 = load i64, ptr %13, align 8, !tbaa !11
  %204 = load i64, ptr %14, align 8, !tbaa !11
  %205 = add i64 %204, %203
  store i64 %205, ptr %14, align 8, !tbaa !11
  br label %186, !llvm.loop !23

206:                                              ; preds = %186
  br label %207

207:                                              ; preds = %206
  %208 = load i64, ptr %9, align 8, !tbaa !11
  %209 = add nsw i64 %208, 1
  store i64 %209, ptr %9, align 8, !tbaa !11
  br label %171, !llvm.loop !24

210:                                              ; preds = %171
  %211 = call i32 @clock_gettime(i32 noundef 1, ptr noundef %12) #7
  %212 = icmp eq i32 %211, -1
  br i1 %212, label %213, label %214

213:                                              ; preds = %210
  call void @perror(ptr noundef @.str.15)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

214:                                              ; preds = %210
  %215 = getelementptr inbounds %struct.timespec, ptr %12, i32 0, i32 0
  %216 = load i64, ptr %215, align 8, !tbaa !25
  %217 = getelementptr inbounds %struct.timespec, ptr %11, i32 0, i32 0
  %218 = load i64, ptr %217, align 8, !tbaa !25
  %219 = sub nsw i64 %216, %218
  %220 = mul nsw i64 %219, 1000000000
  %221 = getelementptr inbounds %struct.timespec, ptr %12, i32 0, i32 1
  %222 = load i64, ptr %221, align 8, !tbaa !27
  %223 = getelementptr inbounds %struct.timespec, ptr %11, i32 0, i32 1
  %224 = load i64, ptr %223, align 8, !tbaa !27
  %225 = sub nsw i64 %222, %224
  %226 = add nsw i64 %220, %225
  store i64 %226, ptr %10, align 8, !tbaa !11
  %227 = load i64, ptr %10, align 8, !tbaa !11
  %228 = load i64, ptr %8, align 8, !tbaa !11
  %229 = mul nsw i64 %228, 2
  %230 = sdiv i64 %227, %229
  %231 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, i64 noundef %230)
  br label %232

232:                                              ; preds = %214, %140
  store i32 0, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %233

233:                                              ; preds = %232, %213, %201, %184, %169, %165, %154, %135, %121, %99, %94, %89, %78, %73, %49, %42, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %234 = load i32, ptr %3, align 4
  ret i32 %234
}

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

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

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #3

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i64 @atol(ptr noundef nonnull) #3

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

declare void @perror(ptr noundef) #2

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

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

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

; Function Attrs: nounwind
declare ptr @gai_strerror(i32 noundef) #6

; Function Attrs: nounwind
declare i32 @fork() #6

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

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

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

; Function Attrs: nounwind
declare i32 @listen(i32 noundef, i32 noundef) #6

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

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

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

declare i32 @sleep(i32 noundef) #2

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

; Function Attrs: nounwind
declare i32 @clock_gettime(i32 noundef, ptr noundef) #6

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 4}
!14 = !{!"addrinfo", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!15 = !{!14, !6, i64 8}
!16 = !{!14, !6, i64 0}
!17 = !{!14, !6, i64 12}
!18 = !{!14, !10, i64 24}
!19 = !{!14, !6, i64 16}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !21}
!25 = !{!26, !12, i64 0}
!26 = !{!"timespec", !12, i64 0, !12, i64 8}
!27 = !{!26, !12, i64 8}


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

@.str = external hidden unnamed_addr constant [49 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca %struct.timespec, align 8
  %4 = alloca %struct.timespec, align 8
  %5 = alloca i32, align 4
  %6 = alloca %struct.sockaddr_storage, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.addrinfo, align 8
  %9 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  store i32 1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %8) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %.not = icmp eq i32 %0, 3
  br i1 %.not, label %12, label %10

10:                                               ; preds = %2
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %.loopexit

12:                                               ; preds = %2
  %13 = getelementptr inbounds i8, ptr %1, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = tail call i32 @atoi(ptr nocapture noundef %14) #10
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = tail call i64 @atol(ptr nocapture noundef %17) #10
  %19 = sext i32 %15 to i64
  %20 = tail call noalias ptr @malloc(i64 noundef %19) #11
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %12
  tail call void @perror(ptr noundef nonnull @.str.1) #12
  br label %.loopexit

23:                                               ; preds = %12
  %24 = getelementptr inbounds i8, ptr %8, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %8, i8 0, i64 48, i1 false)
  store i32 1, ptr %24, align 8, !tbaa !11
  store i32 1, ptr %8, align 8, !tbaa !13
  %25 = call i32 @getaddrinfo(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef nonnull %8, ptr noundef nonnull %9) #9
  %.not59 = icmp eq i32 %25, 0
  br i1 %.not59, label %30, label %26

26:                                               ; preds = %23
  %27 = load ptr, ptr @stderr, align 8, !tbaa !9
  %28 = call ptr @gai_strerror(i32 noundef %25) #9
  %29 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef nonnull @.str.4, ptr noundef %28) #13
  br label %.loopexit

30:                                               ; preds = %23
  %31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %15)
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i64 noundef %18)
  %33 = call i32 @fork() #9
  %.not60 = icmp eq i32 %33, 0
  br i1 %.not60, label %34, label %80

34:                                               ; preds = %30
  %35 = load ptr, ptr %9, align 8, !tbaa !9
  %36 = getelementptr inbounds i8, ptr %35, i64 4
  %37 = load i32, ptr %36, align 4, !tbaa !14
  %38 = getelementptr inbounds i8, ptr %35, i64 8
  %39 = load i32, ptr %38, align 8, !tbaa !11
  %40 = getelementptr inbounds i8, ptr %35, i64 12
  %41 = load i32, ptr %40, align 4, !tbaa !15
  %42 = call i32 @socket(i32 noundef %37, i32 noundef %39, i32 noundef %41) #9
  %43 = icmp eq i32 %42, -1
  br i1 %43, label %44, label %45

44:                                               ; preds = %34
  call void @perror(ptr noundef nonnull @.str.7) #12
  br label %.loopexit

45:                                               ; preds = %34
  %46 = call i32 @setsockopt(i32 noundef %42, i32 noundef 1, i32 noundef 2, ptr noundef nonnull %5, i32 noundef 4) #9
  %47 = icmp eq i32 %46, -1
  br i1 %47, label %48, label %49

48:                                               ; preds = %45
  call void @perror(ptr noundef nonnull @.str.8) #12
  br label %.loopexit

49:                                               ; preds = %45
  %50 = load ptr, ptr %9, align 8, !tbaa !9
  %51 = getelementptr inbounds i8, ptr %50, i64 24
  %52 = load ptr, ptr %51, align 8, !tbaa !16
  %53 = getelementptr inbounds i8, ptr %50, i64 16
  %54 = load i32, ptr %53, align 8, !tbaa !17
  %55 = call i32 @bind(i32 noundef %42, ptr noundef %52, i32 noundef %54) #9
  %56 = icmp eq i32 %55, -1
  br i1 %56, label %57, label %58

57:                                               ; preds = %49
  call void @perror(ptr noundef nonnull @.str.9) #12
  br label %.loopexit

58:                                               ; preds = %49
  %59 = call i32 @listen(i32 noundef %42, i32 noundef 1) #9
  %60 = icmp eq i32 %59, -1
  br i1 %60, label %61, label %62

61:                                               ; preds = %58
  call void @perror(ptr noundef nonnull @.str.10) #12
  br label %.loopexit

62:                                               ; preds = %58
  store i32 128, ptr %7, align 4, !tbaa !5
  %63 = call i32 @accept(i32 noundef %42, ptr noundef nonnull %6, ptr noundef nonnull %7) #9
  %64 = icmp eq i32 %63, -1
  br i1 %64, label %76, label %.preheader63

.preheader63:                                     ; preds = %62
  %65 = icmp sgt i64 %18, 0
  br i1 %65, label %.preheader.lr.ph, label %.loopexit

.preheader.lr.ph:                                 ; preds = %.preheader63
  %.not80 = icmp eq i32 %15, 0
  br i1 %.not80, label %.preheader, label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.lr.ph, %73
  %.04773.us = phi i64 [ %74, %73 ], [ 0, %.preheader.lr.ph ]
  br label %69

66:                                               ; preds = %69
  %67 = add i64 %71, %.04872.us
  %68 = icmp ult i64 %67, %19
  br i1 %68, label %69, label %._crit_edge.us74, !llvm.loop !18

69:                                               ; preds = %.preheader.us, %66
  %.04872.us = phi i64 [ 0, %.preheader.us ], [ %67, %66 ]
  %70 = sub i64 %19, %.04872.us
  %71 = call i64 @read(i32 noundef %63, ptr noundef nonnull %20, i64 noundef %70) #9
  %72 = icmp eq i64 %71, -1
  br i1 %72, label %.split78.us, label %66

73:                                               ; preds = %._crit_edge.us74
  %74 = add nuw nsw i64 %.04773.us, 1
  %exitcond86.not = icmp eq i64 %74, %18
  br i1 %exitcond86.not, label %.loopexit, label %.preheader.us, !llvm.loop !20

._crit_edge.us74:                                 ; preds = %66
  %75 = call i64 @write(i32 noundef %63, ptr noundef nonnull %20, i64 noundef %19) #9
  %.not61.us = icmp eq i64 %75, %19
  br i1 %.not61.us, label %73, label %.split76.us

76:                                               ; preds = %62
  call void @perror(ptr noundef nonnull @.str.11) #12
  br label %.loopexit

77:                                               ; preds = %.preheader
  %78 = add nuw nsw i64 %.04773, 1
  %exitcond87.not = icmp eq i64 %78, %18
  br i1 %exitcond87.not, label %.loopexit, label %.preheader, !llvm.loop !20

.preheader:                                       ; preds = %.preheader.lr.ph, %77
  %.04773 = phi i64 [ %78, %77 ], [ 0, %.preheader.lr.ph ]
  %79 = call i64 @write(i32 noundef %63, ptr noundef nonnull %20, i64 noundef %19) #9
  %.not61 = icmp eq i64 %79, %19
  br i1 %.not61, label %77, label %.split76.us

.split78.us:                                      ; preds = %69
  call void @perror(ptr noundef nonnull @.str.12) #12
  br label %.loopexit

.split76.us:                                      ; preds = %._crit_edge.us74, %.preheader
  call void @perror(ptr noundef nonnull @.str.13) #12
  br label %.loopexit

80:                                               ; preds = %30
  %81 = call i32 @sleep(i32 noundef 1) #9
  %82 = load ptr, ptr %9, align 8, !tbaa !9
  %83 = getelementptr inbounds i8, ptr %82, i64 4
  %84 = load i32, ptr %83, align 4, !tbaa !14
  %85 = getelementptr inbounds i8, ptr %82, i64 8
  %86 = load i32, ptr %85, align 8, !tbaa !11
  %87 = getelementptr inbounds i8, ptr %82, i64 12
  %88 = load i32, ptr %87, align 4, !tbaa !15
  %89 = call i32 @socket(i32 noundef %84, i32 noundef %86, i32 noundef %88) #9
  %90 = icmp eq i32 %89, -1
  br i1 %90, label %91, label %92

91:                                               ; preds = %80
  call void @perror(ptr noundef nonnull @.str.7) #12
  br label %.loopexit

92:                                               ; preds = %80
  %93 = load ptr, ptr %9, align 8, !tbaa !9
  %94 = getelementptr inbounds i8, ptr %93, i64 24
  %95 = load ptr, ptr %94, align 8, !tbaa !16
  %96 = getelementptr inbounds i8, ptr %93, i64 16
  %97 = load i32, ptr %96, align 8, !tbaa !17
  %98 = call i32 @connect(i32 noundef %89, ptr noundef %95, i32 noundef %97) #9
  %99 = icmp eq i32 %98, -1
  br i1 %99, label %100, label %101

100:                                              ; preds = %92
  call void @perror(ptr noundef nonnull @.str.14) #12
  br label %.loopexit

101:                                              ; preds = %92
  %102 = call i32 @clock_gettime(i32 noundef 1, ptr noundef nonnull %3) #9
  %103 = icmp eq i32 %102, -1
  br i1 %103, label %113, label %.preheader65

.preheader65:                                     ; preds = %101
  %104 = icmp sgt i64 %18, 0
  br i1 %104, label %.lr.ph68, label %._crit_edge69

.lr.ph68:                                         ; preds = %.preheader65
  %.not79 = icmp eq i32 %15, 0
  br i1 %.not79, label %.lr.ph68.split, label %.lr.ph68.split.us

.lr.ph68.split.us:                                ; preds = %.lr.ph68, %._crit_edge.us
  %.167.us = phi i64 [ %112, %._crit_edge.us ], [ 0, %.lr.ph68 ]
  %105 = call i64 @write(i32 noundef %89, ptr noundef nonnull %20, i64 noundef %19) #9
  %.not62.us = icmp eq i64 %105, %19
  br i1 %.not62.us, label %.preheader64.us, label %.split.us

106:                                              ; preds = %.preheader64.us
  %107 = add i64 %110, %.14966.us
  %108 = icmp ult i64 %107, %19
  br i1 %108, label %.preheader64.us, label %._crit_edge.us, !llvm.loop !21

.preheader64.us:                                  ; preds = %.lr.ph68.split.us, %106
  %.14966.us = phi i64 [ %107, %106 ], [ 0, %.lr.ph68.split.us ]
  %109 = sub i64 %19, %.14966.us
  %110 = call i64 @read(i32 noundef %89, ptr noundef nonnull %20, i64 noundef %109) #9
  %111 = icmp eq i64 %110, -1
  br i1 %111, label %.split71.us, label %106

._crit_edge.us:                                   ; preds = %106
  %112 = add nuw nsw i64 %.167.us, 1
  %exitcond.not = icmp eq i64 %112, %18
  br i1 %exitcond.not, label %._crit_edge69, label %.lr.ph68.split.us, !llvm.loop !22

113:                                              ; preds = %101
  call void @perror(ptr noundef nonnull @.str.15) #12
  br label %.loopexit

.lr.ph68.split:                                   ; preds = %.lr.ph68, %.preheader64
  %.167 = phi i64 [ %115, %.preheader64 ], [ 0, %.lr.ph68 ]
  %114 = call i64 @write(i32 noundef %89, ptr noundef nonnull %20, i64 noundef %19) #9
  %.not62 = icmp eq i64 %114, %19
  br i1 %.not62, label %.preheader64, label %.split.us

.preheader64:                                     ; preds = %.lr.ph68.split
  %115 = add nuw nsw i64 %.167, 1
  %exitcond85.not = icmp eq i64 %115, %18
  br i1 %exitcond85.not, label %._crit_edge69, label %.lr.ph68.split, !llvm.loop !22

.split.us:                                        ; preds = %.lr.ph68.split.us, %.lr.ph68.split
  call void @perror(ptr noundef nonnull @.str.13) #12
  br label %.loopexit

.split71.us:                                      ; preds = %.preheader64.us
  call void @perror(ptr noundef nonnull @.str.12) #12
  br label %.loopexit

._crit_edge69:                                    ; preds = %._crit_edge.us, %.preheader64, %.preheader65
  %116 = call i32 @clock_gettime(i32 noundef 1, ptr noundef nonnull %4) #9
  %117 = icmp eq i32 %116, -1
  br i1 %117, label %118, label %119

118:                                              ; preds = %._crit_edge69
  call void @perror(ptr noundef nonnull @.str.15) #12
  br label %.loopexit

119:                                              ; preds = %._crit_edge69
  %120 = load i64, ptr %4, align 8, !tbaa !23
  %121 = load i64, ptr %3, align 8, !tbaa !23
  %122 = sub nsw i64 %120, %121
  %123 = mul nsw i64 %122, 1000000000
  %124 = getelementptr inbounds i8, ptr %4, i64 8
  %125 = load i64, ptr %124, align 8, !tbaa !26
  %126 = getelementptr inbounds i8, ptr %3, i64 8
  %127 = load i64, ptr %126, align 8, !tbaa !26
  %128 = sub i64 %125, %127
  %129 = add nsw i64 %128, %123
  %130 = shl nsw i64 %18, 1
  %131 = sdiv i64 %129, %130
  %132 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, i64 noundef %131)
  br label %.loopexit

.loopexit:                                        ; preds = %73, %77, %.preheader63, %119, %118, %.split71.us, %.split.us, %113, %100, %91, %.split76.us, %.split78.us, %76, %61, %57, %48, %44, %26, %22, %10
  %.0 = phi i32 [ 1, %10 ], [ 1, %22 ], [ 1, %26 ], [ 1, %91 ], [ 1, %100 ], [ 1, %113 ], [ 1, %.split.us ], [ 1, %.split71.us ], [ 1, %118 ], [ 1, %44 ], [ 1, %48 ], [ 1, %57 ], [ 1, %61 ], [ 1, %76 ], [ 1, %.split78.us ], [ 1, %.split76.us ], [ 0, %119 ], [ 0, %.preheader63 ], [ 0, %77 ], [ 0, %73 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #9
  ret i32 %.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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i64 @atol(ptr nocapture noundef nonnull) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #2

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

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

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

; Function Attrs: nounwind
declare ptr @gai_strerror(i32 noundef) local_unnamed_addr #7

; Function Attrs: nofree nounwind
declare i32 @fork() local_unnamed_addr #2

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

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

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

; Function Attrs: nounwind
declare i32 @listen(i32 noundef, i32 noundef) local_unnamed_addr #7

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

; Function Attrs: nofree
declare noundef i64 @read(i32 noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #8

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

declare i32 @sleep(i32 noundef) local_unnamed_addr #6

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

; Function Attrs: nounwind
declare i32 @clock_gettime(i32 noundef, ptr noundef) local_unnamed_addr #7

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"addrinfo", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!13 = !{!12, !6, i64 0}
!14 = !{!12, !6, i64 4}
!15 = !{!12, !6, i64 12}
!16 = !{!12, !10, i64 24}
!17 = !{!12, !6, i64 16}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19}
!23 = !{!24, !25, i64 0}
!24 = !{!"timespec", !25, i64 0, !25, i64 8}
!25 = !{!"long", !7, i64 0}
!26 = !{!24, !25, i64 8}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass