; LLVM IR from shixiongfei/nio4c :: test (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.niohwaddr_s = type { [6 x i8] }
%struct.niosockaddr_s = type { %struct.sockaddr_storage }
%struct.sockaddr_storage = type { i16, [118 x i8], i64 }
%struct.nioipstr_s = type { [46 x i8], i16 }
%struct.niosocket_s = type { i32 }

@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [12 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 [8 x %struct.niohwaddr_s], align 16
  %7 = alloca %struct.niosockaddr_s, align 8
  %8 = alloca %struct.nioipstr_s, align 2
  %9 = alloca %struct.niosocket_s, align 4
  %10 = alloca %struct.niosocket_s, align 4
  %11 = alloca %struct.niosocket_s, align 4
  %12 = alloca %struct.niosockaddr_s, align 8
  %13 = alloca %struct.niosockaddr_s, align 8
  %14 = alloca %struct.niosockaddr_s, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca [4 x ptr], align 16
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca [16 x i8], align 16
  %25 = alloca ptr, align 8
  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 48, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 128, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 48, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 128, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 128, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 128, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = load ptr, ptr %5, align 8, !tbaa !9
  %28 = call i32 @nio_initialize(ptr noundef null)
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.1)
  %30 = getelementptr inbounds [8 x %struct.niohwaddr_s], ptr %6, i64 0, i64 0
  %31 = call i32 @nio_gethwaddr(ptr noundef %30, i32 noundef 8)
  store i32 %31, ptr %20, align 4, !tbaa !5
  %32 = call ptr @nio_gethostname()
  %33 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %32)
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %59, %2
  %35 = load i32, ptr %21, align 4, !tbaa !5
  %36 = load i32, ptr %20, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %38, label %62

38:                                               ; preds = %34
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %54, %38
  %41 = load i32, ptr %22, align 4, !tbaa !5
  %42 = icmp slt i32 %41, 6
  br i1 %42, label %43, label %57

43:                                               ; preds = %40
  %44 = load i32, ptr %21, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [8 x %struct.niohwaddr_s], ptr %6, i64 0, i64 %45
  %47 = getelementptr inbounds %struct.niohwaddr_s, ptr %46, i32 0, i32 0
  %48 = load i32, ptr %22, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [6 x i8], ptr %47, i64 0, i64 %49
  %51 = load i8, ptr %50, align 1, !tbaa !11
  %52 = zext i8 %51 to i32
  %53 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %52)
  br label %54

54:                                               ; preds = %43
  %55 = load i32, ptr %22, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %22, align 4, !tbaa !5
  br label %40, !llvm.loop !12

57:                                               ; preds = %40
  %58 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %59

59:                                               ; preds = %57
  %60 = load i32, ptr %21, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %21, align 4, !tbaa !5
  br label %34, !llvm.loop !14

62:                                               ; preds = %34
  %63 = call i32 @nio_hostaddr(ptr noundef %7, ptr noundef @.str.6, i16 noundef zeroext 12345)
  %64 = call i32 @nio_ipstr(ptr noundef %8, ptr noundef %7)
  %65 = getelementptr inbounds %struct.nioipstr_s, ptr %8, i32 0, i32 0
  %66 = getelementptr inbounds [46 x i8], ptr %65, i64 0, i64 0
  %67 = getelementptr inbounds %struct.nioipstr_s, ptr %8, i32 0, i32 1
  %68 = load i16, ptr %67, align 2, !tbaa !15
  %69 = zext i16 %68 to i32
  %70 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef %66, i32 noundef %69)
  %71 = call i32 @nio_resolvehost(ptr noundef %12, i32 noundef 1, i32 noundef 2, ptr noundef null, i16 noundef zeroext 13579)
  %72 = call i32 @nio_createtcp4(ptr noundef %9)
  %73 = call i32 @nio_reuseaddr(ptr noundef %9, i32 noundef 1)
  %74 = call i32 @nio_bind(ptr noundef %9, ptr noundef %12)
  %75 = call i32 @nio_listen(ptr noundef %9, i32 noundef 4096)
  %76 = getelementptr inbounds %struct.niosocket_s, ptr %9, i32 0, i32 0
  %77 = load i32, ptr %76, align 4, !tbaa !18
  %78 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %77)
  %79 = call i32 @nio_resolvehost(ptr noundef %13, i32 noundef 1, i32 noundef 2, ptr noundef @.str.9, i16 noundef zeroext 13579)
  %80 = call i32 @nio_createtcp4(ptr noundef %10)
  %81 = call i32 @nio_socketnonblock(ptr noundef %10, i32 noundef 1)
  %82 = call i32 @nio_tcpnodelay(ptr noundef %10, i32 noundef 1)
  %83 = call i32 @nio_connect(ptr noundef %10, ptr noundef %13)
  %84 = getelementptr inbounds %struct.niosocket_s, ptr %10, i32 0, i32 0
  %85 = load i32, ptr %84, align 4, !tbaa !18
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %85)
  %87 = call ptr @nio_selector()
  store ptr %87, ptr %15, align 8, !tbaa !9
  %88 = load ptr, ptr %15, align 8, !tbaa !9
  %89 = call ptr @selector_backend(ptr noundef %88)
  %90 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, ptr noundef %89)
  %91 = load ptr, ptr %15, align 8, !tbaa !9
  %92 = call ptr @selector_register(ptr noundef %91, ptr noundef %9, i32 noundef 1, ptr noundef null)
  store ptr %92, ptr %16, align 8, !tbaa !9
  %93 = load ptr, ptr %15, align 8, !tbaa !9
  %94 = call ptr @selector_register(ptr noundef %93, ptr noundef %10, i32 noundef 3, ptr noundef null)
  store ptr %94, ptr %17, align 8, !tbaa !9
  %95 = load ptr, ptr %16, align 8, !tbaa !9
  %96 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, ptr noundef %95)
  %97 = load ptr, ptr %17, align 8, !tbaa !9
  %98 = call i32 (ptr, ...) @printf(ptr noundef @.str.13, ptr noundef %97)
  br label %99

99:                                               ; preds = %263, %62
  %100 = load ptr, ptr %15, align 8, !tbaa !9
  %101 = call i32 @selector_empty(ptr noundef %100)
  %102 = icmp ne i32 %101, 0
  %103 = xor i1 %102, true
  br i1 %103, label %104, label %264

104:                                              ; preds = %99
  %105 = load ptr, ptr %15, align 8, !tbaa !9
  %106 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 0
  %107 = call i32 @selector_select(ptr noundef %105, ptr noundef %106, i32 noundef 4, i32 noundef 1234567)
  store i32 %107, ptr %20, align 4, !tbaa !5
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %260, %104
  %109 = load i32, ptr %21, align 4, !tbaa !5
  %110 = load i32, ptr %20, align 4, !tbaa !5
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %112, label %263

112:                                              ; preds = %108
  %113 = load i32, ptr %21, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %114
  %116 = load ptr, ptr %115, align 8, !tbaa !9
  %117 = call i32 @monitor_exception(ptr noundef %116)
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %119, label %138

119:                                              ; preds = %112
  %120 = load i32, ptr %21, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %121
  %123 = load ptr, ptr %122, align 8, !tbaa !9
  %124 = call ptr @monitor_io(ptr noundef %123)
  %125 = call i32 @nio_sockipstr(ptr noundef %124, ptr noundef %8)
  %126 = getelementptr inbounds %struct.nioipstr_s, ptr %8, i32 0, i32 0
  %127 = getelementptr inbounds [46 x i8], ptr %126, i64 0, i64 0
  %128 = getelementptr inbounds %struct.nioipstr_s, ptr %8, i32 0, i32 1
  %129 = load i16, ptr %128, align 2, !tbaa !15
  %130 = zext i16 %129 to i32
  %131 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, ptr noundef %127, i32 noundef %130)
  %132 = load i32, ptr %21, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %133
  %135 = load ptr, ptr %134, align 8, !tbaa !9
  %136 = call ptr @monitor_io(ptr noundef %135)
  %137 = call i32 @nio_shutdown(ptr noundef %136, i32 noundef 2)
  br label %138

138:                                              ; preds = %119, %112
  %139 = load i32, ptr %21, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %140
  %142 = load ptr, ptr %141, align 8, !tbaa !9
  %143 = call i32 @monitor_readable(ptr noundef %142)
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %218

145:                                              ; preds = %138
  %146 = load i32, ptr %21, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %147
  %149 = load ptr, ptr %148, align 8, !tbaa !9
  %150 = call ptr @monitor_io(ptr noundef %149)
  %151 = icmp eq ptr %150, %9
  br i1 %151, label %152, label %168

152:                                              ; preds = %145
  %153 = call i32 @nio_accept(ptr noundef %9, ptr noundef %11, ptr noundef %14)
  %154 = load ptr, ptr %15, align 8, !tbaa !9
  %155 = call ptr @selector_register(ptr noundef %154, ptr noundef %11, i32 noundef 1, ptr noundef null)
  store ptr %155, ptr %18, align 8, !tbaa !9
  %156 = call i32 @nio_ipstr(ptr noundef %8, ptr noundef %14)
  %157 = getelementptr inbounds %struct.nioipstr_s, ptr %8, i32 0, i32 0
  %158 = getelementptr inbounds [46 x i8], ptr %157, i64 0, i64 0
  %159 = getelementptr inbounds %struct.nioipstr_s, ptr %8, i32 0, i32 1
  %160 = load i16, ptr %159, align 2, !tbaa !15
  %161 = zext i16 %160 to i32
  %162 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, ptr noundef %158, i32 noundef %161)
  %163 = load i32, ptr %21, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %164
  %166 = load ptr, ptr %165, align 8, !tbaa !9
  %167 = call i32 @monitor_close(ptr noundef %166, i32 noundef 1)
  br label %217

168:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #4
  call void @llvm.memset.p0.i64(ptr align 16 %24, i8 0, i64 16, i1 false)
  %169 = load i32, ptr %21, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %170
  %172 = load ptr, ptr %171, align 8, !tbaa !9
  %173 = call ptr @monitor_io(ptr noundef %172)
  %174 = getelementptr inbounds [16 x i8], ptr %24, i64 0, i64 0
  %175 = call i32 @nio_recv(ptr noundef %173, ptr noundef %174, i32 noundef 16)
  store i32 %175, ptr %23, align 4, !tbaa !5
  %176 = load i32, ptr %21, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %177
  %179 = load ptr, ptr %178, align 8, !tbaa !9
  %180 = call ptr @monitor_io(ptr noundef %179)
  %181 = call i32 @nio_sockipstr(ptr noundef %180, ptr noundef %8)
  %182 = load i32, ptr %23, align 4, !tbaa !5
  %183 = icmp sle i32 %182, 0
  br i1 %183, label %184, label %196

184:                                              ; preds = %168
  %185 = getelementptr inbounds %struct.nioipstr_s, ptr %8, i32 0, i32 0
  %186 = getelementptr inbounds [46 x i8], ptr %185, i64 0, i64 0
  %187 = getelementptr inbounds %struct.nioipstr_s, ptr %8, i32 0, i32 1
  %188 = load i16, ptr %187, align 2, !tbaa !15
  %189 = zext i16 %188 to i32
  %190 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, ptr noundef %186, i32 noundef %189)
  %191 = load i32, ptr %21, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %192
  %194 = load ptr, ptr %193, align 8, !tbaa !9
  %195 = call i32 @monitor_close(ptr noundef %194, i32 noundef 1)
  br label %216

196:                                              ; preds = %168
  %197 = getelementptr inbounds %struct.nioipstr_s, ptr %8, i32 0, i32 0
  %198 = getelementptr inbounds [46 x i8], ptr %197, i64 0, i64 0
  %199 = getelementptr inbounds %struct.nioipstr_s, ptr %8, i32 0, i32 1
  %200 = load i16, ptr %199, align 2, !tbaa !15
  %201 = zext i16 %200 to i32
  %202 = getelementptr inbounds [16 x i8], ptr %24, i64 0, i64 0
  %203 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, ptr noundef %198, i32 noundef %201, ptr noundef %202)
  %204 = load i32, ptr %21, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %205
  %207 = load ptr, ptr %206, align 8, !tbaa !9
  %208 = call ptr @monitor_io(ptr noundef %207)
  %209 = call i32 @nio_send(ptr noundef %208, ptr noundef @.str.18, i32 noundef 7)
  %210 = load i32, ptr %21, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %211
  %213 = load ptr, ptr %212, align 8, !tbaa !9
  %214 = call ptr @monitor_io(ptr noundef %213)
  %215 = call i32 @nio_shutdown(ptr noundef %214, i32 noundef 2)
  br label %216

216:                                              ; preds = %196, %184
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #4
  br label %217

217:                                              ; preds = %216, %152
  br label %218

218:                                              ; preds = %217, %138
  %219 = load i32, ptr %21, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %220
  %222 = load ptr, ptr %221, align 8, !tbaa !9
  %223 = call i32 @monitor_writable(ptr noundef %222)
  %224 = icmp ne i32 %223, 0
  br i1 %224, label %225, label %241

225:                                              ; preds = %218
  %226 = load i32, ptr %21, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %227
  %229 = load ptr, ptr %228, align 8, !tbaa !9
  %230 = call ptr @monitor_io(ptr noundef %229)
  %231 = icmp eq ptr %230, %10
  br i1 %231, label %232, label %240

232:                                              ; preds = %225
  %233 = call i32 (ptr, ...) @printf(ptr noundef @.str.19)
  %234 = call i32 @nio_sendall(ptr noundef %10, ptr noundef @.str.20, i32 noundef 11)
  %235 = load i32, ptr %21, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %236
  %238 = load ptr, ptr %237, align 8, !tbaa !9
  %239 = call i32 @monitor_removeinterest(ptr noundef %238, i32 noundef 2)
  br label %240

240:                                              ; preds = %232, %225
  br label %241

241:                                              ; preds = %240, %218
  %242 = load i32, ptr %21, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %243
  %245 = load ptr, ptr %244, align 8, !tbaa !9
  %246 = call i32 @monitor_closed(ptr noundef %245)
  %247 = icmp ne i32 %246, 0
  br i1 %247, label %248, label %259

248:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %249 = load i32, ptr %21, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %250
  %252 = load ptr, ptr %251, align 8, !tbaa !9
  %253 = call ptr @monitor_io(ptr noundef %252)
  store ptr %253, ptr %25, align 8, !tbaa !9
  %254 = load i32, ptr %21, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [4 x ptr], ptr %19, i64 0, i64 %255
  %257 = load ptr, ptr %256, align 8, !tbaa !9
  call void @monitor_destroy(ptr noundef %257)
  %258 = load ptr, ptr %25, align 8, !tbaa !9
  call void @nio_destroysocket(ptr noundef %258)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  br label %259

259:                                              ; preds = %248, %241
  br label %260

260:                                              ; preds = %259
  %261 = load i32, ptr %21, align 4, !tbaa !5
  %262 = add nsw i32 %261, 1
  store i32 %262, ptr %21, align 4, !tbaa !5
  br label %108, !llvm.loop !20

263:                                              ; preds = %108
  br label %99, !llvm.loop !21

264:                                              ; preds = %99
  %265 = load ptr, ptr %15, align 8, !tbaa !9
  call void @selector_destroy(ptr noundef %265)
  call void @nio_finalize()
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #4
  ret i32 0
}

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

declare i32 @nio_initialize(ptr noundef) #2

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

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

declare ptr @nio_gethostname() #2

declare i32 @nio_hostaddr(ptr noundef, ptr noundef, i16 noundef zeroext) #2

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

declare i32 @nio_resolvehost(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i16 noundef zeroext) #2

declare i32 @nio_createtcp4(ptr noundef) #2

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

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

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

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

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

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

declare ptr @nio_selector() #2

declare ptr @selector_backend(ptr noundef) #2

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

declare i32 @selector_empty(ptr noundef) #2

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

declare i32 @monitor_exception(ptr noundef) #2

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

declare ptr @monitor_io(ptr noundef) #2

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

declare i32 @monitor_readable(ptr noundef) #2

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

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

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

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

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

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

declare i32 @monitor_writable(ptr noundef) #2

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

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

declare i32 @monitor_closed(ptr noundef) #2

declare void @monitor_destroy(ptr noundef) #2

declare void @nio_destroysocket(ptr noundef) #2

declare void @selector_destroy(ptr noundef) #2

declare void @nio_finalize() #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !17, i64 46}
!16 = !{!"nioipstr_s", !7, i64 0, !17, i64 46}
!17 = !{!"short", !7, i64 0}
!18 = !{!19, !6, i64 0}
!19 = !{!"niosocket_s", !6, i64 0}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}


; 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.niohwaddr_s = type { [6 x i8] }
%struct.niosockaddr_s = type { %struct.sockaddr_storage }
%struct.sockaddr_storage = type { i16, [118 x i8], i64 }
%struct.nioipstr_s = type { [46 x i8], i16 }
%struct.niosocket_s = type { i32 }

@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca [8 x %struct.niohwaddr_s], align 16
  %4 = alloca %struct.niosockaddr_s, align 8
  %5 = alloca %struct.nioipstr_s, align 2
  %6 = alloca %struct.niosocket_s, align 4
  %7 = alloca %struct.niosocket_s, align 4
  %8 = alloca %struct.niosocket_s, align 4
  %9 = alloca %struct.niosockaddr_s, align 8
  %10 = alloca %struct.niosockaddr_s, align 8
  %11 = alloca %struct.niosockaddr_s, align 8
  %12 = alloca [4 x ptr], align 16
  %13 = alloca [16 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #5
  %14 = tail call i32 @nio_initialize(ptr noundef null) #5
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.1)
  %16 = call i32 @nio_gethwaddr(ptr noundef nonnull %3, i32 noundef 8) #5
  %17 = call ptr @nio_gethostname() #5
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %17)
  %19 = icmp sgt i32 %16, 0
  br i1 %19, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %2
  %wide.trip.count = zext nneg i32 %16 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %21 = getelementptr inbounds [8 x %struct.niohwaddr_s], ptr %3, i64 0, i64 %indvars.iv
  %22 = load i8, ptr %21, align 2, !tbaa !5
  %23 = zext i8 %22 to i32
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %23)
  %25 = getelementptr inbounds i8, ptr %21, i64 1
  %26 = load i8, ptr %25, align 1, !tbaa !5
  %27 = zext i8 %26 to i32
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %27)
  %29 = getelementptr inbounds i8, ptr %21, i64 2
  %30 = load i8, ptr %29, align 2, !tbaa !5
  %31 = zext i8 %30 to i32
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %31)
  %33 = getelementptr inbounds i8, ptr %21, i64 3
  %34 = load i8, ptr %33, align 1, !tbaa !5
  %35 = zext i8 %34 to i32
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %35)
  %37 = getelementptr inbounds i8, ptr %21, i64 4
  %38 = load i8, ptr %37, align 2, !tbaa !5
  %39 = zext i8 %38 to i32
  %40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %39)
  %41 = getelementptr inbounds i8, ptr %21, i64 5
  %42 = load i8, ptr %41, align 1, !tbaa !5
  %43 = zext i8 %42 to i32
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %43)
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !8

._crit_edge:                                      ; preds = %.lr.ph, %2
  %46 = call i32 @nio_hostaddr(ptr noundef nonnull %4, ptr noundef nonnull @.str.6, i16 noundef zeroext 12345) #5
  %47 = call i32 @nio_ipstr(ptr noundef nonnull %5, ptr noundef nonnull %4) #5
  %48 = getelementptr inbounds i8, ptr %5, i64 46
  %49 = load i16, ptr %48, align 2, !tbaa !10
  %50 = zext i16 %49 to i32
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull %5, i32 noundef %50)
  %52 = call i32 @nio_resolvehost(ptr noundef nonnull %9, i32 noundef 1, i32 noundef 2, ptr noundef null, i16 noundef zeroext 13579) #5
  %53 = call i32 @nio_createtcp4(ptr noundef nonnull %6) #5
  %54 = call i32 @nio_reuseaddr(ptr noundef nonnull %6, i32 noundef 1) #5
  %55 = call i32 @nio_bind(ptr noundef nonnull %6, ptr noundef nonnull %9) #5
  %56 = call i32 @nio_listen(ptr noundef nonnull %6, i32 noundef 4096) #5
  %57 = load i32, ptr %6, align 4, !tbaa !13
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %57)
  %59 = call i32 @nio_resolvehost(ptr noundef nonnull %10, i32 noundef 1, i32 noundef 2, ptr noundef nonnull @.str.9, i16 noundef zeroext 13579) #5
  %60 = call i32 @nio_createtcp4(ptr noundef nonnull %7) #5
  %61 = call i32 @nio_socketnonblock(ptr noundef nonnull %7, i32 noundef 1) #5
  %62 = call i32 @nio_tcpnodelay(ptr noundef nonnull %7, i32 noundef 1) #5
  %63 = call i32 @nio_connect(ptr noundef nonnull %7, ptr noundef nonnull %10) #5
  %64 = load i32, ptr %7, align 4, !tbaa !13
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %64)
  %66 = call ptr @nio_selector() #5
  %67 = call ptr @selector_backend(ptr noundef %66) #5
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, ptr noundef %67)
  %69 = call ptr @selector_register(ptr noundef %66, ptr noundef nonnull %6, i32 noundef 1, ptr noundef null) #5
  %70 = call ptr @selector_register(ptr noundef %66, ptr noundef nonnull %7, i32 noundef 3, ptr noundef null) #5
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef %69)
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, ptr noundef %70)
  %73 = call i32 @selector_empty(ptr noundef %66) #5
  %.not51 = icmp eq i32 %73, 0
  br i1 %.not51, label %.lr.ph53, label %._crit_edge54

.loopexit:                                        ; preds = %148, %.lr.ph53
  %74 = call i32 @selector_empty(ptr noundef %66) #5
  %.not = icmp eq i32 %74, 0
  br i1 %.not, label %.lr.ph53, label %._crit_edge54, !llvm.loop !16

.lr.ph53:                                         ; preds = %._crit_edge, %.loopexit
  %75 = call i32 @selector_select(ptr noundef %66, ptr noundef nonnull %12, i32 noundef 4, i32 noundef 1234567) #5
  %76 = icmp sgt i32 %75, 0
  br i1 %76, label %.lr.ph50.preheader, label %.loopexit

.lr.ph50.preheader:                               ; preds = %.lr.ph53
  %wide.trip.count60 = zext nneg i32 %75 to i64
  br label %.lr.ph50

.lr.ph50:                                         ; preds = %.lr.ph50.preheader, %148
  %indvars.iv57 = phi i64 [ 0, %.lr.ph50.preheader ], [ %indvars.iv.next58, %148 ]
  %77 = getelementptr inbounds [4 x ptr], ptr %12, i64 0, i64 %indvars.iv57
  %78 = load ptr, ptr %77, align 8, !tbaa !17
  %79 = call i32 @monitor_exception(ptr noundef %78) #5
  %.not42 = icmp eq i32 %79, 0
  br i1 %.not42, label %90, label %80

80:                                               ; preds = %.lr.ph50
  %81 = load ptr, ptr %77, align 8, !tbaa !17
  %82 = call ptr @monitor_io(ptr noundef %81) #5
  %83 = call i32 @nio_sockipstr(ptr noundef %82, ptr noundef nonnull %5) #5
  %84 = load i16, ptr %48, align 2, !tbaa !10
  %85 = zext i16 %84 to i32
  %86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, ptr noundef nonnull %5, i32 noundef %85)
  %87 = load ptr, ptr %77, align 8, !tbaa !17
  %88 = call ptr @monitor_io(ptr noundef %87) #5
  %89 = call i32 @nio_shutdown(ptr noundef %88, i32 noundef 2) #5
  br label %90

90:                                               ; preds = %80, %.lr.ph50
  %91 = load ptr, ptr %77, align 8, !tbaa !17
  %92 = call i32 @monitor_readable(ptr noundef %91) #5
  %.not43 = icmp eq i32 %92, 0
  br i1 %.not43, label %129, label %93

93:                                               ; preds = %90
  %94 = load ptr, ptr %77, align 8, !tbaa !17
  %95 = call ptr @monitor_io(ptr noundef %94) #5
  %96 = icmp eq ptr %95, %6
  br i1 %96, label %97, label %106

97:                                               ; preds = %93
  %98 = call i32 @nio_accept(ptr noundef nonnull %6, ptr noundef nonnull %8, ptr noundef nonnull %11) #5
  %99 = call ptr @selector_register(ptr noundef %66, ptr noundef nonnull %8, i32 noundef 1, ptr noundef null) #5
  %100 = call i32 @nio_ipstr(ptr noundef nonnull %5, ptr noundef nonnull %11) #5
  %101 = load i16, ptr %48, align 2, !tbaa !10
  %102 = zext i16 %101 to i32
  %103 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, ptr noundef nonnull %5, i32 noundef %102)
  %104 = load ptr, ptr %77, align 8, !tbaa !17
  %105 = call i32 @monitor_close(ptr noundef %104, i32 noundef 1) #5
  br label %129

106:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %13, i8 0, i64 16, i1 false)
  %107 = load ptr, ptr %77, align 8, !tbaa !17
  %108 = call ptr @monitor_io(ptr noundef %107) #5
  %109 = call i32 @nio_recv(ptr noundef %108, ptr noundef nonnull %13, i32 noundef 16) #5
  %110 = load ptr, ptr %77, align 8, !tbaa !17
  %111 = call ptr @monitor_io(ptr noundef %110) #5
  %112 = call i32 @nio_sockipstr(ptr noundef %111, ptr noundef nonnull %5) #5
  %113 = icmp slt i32 %109, 1
  %114 = load i16, ptr %48, align 2, !tbaa !10
  %115 = zext i16 %114 to i32
  br i1 %113, label %116, label %120

116:                                              ; preds = %106
  %117 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef nonnull %5, i32 noundef %115)
  %118 = load ptr, ptr %77, align 8, !tbaa !17
  %119 = call i32 @monitor_close(ptr noundef %118, i32 noundef 1) #5
  br label %128

120:                                              ; preds = %106
  %121 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef nonnull %5, i32 noundef %115, ptr noundef nonnull %13)
  %122 = load ptr, ptr %77, align 8, !tbaa !17
  %123 = call ptr @monitor_io(ptr noundef %122) #5
  %124 = call i32 @nio_send(ptr noundef %123, ptr noundef nonnull @.str.18, i32 noundef 7) #5
  %125 = load ptr, ptr %77, align 8, !tbaa !17
  %126 = call ptr @monitor_io(ptr noundef %125) #5
  %127 = call i32 @nio_shutdown(ptr noundef %126, i32 noundef 2) #5
  br label %128

128:                                              ; preds = %120, %116
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #5
  br label %129

129:                                              ; preds = %97, %128, %90
  %130 = load ptr, ptr %77, align 8, !tbaa !17
  %131 = call i32 @monitor_writable(ptr noundef %130) #5
  %.not44 = icmp eq i32 %131, 0
  br i1 %.not44, label %141, label %132

132:                                              ; preds = %129
  %133 = load ptr, ptr %77, align 8, !tbaa !17
  %134 = call ptr @monitor_io(ptr noundef %133) #5
  %135 = icmp eq ptr %134, %7
  br i1 %135, label %136, label %141

136:                                              ; preds = %132
  %137 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19)
  %138 = call i32 @nio_sendall(ptr noundef nonnull %7, ptr noundef nonnull @.str.20, i32 noundef 11) #5
  %139 = load ptr, ptr %77, align 8, !tbaa !17
  %140 = call i32 @monitor_removeinterest(ptr noundef %139, i32 noundef 2) #5
  br label %141

141:                                              ; preds = %132, %136, %129
  %142 = load ptr, ptr %77, align 8, !tbaa !17
  %143 = call i32 @monitor_closed(ptr noundef %142) #5
  %.not45 = icmp eq i32 %143, 0
  br i1 %.not45, label %148, label %144

144:                                              ; preds = %141
  %145 = load ptr, ptr %77, align 8, !tbaa !17
  %146 = call ptr @monitor_io(ptr noundef %145) #5
  %147 = load ptr, ptr %77, align 8, !tbaa !17
  call void @monitor_destroy(ptr noundef %147) #5
  call void @nio_destroysocket(ptr noundef %146) #5
  br label %148

148:                                              ; preds = %141, %144
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count60
  br i1 %exitcond61.not, label %.loopexit, label %.lr.ph50, !llvm.loop !19

._crit_edge54:                                    ; preds = %.loopexit, %._crit_edge
  call void @selector_destroy(ptr noundef %66) #5
  call void @nio_finalize() #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #5
  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

declare i32 @nio_initialize(ptr noundef) local_unnamed_addr #2

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

declare i32 @nio_gethwaddr(ptr noundef, i32 noundef) local_unnamed_addr #2

declare ptr @nio_gethostname() local_unnamed_addr #2

declare i32 @nio_hostaddr(ptr noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #2

declare i32 @nio_ipstr(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @nio_resolvehost(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #2

declare i32 @nio_createtcp4(ptr noundef) local_unnamed_addr #2

declare i32 @nio_reuseaddr(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @nio_bind(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @nio_listen(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @nio_socketnonblock(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @nio_tcpnodelay(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @nio_connect(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @nio_selector() local_unnamed_addr #2

declare ptr @selector_backend(ptr noundef) local_unnamed_addr #2

declare ptr @selector_register(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare i32 @selector_empty(ptr noundef) local_unnamed_addr #2

declare i32 @selector_select(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare i32 @monitor_exception(ptr noundef) local_unnamed_addr #2

declare i32 @nio_sockipstr(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @monitor_io(ptr noundef) local_unnamed_addr #2

declare i32 @nio_shutdown(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @monitor_readable(ptr noundef) local_unnamed_addr #2

declare i32 @nio_accept(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @monitor_close(ptr noundef, i32 noundef) 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) #4

declare i32 @nio_recv(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @nio_send(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

declare i32 @monitor_writable(ptr noundef) local_unnamed_addr #2

declare i32 @nio_sendall(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @monitor_removeinterest(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @monitor_closed(ptr noundef) local_unnamed_addr #2

declare void @monitor_destroy(ptr noundef) local_unnamed_addr #2

declare void @nio_destroysocket(ptr noundef) local_unnamed_addr #2

declare void @selector_destroy(ptr noundef) local_unnamed_addr #2

declare void @nio_finalize() local_unnamed_addr #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 = { mustprogress 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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !12, i64 46}
!11 = !{!"nioipstr_s", !6, i64 0, !12, i64 46}
!12 = !{!"short", !6, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"niosocket_s", !15, i64 0}
!15 = !{!"int", !6, i64 0}
!16 = distinct !{!16, !9}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !6, i64 0}
!19 = distinct !{!19, !9}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass