; LLVM IR from DroneBridge/DroneBridge :: syslog_server (syslog_server_main)

; 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.sigaction = type { %union.anon, %struct.__sigset_t, i32, ptr }
%union.anon = type { ptr }
%struct.__sigset_t = type { [16 x i64] }
%struct.fd_set = type { [16 x i64] }
%struct.tcp_server_info_t = type { i32, %struct.sockaddr_in }
%struct.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }

@keep_running = external dso_local global i32, align 4
@.str.3 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @signal_handler(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @open_udp_server() #0

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

declare void @perror(ptr noundef) #2

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

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

declare void @syslog(i32 noundef, ptr noundef, ...) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 %struct.sigaction, align 8
  %7 = alloca [2048 x i8], align 16
  %8 = alloca [10 x i32], align 16
  %9 = alloca %struct.fd_set, align 8
  %10 = alloca %struct.tcp_server_info_t, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.sockaddr_in, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = 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 152, ptr %6) #7
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 152, i1 false)
  %27 = getelementptr inbounds %struct.sigaction, ptr %6, i32 0, i32 0
  store ptr @signal_handler, ptr %27, align 8, !tbaa !11
  %28 = call i32 @sigaction(i32 noundef 15, ptr noundef %6, ptr noundef null) #7
  %29 = call i32 @sigaction(i32 noundef 2, ptr noundef %6, ptr noundef null) #7
  call void @llvm.lifetime.start.p0(i64 2048, ptr %7) #7
  %30 = getelementptr inbounds [2048 x i8], ptr %7, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %30, i8 0, i64 2048, i1 false)
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #7
  call void @llvm.memset.p0.i64(ptr align 16 %8, i8 0, i64 40, i1 false)
  call void @llvm.lifetime.start.p0(i64 128, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 20, ptr %10) #7
  call void @create_tcp_server_socket(ptr dead_on_unwind writable sret(%struct.tcp_server_info_t) align 4 %10, i32 noundef 1605)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 16, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 16, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %31 = call i32 @open_udp_server()
  store i32 %31, ptr %14, align 4, !tbaa !5
  %32 = load i32, ptr %14, align 4, !tbaa !5
  %33 = icmp slt i32 %32, 0
  br i1 %33, label %34, label %35

34:                                               ; preds = %2
  call void @exit(i32 noundef -1) #8
  unreachable

35:                                               ; preds = %2
  br label %36

36:                                               ; preds = %35
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef 1605)
  call void (i32, ptr, ...) @syslog(i32 noundef 6, ptr noundef @.str.3, i32 noundef 1605)
  br label %38

38:                                               ; preds = %36
  br label %39

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %40
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  call void (i32, ptr, ...) @syslog(i32 noundef 6, ptr noundef @.str.4)
  br label %43

43:                                               ; preds = %41
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %312, %44
  %46 = load i32, ptr @keep_running, align 4, !tbaa !5
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %313

48:                                               ; preds = %45
  br label %49

49:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store ptr %9, ptr %17, align 8, !tbaa !9
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %60, %49
  %51 = load i32, ptr %16, align 4, !tbaa !5
  %52 = zext i32 %51 to i64
  %53 = icmp ult i64 %52, 16
  br i1 %53, label %54, label %63

54:                                               ; preds = %50
  %55 = load ptr, ptr %17, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct.fd_set, ptr %55, i32 0, i32 0
  %57 = load i32, ptr %16, align 4, !tbaa !5
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds [16 x i64], ptr %56, i64 0, i64 %58
  store i64 0, ptr %59, align 8, !tbaa !12
  br label %60

60:                                               ; preds = %54
  %61 = load i32, ptr %16, align 4, !tbaa !5
  %62 = add i32 %61, 1
  store i32 %62, ptr %16, align 4, !tbaa !5
  br label %50, !llvm.loop !14

63:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %14, align 4, !tbaa !5
  %67 = srem i32 %66, 64
  %68 = zext i32 %67 to i64
  %69 = shl i64 1, %68
  %70 = getelementptr inbounds %struct.fd_set, ptr %9, i32 0, i32 0
  %71 = load i32, ptr %14, align 4, !tbaa !5
  %72 = sdiv i32 %71, 64
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [16 x i64], ptr %70, i64 0, i64 %73
  %75 = load i64, ptr %74, align 8, !tbaa !12
  %76 = or i64 %75, %69
  store i64 %76, ptr %74, align 8, !tbaa !12
  %77 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %77, ptr %15, align 4, !tbaa !5
  %78 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 0
  %79 = load i32, ptr %78, align 4, !tbaa !16
  %80 = srem i32 %79, 64
  %81 = zext i32 %80 to i64
  %82 = shl i64 1, %81
  %83 = getelementptr inbounds %struct.fd_set, ptr %9, i32 0, i32 0
  %84 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 0
  %85 = load i32, ptr %84, align 4, !tbaa !16
  %86 = sdiv i32 %85, 64
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [16 x i64], ptr %83, i64 0, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !12
  %90 = or i64 %89, %82
  store i64 %90, ptr %88, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %121, %65
  %92 = load i32, ptr %18, align 4, !tbaa !5
  %93 = icmp slt i32 %92, 10
  br i1 %93, label %95, label %94

94:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %124

95:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %96 = load i32, ptr %18, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  store i32 %99, ptr %19, align 4, !tbaa !5
  %100 = load i32, ptr %19, align 4, !tbaa !5
  %101 = icmp sgt i32 %100, 0
  br i1 %101, label %102, label %114

102:                                              ; preds = %95
  %103 = load i32, ptr %19, align 4, !tbaa !5
  %104 = srem i32 %103, 64
  %105 = zext i32 %104 to i64
  %106 = shl i64 1, %105
  %107 = getelementptr inbounds %struct.fd_set, ptr %9, i32 0, i32 0
  %108 = load i32, ptr %19, align 4, !tbaa !5
  %109 = sdiv i32 %108, 64
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [16 x i64], ptr %107, i64 0, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !12
  %113 = or i64 %112, %106
  store i64 %113, ptr %111, align 8, !tbaa !12
  br label %114

114:                                              ; preds = %102, %95
  %115 = load i32, ptr %19, align 4, !tbaa !5
  %116 = load i32, ptr %15, align 4, !tbaa !5
  %117 = icmp sgt i32 %115, %116
  br i1 %117, label %118, label %120

118:                                              ; preds = %114
  %119 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %119, ptr %15, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %118, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %18, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %18, align 4, !tbaa !5
  br label %91, !llvm.loop !21

124:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %125 = load i32, ptr %15, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  %127 = call i32 @select(i32 noundef %126, ptr noundef %9, ptr noundef null, ptr noundef null, ptr noundef null)
  store i32 %127, ptr %20, align 4, !tbaa !5
  %128 = load i32, ptr %20, align 4, !tbaa !5
  %129 = icmp sgt i32 %128, 0
  br i1 %129, label %130, label %307

130:                                              ; preds = %124
  %131 = getelementptr inbounds %struct.fd_set, ptr %9, i32 0, i32 0
  %132 = load i32, ptr %14, align 4, !tbaa !5
  %133 = sdiv i32 %132, 64
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [16 x i64], ptr %131, i64 0, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !12
  %137 = load i32, ptr %14, align 4, !tbaa !5
  %138 = srem i32 %137, 64
  %139 = zext i32 %138 to i64
  %140 = shl i64 1, %139
  %141 = and i64 %136, %140
  %142 = icmp ne i64 %141, 0
  br i1 %142, label %143, label %156

143:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %144 = load i32, ptr %14, align 4, !tbaa !5
  %145 = getelementptr inbounds [2048 x i8], ptr %7, i64 0, i64 0
  %146 = call i64 @recvfrom(i32 noundef %144, ptr noundef %145, i64 noundef 2048, i32 noundef 0, ptr noundef %12, ptr noundef %13)
  store i64 %146, ptr %21, align 8, !tbaa !12
  %147 = load i64, ptr %21, align 8, !tbaa !12
  %148 = icmp sgt i64 %147, 0
  br i1 %148, label %149, label %154

149:                                              ; preds = %143
  %150 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 0
  %151 = getelementptr inbounds [2048 x i8], ptr %7, i64 0, i64 0
  %152 = load i64, ptr %21, align 8, !tbaa !12
  %153 = trunc i64 %152 to i32
  call void @send_to_all_tcp_clients(ptr noundef %150, ptr noundef %151, i32 noundef %153)
  br label %155

154:                                              ; preds = %143
  call void @perror(ptr noundef @.str.5)
  br label %155

155:                                              ; preds = %154, %149
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %156

156:                                              ; preds = %155, %130
  %157 = getelementptr inbounds %struct.fd_set, ptr %9, i32 0, i32 0
  %158 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 0
  %159 = load i32, ptr %158, align 4, !tbaa !16
  %160 = sdiv i32 %159, 64
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [16 x i64], ptr %157, i64 0, i64 %161
  %163 = load i64, ptr %162, align 8, !tbaa !12
  %164 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 0
  %165 = load i32, ptr %164, align 4, !tbaa !16
  %166 = srem i32 %165, 64
  %167 = zext i32 %166 to i64
  %168 = shl i64 1, %167
  %169 = and i64 %163, %168
  %170 = icmp ne i64 %169, 0
  br i1 %170, label %171, label %225

171:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %172 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 0
  %173 = load i32, ptr %172, align 4, !tbaa !16
  %174 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 1
  %175 = call i32 @accept(i32 noundef %173, ptr noundef %174, ptr noundef %11)
  store i32 %175, ptr %22, align 4, !tbaa !5
  %176 = icmp slt i32 %175, 0
  br i1 %176, label %177, label %178

177:                                              ; preds = %171
  call void @perror(ptr noundef @.str.6)
  br label %224

178:                                              ; preds = %171
  br label %179

179:                                              ; preds = %178
  %180 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 1
  %181 = getelementptr inbounds %struct.sockaddr_in, ptr %180, i32 0, i32 2
  %182 = getelementptr inbounds %struct.in_addr, ptr %181, i32 0, i32 0
  %183 = load i32, ptr %182, align 4
  %184 = call ptr @inet_ntoa(i32 %183) #7
  %185 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 1
  %186 = getelementptr inbounds %struct.sockaddr_in, ptr %185, i32 0, i32 1
  %187 = load i16, ptr %186, align 2, !tbaa !22
  %188 = call zeroext i16 @__bswap_16(i16 noundef zeroext %187)
  %189 = zext i16 %188 to i32
  %190 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef %184, i32 noundef %189)
  %191 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 1
  %192 = getelementptr inbounds %struct.sockaddr_in, ptr %191, i32 0, i32 2
  %193 = getelementptr inbounds %struct.in_addr, ptr %192, i32 0, i32 0
  %194 = load i32, ptr %193, align 4
  %195 = call ptr @inet_ntoa(i32 %194) #7
  %196 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 1
  %197 = getelementptr inbounds %struct.sockaddr_in, ptr %196, i32 0, i32 1
  %198 = load i16, ptr %197, align 2, !tbaa !22
  %199 = call zeroext i16 @__bswap_16(i16 noundef zeroext %198)
  %200 = zext i16 %199 to i32
  call void (i32, ptr, ...) @syslog(i32 noundef 6, ptr noundef @.str.7, ptr noundef %195, i32 noundef %200)
  br label %201

201:                                              ; preds = %179
  br label %202

202:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %203

203:                                              ; preds = %219, %202
  %204 = load i32, ptr %23, align 4, !tbaa !5
  %205 = icmp slt i32 %204, 10
  br i1 %205, label %207, label %206

206:                                              ; preds = %203
  store i32 18, ptr %24, align 4
  br label %222

207:                                              ; preds = %203
  %208 = load i32, ptr %23, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %209
  %211 = load i32, ptr %210, align 4, !tbaa !5
  %212 = icmp eq i32 %211, 0
  br i1 %212, label %213, label %218

213:                                              ; preds = %207
  %214 = load i32, ptr %22, align 4, !tbaa !5
  %215 = load i32, ptr %23, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %216
  store i32 %214, ptr %217, align 4, !tbaa !5
  store i32 18, ptr %24, align 4
  br label %222

218:                                              ; preds = %207
  br label %219

219:                                              ; preds = %218
  %220 = load i32, ptr %23, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %23, align 4, !tbaa !5
  br label %203, !llvm.loop !23

222:                                              ; preds = %213, %206
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %223

223:                                              ; preds = %222
  br label %224

224:                                              ; preds = %223, %177
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %225

225:                                              ; preds = %224, %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %226

226:                                              ; preds = %303, %225
  %227 = load i32, ptr %25, align 4, !tbaa !5
  %228 = icmp slt i32 %227, 10
  br i1 %228, label %230, label %229

229:                                              ; preds = %226
  store i32 21, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %306

230:                                              ; preds = %226
  %231 = getelementptr inbounds %struct.fd_set, ptr %9, i32 0, i32 0
  %232 = load i32, ptr %25, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %233
  %235 = load i32, ptr %234, align 4, !tbaa !5
  %236 = sdiv i32 %235, 64
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [16 x i64], ptr %231, i64 0, i64 %237
  %239 = load i64, ptr %238, align 8, !tbaa !12
  %240 = load i32, ptr %25, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !5
  %244 = srem i32 %243, 64
  %245 = zext i32 %244 to i64
  %246 = shl i64 1, %245
  %247 = and i64 %239, %246
  %248 = icmp ne i64 %247, 0
  br i1 %248, label %249, label %302

249:                                              ; preds = %230
  %250 = load i32, ptr %25, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %251
  %253 = load i32, ptr %252, align 4, !tbaa !5
  %254 = getelementptr inbounds [2048 x i8], ptr %7, i64 0, i64 0
  %255 = call i64 @read(i32 noundef %253, ptr noundef %254, i64 noundef 2048)
  %256 = icmp eq i64 %255, 0
  br i1 %256, label %257, label %296

257:                                              ; preds = %249
  %258 = load i32, ptr %25, align 4, !tbaa !5
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %259
  %261 = load i32, ptr %260, align 4, !tbaa !5
  %262 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 1
  %263 = call i32 @getpeername(i32 noundef %261, ptr noundef %262, ptr noundef %11) #7
  br label %264

264:                                              ; preds = %257
  %265 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 1
  %266 = getelementptr inbounds %struct.sockaddr_in, ptr %265, i32 0, i32 2
  %267 = getelementptr inbounds %struct.in_addr, ptr %266, i32 0, i32 0
  %268 = load i32, ptr %267, align 4
  %269 = call ptr @inet_ntoa(i32 %268) #7
  %270 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 1
  %271 = getelementptr inbounds %struct.sockaddr_in, ptr %270, i32 0, i32 1
  %272 = load i16, ptr %271, align 2, !tbaa !22
  %273 = call zeroext i16 @__bswap_16(i16 noundef zeroext %272)
  %274 = zext i16 %273 to i32
  %275 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, ptr noundef %269, i32 noundef %274)
  %276 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 1
  %277 = getelementptr inbounds %struct.sockaddr_in, ptr %276, i32 0, i32 2
  %278 = getelementptr inbounds %struct.in_addr, ptr %277, i32 0, i32 0
  %279 = load i32, ptr %278, align 4
  %280 = call ptr @inet_ntoa(i32 %279) #7
  %281 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 1
  %282 = getelementptr inbounds %struct.sockaddr_in, ptr %281, i32 0, i32 1
  %283 = load i16, ptr %282, align 2, !tbaa !22
  %284 = call zeroext i16 @__bswap_16(i16 noundef zeroext %283)
  %285 = zext i16 %284 to i32
  call void (i32, ptr, ...) @syslog(i32 noundef 6, ptr noundef @.str.8, ptr noundef %280, i32 noundef %285)
  br label %286

286:                                              ; preds = %264
  br label %287

287:                                              ; preds = %286
  %288 = load i32, ptr %25, align 4, !tbaa !5
  %289 = sext i32 %288 to i64
  %290 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %289
  %291 = load i32, ptr %290, align 4, !tbaa !5
  %292 = call i32 @close(i32 noundef %291)
  %293 = load i32, ptr %25, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %294
  store i32 0, ptr %295, align 4, !tbaa !5
  br label %301

296:                                              ; preds = %249
  br label %297

297:                                              ; preds = %296
  %298 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  call void (i32, ptr, ...) @syslog(i32 noundef 4, ptr noundef @.str.9)
  br label %299

299:                                              ; preds = %297
  br label %300

300:                                              ; preds = %299
  br label %301

301:                                              ; preds = %300, %287
  br label %302

302:                                              ; preds = %301, %230
  br label %303

303:                                              ; preds = %302
  %304 = load i32, ptr %25, align 4, !tbaa !5
  %305 = add nsw i32 %304, 1
  store i32 %305, ptr %25, align 4, !tbaa !5
  br label %226, !llvm.loop !24

306:                                              ; preds = %229
  br label %312

307:                                              ; preds = %124
  %308 = load i32, ptr %20, align 4, !tbaa !5
  %309 = icmp eq i32 %308, -1
  br i1 %309, label %310, label %311

310:                                              ; preds = %307
  store i32 0, ptr @keep_running, align 4, !tbaa !5
  call void @perror(ptr noundef @.str.10)
  br label %311

311:                                              ; preds = %310, %307
  br label %312

312:                                              ; preds = %311, %306
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %45, !llvm.loop !25

313:                                              ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %314

314:                                              ; preds = %331, %313
  %315 = load i32, ptr %26, align 4, !tbaa !5
  %316 = icmp slt i32 %315, 10
  br i1 %316, label %318, label %317

317:                                              ; preds = %314
  store i32 28, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %334

318:                                              ; preds = %314
  %319 = load i32, ptr %26, align 4, !tbaa !5
  %320 = sext i32 %319 to i64
  %321 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %320
  %322 = load i32, ptr %321, align 4, !tbaa !5
  %323 = icmp sgt i32 %322, 0
  br i1 %323, label %324, label %330

324:                                              ; preds = %318
  %325 = load i32, ptr %26, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %326
  %328 = load i32, ptr %327, align 4, !tbaa !5
  %329 = call i32 @close(i32 noundef %328)
  br label %330

330:                                              ; preds = %324, %318
  br label %331

331:                                              ; preds = %330
  %332 = load i32, ptr %26, align 4, !tbaa !5
  %333 = add nsw i32 %332, 1
  store i32 %333, ptr %26, align 4, !tbaa !5
  br label %314, !llvm.loop !26

334:                                              ; preds = %317
  %335 = getelementptr inbounds %struct.tcp_server_info_t, ptr %10, i32 0, i32 0
  %336 = load i32, ptr %335, align 4, !tbaa !16
  %337 = call i32 @close(i32 noundef %336)
  br label %338

338:                                              ; preds = %334
  %339 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  call void (i32, ptr, ...) @syslog(i32 noundef 6, ptr noundef @.str.11)
  br label %340

340:                                              ; preds = %338
  br label %341

341:                                              ; preds = %340
  call void @exit(i32 noundef 0) #8
  unreachable
}

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

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

declare void @create_tcp_server_socket(ptr dead_on_unwind writable sret(%struct.tcp_server_info_t) align 4, i32 noundef) #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #6

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

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

declare void @send_to_all_tcp_clients(ptr noundef, ptr noundef, i32 noundef) #2

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

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

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

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

declare i32 @close(i32 noundef) #2

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 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { noreturn 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 = { noreturn 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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !6, i64 0}
!17 = !{!"tcp_server_info_t", !6, i64 0, !18, i64 4}
!18 = !{!"sockaddr_in", !19, i64 0, !19, i64 2, !20, i64 4, !7, i64 8}
!19 = !{!"short", !7, i64 0}
!20 = !{!"in_addr", !6, i64 0}
!21 = distinct !{!21, !15}
!22 = !{!17, !19, i64 6}
!23 = distinct !{!23, !15}
!24 = distinct !{!24, !15}
!25 = distinct !{!25, !15}
!26 = distinct !{!26, !15}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.sigaction = type { %union.anon, %struct.__sigset_t, i32, ptr }
%union.anon = type { ptr }
%struct.__sigset_t = type { [16 x i64] }
%struct.fd_set = type { [16 x i64] }
%struct.tcp_server_info_t = type { i32, %struct.sockaddr_in }
%struct.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }

@keep_running = external dso_local local_unnamed_addr global i32, align 4
@.str.3 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @signal_handler(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @open_udp_server() local_unnamed_addr #0

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

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

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

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

declare void @syslog(i32 noundef, ptr noundef, ...) local_unnamed_addr #4

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #5 {
  %3 = alloca %struct.sigaction, align 8
  %4 = alloca [2048 x i8], align 16
  %5 = alloca [10 x i32], align 16
  %6 = alloca %struct.fd_set, align 8
  %7 = alloca %struct.tcp_server_info_t, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.sockaddr_in, align 4
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 152, ptr nonnull %3) #11
  %11 = getelementptr inbounds i8, ptr %3, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(152) %11, i8 0, i64 144, i1 false)
  store ptr @signal_handler, ptr %3, align 8, !tbaa !5
  %12 = call i32 @sigaction(i32 noundef 15, ptr noundef nonnull %3, ptr noundef null) #11
  %13 = call i32 @sigaction(i32 noundef 2, ptr noundef nonnull %3, ptr noundef null) #11
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %4) #11
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2048) %4, i8 0, i64 2048, i1 false)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #11
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %5, i8 0, i64 40, i1 false)
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %6) #11
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %7) #11
  call void @create_tcp_server_socket(ptr dead_on_unwind nonnull writable sret(%struct.tcp_server_info_t) align 4 %7, i32 noundef 1605) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #11
  store i32 16, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #11
  store i32 16, ptr %10, align 4, !tbaa !8
  %14 = call i32 @open_udp_server()
  %15 = icmp slt i32 %14, 0
  %.lcssa.sroa.gep76 = getelementptr inbounds i8, ptr %5, i64 4
  %.lcssa.sroa.gep77 = getelementptr inbounds i8, ptr %5, i64 8
  %.lcssa.sroa.gep78 = getelementptr inbounds i8, ptr %5, i64 12
  %.lcssa.sroa.gep79 = getelementptr inbounds i8, ptr %5, i64 16
  %.lcssa.sroa.gep80 = getelementptr inbounds i8, ptr %5, i64 20
  %.lcssa.sroa.gep81 = getelementptr inbounds i8, ptr %5, i64 24
  %.lcssa.sroa.gep82 = getelementptr inbounds i8, ptr %5, i64 28
  %.lcssa.sroa.gep83 = getelementptr inbounds i8, ptr %5, i64 32
  %.lcssa.sroa.gep84 = getelementptr inbounds i8, ptr %5, i64 36
  br i1 %15, label %16, label %17

16:                                               ; preds = %2
  call void @exit(i32 noundef -1) #12
  unreachable

17:                                               ; preds = %2
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 1605)
  call void (i32, ptr, ...) @syslog(i32 noundef 6, ptr noundef nonnull @.str.3, i32 noundef 1605) #11
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void (i32, ptr, ...) @syslog(i32 noundef 6, ptr noundef nonnull @.str.4) #11
  %20 = load i32, ptr @keep_running, align 4, !tbaa !8
  %.not65 = icmp eq i32 %20, 0
  br i1 %.not65, label %.preheader, label %.preheader58.lr.ph

.preheader58.lr.ph:                               ; preds = %17
  %21 = and i32 %14, 63
  %22 = zext nneg i32 %21 to i64
  %23 = shl nuw i64 1, %22
  %24 = lshr i32 %14, 6
  %25 = zext nneg i32 %24 to i64
  %26 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %25
  %27 = getelementptr inbounds i8, ptr %7, i64 4
  %28 = getelementptr inbounds i8, ptr %7, i64 8
  %29 = getelementptr inbounds i8, ptr %7, i64 6
  br label %.preheader58

.preheader58:                                     ; preds = %.preheader58.lr.ph, %.loopexit
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(128) %6, i8 0, i64 128, i1 false), !tbaa !10
  %30 = load i64, ptr %26, align 8, !tbaa !10
  %31 = or i64 %30, %23
  store i64 %31, ptr %26, align 8, !tbaa !10
  %32 = load i32, ptr %7, align 4, !tbaa !12
  %33 = srem i32 %32, 64
  %34 = zext nneg i32 %33 to i64
  %35 = shl nuw i64 1, %34
  %36 = sdiv i32 %32, 64
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !10
  %40 = or i64 %35, %39
  store i64 %40, ptr %38, align 8, !tbaa !10
  %41 = load i32, ptr %5, align 16, !tbaa !8
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %45, label %54

.preheader:                                       ; preds = %.loopexit, %17
  %43 = load i32, ptr %5, align 16, !tbaa !8
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %267, label %269

45:                                               ; preds = %.preheader58
  %46 = and i32 %41, 63
  %47 = zext nneg i32 %46 to i64
  %48 = shl nuw i64 1, %47
  %49 = lshr i32 %41, 6
  %50 = zext nneg i32 %49 to i64
  %51 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !10
  %53 = or i64 %52, %48
  store i64 %53, ptr %51, align 8, !tbaa !10
  br label %54

54:                                               ; preds = %45, %.preheader58
  %spec.select = call i32 @llvm.smax.i32(i32 %41, i32 %14)
  %55 = load i32, ptr %.lcssa.sroa.gep76, align 4, !tbaa !8
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %57, label %66

57:                                               ; preds = %54
  %58 = and i32 %55, 63
  %59 = zext nneg i32 %58 to i64
  %60 = shl nuw i64 1, %59
  %61 = lshr i32 %55, 6
  %62 = zext nneg i32 %61 to i64
  %63 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !10
  %65 = or i64 %64, %60
  store i64 %65, ptr %63, align 8, !tbaa !10
  br label %66

66:                                               ; preds = %57, %54
  %spec.select.1 = call i32 @llvm.smax.i32(i32 %55, i32 %spec.select)
  %67 = load i32, ptr %.lcssa.sroa.gep77, align 8, !tbaa !8
  %68 = icmp sgt i32 %67, 0
  br i1 %68, label %69, label %78

69:                                               ; preds = %66
  %70 = and i32 %67, 63
  %71 = zext nneg i32 %70 to i64
  %72 = shl nuw i64 1, %71
  %73 = lshr i32 %67, 6
  %74 = zext nneg i32 %73 to i64
  %75 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !10
  %77 = or i64 %76, %72
  store i64 %77, ptr %75, align 8, !tbaa !10
  br label %78

78:                                               ; preds = %69, %66
  %spec.select.2 = call i32 @llvm.smax.i32(i32 %67, i32 %spec.select.1)
  %79 = load i32, ptr %.lcssa.sroa.gep78, align 4, !tbaa !8
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %81, label %90

81:                                               ; preds = %78
  %82 = and i32 %79, 63
  %83 = zext nneg i32 %82 to i64
  %84 = shl nuw i64 1, %83
  %85 = lshr i32 %79, 6
  %86 = zext nneg i32 %85 to i64
  %87 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !10
  %89 = or i64 %88, %84
  store i64 %89, ptr %87, align 8, !tbaa !10
  br label %90

90:                                               ; preds = %81, %78
  %spec.select.3 = call i32 @llvm.smax.i32(i32 %79, i32 %spec.select.2)
  %91 = load i32, ptr %.lcssa.sroa.gep79, align 16, !tbaa !8
  %92 = icmp sgt i32 %91, 0
  br i1 %92, label %93, label %102

93:                                               ; preds = %90
  %94 = and i32 %91, 63
  %95 = zext nneg i32 %94 to i64
  %96 = shl nuw i64 1, %95
  %97 = lshr i32 %91, 6
  %98 = zext nneg i32 %97 to i64
  %99 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %98
  %100 = load i64, ptr %99, align 8, !tbaa !10
  %101 = or i64 %100, %96
  store i64 %101, ptr %99, align 8, !tbaa !10
  br label %102

102:                                              ; preds = %93, %90
  %spec.select.4 = call i32 @llvm.smax.i32(i32 %91, i32 %spec.select.3)
  %103 = load i32, ptr %.lcssa.sroa.gep80, align 4, !tbaa !8
  %104 = icmp sgt i32 %103, 0
  br i1 %104, label %105, label %114

105:                                              ; preds = %102
  %106 = and i32 %103, 63
  %107 = zext nneg i32 %106 to i64
  %108 = shl nuw i64 1, %107
  %109 = lshr i32 %103, 6
  %110 = zext nneg i32 %109 to i64
  %111 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !10
  %113 = or i64 %112, %108
  store i64 %113, ptr %111, align 8, !tbaa !10
  br label %114

114:                                              ; preds = %105, %102
  %spec.select.5 = call i32 @llvm.smax.i32(i32 %103, i32 %spec.select.4)
  %115 = load i32, ptr %.lcssa.sroa.gep81, align 8, !tbaa !8
  %116 = icmp sgt i32 %115, 0
  br i1 %116, label %117, label %126

117:                                              ; preds = %114
  %118 = and i32 %115, 63
  %119 = zext nneg i32 %118 to i64
  %120 = shl nuw i64 1, %119
  %121 = lshr i32 %115, 6
  %122 = zext nneg i32 %121 to i64
  %123 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !10
  %125 = or i64 %124, %120
  store i64 %125, ptr %123, align 8, !tbaa !10
  br label %126

126:                                              ; preds = %117, %114
  %spec.select.6 = call i32 @llvm.smax.i32(i32 %115, i32 %spec.select.5)
  %127 = load i32, ptr %.lcssa.sroa.gep82, align 4, !tbaa !8
  %128 = icmp sgt i32 %127, 0
  br i1 %128, label %129, label %138

129:                                              ; preds = %126
  %130 = and i32 %127, 63
  %131 = zext nneg i32 %130 to i64
  %132 = shl nuw i64 1, %131
  %133 = lshr i32 %127, 6
  %134 = zext nneg i32 %133 to i64
  %135 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !10
  %137 = or i64 %136, %132
  store i64 %137, ptr %135, align 8, !tbaa !10
  br label %138

138:                                              ; preds = %129, %126
  %spec.select.7 = call i32 @llvm.smax.i32(i32 %127, i32 %spec.select.6)
  %139 = load i32, ptr %.lcssa.sroa.gep83, align 16, !tbaa !8
  %140 = icmp sgt i32 %139, 0
  br i1 %140, label %141, label %150

141:                                              ; preds = %138
  %142 = and i32 %139, 63
  %143 = zext nneg i32 %142 to i64
  %144 = shl nuw i64 1, %143
  %145 = lshr i32 %139, 6
  %146 = zext nneg i32 %145 to i64
  %147 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %146
  %148 = load i64, ptr %147, align 8, !tbaa !10
  %149 = or i64 %148, %144
  store i64 %149, ptr %147, align 8, !tbaa !10
  br label %150

150:                                              ; preds = %141, %138
  %spec.select.8 = call i32 @llvm.smax.i32(i32 %139, i32 %spec.select.7)
  %151 = load i32, ptr %.lcssa.sroa.gep84, align 4, !tbaa !8
  %152 = icmp sgt i32 %151, 0
  br i1 %152, label %153, label %162

153:                                              ; preds = %150
  %154 = and i32 %151, 63
  %155 = zext nneg i32 %154 to i64
  %156 = shl nuw i64 1, %155
  %157 = lshr i32 %151, 6
  %158 = zext nneg i32 %157 to i64
  %159 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %158
  %160 = load i64, ptr %159, align 8, !tbaa !10
  %161 = or i64 %160, %156
  store i64 %161, ptr %159, align 8, !tbaa !10
  br label %162

162:                                              ; preds = %153, %150
  %spec.select.9 = call i32 @llvm.smax.i32(i32 %151, i32 %spec.select.8)
  %163 = add nuw nsw i32 %spec.select.9, 1
  %164 = call i32 @select(i32 noundef %163, ptr noundef nonnull %6, ptr noundef null, ptr noundef null, ptr noundef null) #11
  %165 = icmp sgt i32 %164, 0
  br i1 %165, label %166, label %263

166:                                              ; preds = %162
  %167 = load i64, ptr %26, align 8, !tbaa !10
  %168 = and i64 %167, %23
  %.not54 = icmp eq i64 %168, 0
  br i1 %.not54, label %175, label %169

169:                                              ; preds = %166
  %170 = call i64 @recvfrom(i32 noundef %14, ptr noundef nonnull %4, i64 noundef 2048, i32 noundef 0, ptr noundef nonnull %9, ptr noundef nonnull %10) #11
  %171 = icmp sgt i64 %170, 0
  br i1 %171, label %172, label %174

172:                                              ; preds = %169
  %173 = trunc i64 %170 to i32
  call void @send_to_all_tcp_clients(ptr noundef nonnull %5, ptr noundef nonnull %4, i32 noundef %173) #11
  br label %175

174:                                              ; preds = %169
  call void @perror(ptr noundef nonnull @.str.5) #13
  br label %175

175:                                              ; preds = %172, %174, %166
  %176 = load i32, ptr %7, align 4, !tbaa !12
  %177 = sdiv i32 %176, 64
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %178
  %180 = load i64, ptr %179, align 8, !tbaa !10
  %181 = srem i32 %176, 64
  %182 = zext nneg i32 %181 to i64
  %183 = shl nuw i64 1, %182
  %184 = and i64 %183, %180
  %.not55 = icmp eq i64 %184, 0
  br i1 %.not55, label %.loopexit57.preheader, label %185

185:                                              ; preds = %175
  %186 = call i32 @accept(i32 noundef %176, ptr noundef nonnull %27, ptr noundef nonnull %8) #11
  %187 = icmp slt i32 %186, 0
  br i1 %187, label %188, label %189

188:                                              ; preds = %185
  call void @perror(ptr noundef nonnull @.str.6) #13
  br label %.loopexit57.preheader

189:                                              ; preds = %185
  %190 = load i32, ptr %28, align 4
  %191 = call ptr @inet_ntoa(i32 %190) #11
  %192 = load i16, ptr %29, align 2, !tbaa !17
  %193 = call zeroext i16 @__bswap_16(i16 noundef zeroext %192)
  %194 = zext i16 %193 to i32
  %195 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef %191, i32 noundef %194)
  %196 = load i32, ptr %28, align 4
  %197 = call ptr @inet_ntoa(i32 %196) #11
  %198 = load i16, ptr %29, align 2, !tbaa !17
  %199 = call zeroext i16 @__bswap_16(i16 noundef zeroext %198)
  %200 = zext i16 %199 to i32
  call void (i32, ptr, ...) @syslog(i32 noundef 6, ptr noundef nonnull @.str.7, ptr noundef %197, i32 noundef %200) #11
  %201 = load i32, ptr %5, align 16, !tbaa !8
  %202 = icmp eq i32 %201, 0
  br i1 %202, label %230, label %203

203:                                              ; preds = %189
  %204 = load i32, ptr %.lcssa.sroa.gep76, align 4, !tbaa !8
  %205 = icmp eq i32 %204, 0
  br i1 %205, label %230, label %206

206:                                              ; preds = %203
  %207 = load i32, ptr %.lcssa.sroa.gep77, align 8, !tbaa !8
  %208 = icmp eq i32 %207, 0
  br i1 %208, label %230, label %209

209:                                              ; preds = %206
  %210 = load i32, ptr %.lcssa.sroa.gep78, align 4, !tbaa !8
  %211 = icmp eq i32 %210, 0
  br i1 %211, label %230, label %212

212:                                              ; preds = %209
  %213 = load i32, ptr %.lcssa.sroa.gep79, align 16, !tbaa !8
  %214 = icmp eq i32 %213, 0
  br i1 %214, label %230, label %215

215:                                              ; preds = %212
  %216 = load i32, ptr %.lcssa.sroa.gep80, align 4, !tbaa !8
  %217 = icmp eq i32 %216, 0
  br i1 %217, label %230, label %218

218:                                              ; preds = %215
  %219 = load i32, ptr %.lcssa.sroa.gep81, align 8, !tbaa !8
  %220 = icmp eq i32 %219, 0
  br i1 %220, label %230, label %221

221:                                              ; preds = %218
  %222 = load i32, ptr %.lcssa.sroa.gep82, align 4, !tbaa !8
  %223 = icmp eq i32 %222, 0
  br i1 %223, label %230, label %224

224:                                              ; preds = %221
  %225 = load i32, ptr %.lcssa.sroa.gep83, align 16, !tbaa !8
  %226 = icmp eq i32 %225, 0
  br i1 %226, label %230, label %227

227:                                              ; preds = %224
  %228 = load i32, ptr %.lcssa.sroa.gep84, align 4, !tbaa !8
  %229 = icmp eq i32 %228, 0
  br i1 %229, label %230, label %.loopexit57.preheader

230:                                              ; preds = %227, %224, %221, %218, %215, %212, %209, %206, %203, %189
  %.lcssa.sroa.phi = phi ptr [ %5, %189 ], [ %.lcssa.sroa.gep76, %203 ], [ %.lcssa.sroa.gep77, %206 ], [ %.lcssa.sroa.gep78, %209 ], [ %.lcssa.sroa.gep79, %212 ], [ %.lcssa.sroa.gep80, %215 ], [ %.lcssa.sroa.gep81, %218 ], [ %.lcssa.sroa.gep82, %221 ], [ %.lcssa.sroa.gep83, %224 ], [ %.lcssa.sroa.gep84, %227 ]
  store i32 %186, ptr %.lcssa.sroa.phi, align 4, !tbaa !8
  br label %.loopexit57.preheader

.loopexit57.preheader:                            ; preds = %227, %188, %230, %175
  br label %.loopexit57

.loopexit57:                                      ; preds = %.loopexit57.preheader, %262
  %indvars.iv = phi i64 [ %indvars.iv.next, %262 ], [ 0, %.loopexit57.preheader ]
  %231 = getelementptr inbounds [10 x i32], ptr %5, i64 0, i64 %indvars.iv
  %232 = load i32, ptr %231, align 4, !tbaa !8
  %233 = sdiv i32 %232, 64
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %234
  %236 = load i64, ptr %235, align 8, !tbaa !10
  %237 = srem i32 %232, 64
  %238 = zext nneg i32 %237 to i64
  %239 = shl nuw i64 1, %238
  %240 = and i64 %239, %236
  %.not56 = icmp eq i64 %240, 0
  br i1 %.not56, label %262, label %241

241:                                              ; preds = %.loopexit57
  %242 = call i64 @read(i32 noundef %232, ptr noundef nonnull %4, i64 noundef 2048) #11
  %243 = icmp eq i64 %242, 0
  br i1 %243, label %244, label %260

244:                                              ; preds = %241
  %245 = load i32, ptr %231, align 4, !tbaa !8
  %246 = call i32 @getpeername(i32 noundef %245, ptr noundef nonnull %27, ptr noundef nonnull %8) #11
  %247 = load i32, ptr %28, align 4
  %248 = call ptr @inet_ntoa(i32 %247) #11
  %249 = load i16, ptr %29, align 2, !tbaa !17
  %250 = call zeroext i16 @__bswap_16(i16 noundef zeroext %249)
  %251 = zext i16 %250 to i32
  %252 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef %248, i32 noundef %251)
  %253 = load i32, ptr %28, align 4
  %254 = call ptr @inet_ntoa(i32 %253) #11
  %255 = load i16, ptr %29, align 2, !tbaa !17
  %256 = call zeroext i16 @__bswap_16(i16 noundef zeroext %255)
  %257 = zext i16 %256 to i32
  call void (i32, ptr, ...) @syslog(i32 noundef 6, ptr noundef nonnull @.str.8, ptr noundef %254, i32 noundef %257) #11
  %258 = load i32, ptr %231, align 4, !tbaa !8
  %259 = call i32 @close(i32 noundef %258) #11
  store i32 0, ptr %231, align 4, !tbaa !8
  br label %262

260:                                              ; preds = %241
  %261 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  call void (i32, ptr, ...) @syslog(i32 noundef 4, ptr noundef nonnull @.str.9) #11
  br label %262

262:                                              ; preds = %.loopexit57, %260, %244
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 10
  br i1 %exitcond.not, label %.loopexit, label %.loopexit57, !llvm.loop !18

263:                                              ; preds = %162
  %264 = icmp eq i32 %164, -1
  br i1 %264, label %265, label %.loopexit

265:                                              ; preds = %263
  store i32 0, ptr @keep_running, align 4, !tbaa !8
  call void @perror(ptr noundef nonnull @.str.10) #13
  br label %.loopexit

.loopexit:                                        ; preds = %262, %263, %265
  %266 = load i32, ptr @keep_running, align 4, !tbaa !8
  %.not = icmp eq i32 %266, 0
  br i1 %.not, label %.preheader, label %.preheader58, !llvm.loop !20

267:                                              ; preds = %.preheader
  %268 = call i32 @close(i32 noundef %43) #11
  br label %269

269:                                              ; preds = %.preheader, %267
  %270 = load i32, ptr %.lcssa.sroa.gep76, align 4, !tbaa !8
  %271 = icmp sgt i32 %270, 0
  br i1 %271, label %272, label %274

272:                                              ; preds = %269
  %273 = call i32 @close(i32 noundef %270) #11
  br label %274

274:                                              ; preds = %272, %269
  %275 = load i32, ptr %.lcssa.sroa.gep77, align 8, !tbaa !8
  %276 = icmp sgt i32 %275, 0
  br i1 %276, label %277, label %279

277:                                              ; preds = %274
  %278 = call i32 @close(i32 noundef %275) #11
  br label %279

279:                                              ; preds = %277, %274
  %280 = load i32, ptr %.lcssa.sroa.gep78, align 4, !tbaa !8
  %281 = icmp sgt i32 %280, 0
  br i1 %281, label %282, label %284

282:                                              ; preds = %279
  %283 = call i32 @close(i32 noundef %280) #11
  br label %284

284:                                              ; preds = %282, %279
  %285 = load i32, ptr %.lcssa.sroa.gep79, align 16, !tbaa !8
  %286 = icmp sgt i32 %285, 0
  br i1 %286, label %287, label %289

287:                                              ; preds = %284
  %288 = call i32 @close(i32 noundef %285) #11
  br label %289

289:                                              ; preds = %287, %284
  %290 = load i32, ptr %.lcssa.sroa.gep80, align 4, !tbaa !8
  %291 = icmp sgt i32 %290, 0
  br i1 %291, label %292, label %294

292:                                              ; preds = %289
  %293 = call i32 @close(i32 noundef %290) #11
  br label %294

294:                                              ; preds = %292, %289
  %295 = load i32, ptr %.lcssa.sroa.gep81, align 8, !tbaa !8
  %296 = icmp sgt i32 %295, 0
  br i1 %296, label %297, label %299

297:                                              ; preds = %294
  %298 = call i32 @close(i32 noundef %295) #11
  br label %299

299:                                              ; preds = %297, %294
  %300 = load i32, ptr %.lcssa.sroa.gep82, align 4, !tbaa !8
  %301 = icmp sgt i32 %300, 0
  br i1 %301, label %302, label %304

302:                                              ; preds = %299
  %303 = call i32 @close(i32 noundef %300) #11
  br label %304

304:                                              ; preds = %302, %299
  %305 = load i32, ptr %.lcssa.sroa.gep83, align 16, !tbaa !8
  %306 = icmp sgt i32 %305, 0
  br i1 %306, label %307, label %309

307:                                              ; preds = %304
  %308 = call i32 @close(i32 noundef %305) #11
  br label %309

309:                                              ; preds = %307, %304
  %310 = load i32, ptr %.lcssa.sroa.gep84, align 4, !tbaa !8
  %311 = icmp sgt i32 %310, 0
  br i1 %311, label %312, label %314

312:                                              ; preds = %309
  %313 = call i32 @close(i32 noundef %310) #11
  br label %314

314:                                              ; preds = %312, %309
  %315 = load i32, ptr %7, align 4, !tbaa !12
  %316 = call i32 @close(i32 noundef %315) #11
  %317 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  call void (i32, ptr, ...) @syslog(i32 noundef 6, ptr noundef nonnull @.str.11) #11
  call void @exit(i32 noundef 0) #12
  unreachable
}

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

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

declare void @create_tcp_server_socket(ptr dead_on_unwind writable sret(%struct.tcp_server_info_t) align 4, i32 noundef) local_unnamed_addr #4

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #8

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

declare i64 @recvfrom(i32 noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @send_to_all_tcp_clients(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

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

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

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

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

declare i32 @close(i32 noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #10

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

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !6, i64 0}
!12 = !{!13, !9, i64 0}
!13 = !{!"tcp_server_info_t", !9, i64 0, !14, i64 4}
!14 = !{!"sockaddr_in", !15, i64 0, !15, i64 2, !16, i64 4, !6, i64 8}
!15 = !{!"short", !6, i64 0}
!16 = !{!"in_addr", !9, i64 0}
!17 = !{!13, !15, i64 6}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


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