; LLVM IR from jingweizhanghuai/Morn :: src/wrap (morn_socket)

; 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.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }
%struct.timeval = type { i64, i64 }
%struct.fd_set = type { [16 x i64] }
%struct.ClientInfo = type { i32, i32, i32, i32, [32 x i8], ptr }
%struct.MHandle = type { i32, i32, ptr, ptr }
%struct.HandleTCPServer = type { i32, i32, i32, i32, [32 x i8], ptr, ptr }
%struct.MList = type { i32, ptr }

@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [7 x i8], align 1
@__FUNCTION__.TCPServerInit = external hidden unnamed_addr constant [14 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [40 x i8], align 1

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

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

declare i32 @close(i32 noundef) #1

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #2

declare ptr @GetHandle(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #1

declare ptr @mMornObject(ptr noundef, i32 noundef) #1

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

declare void @m_PropertyFunction(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare void @mornObjectRemove(ptr noundef, ptr noundef) #1

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

declare void @m_Free(ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @__bswap_32(i32 noundef) #3

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

declare ptr @m_Malloc(i32 noundef) #1

declare ptr @ListCreate(i32 noundef, ptr noundef) #1

declare void @mListElementDelete(ptr noundef, i32 noundef) #1

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

declare ptr @mListWrite(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #1

declare i64 @recv(i32 noundef, ptr noundef, i64 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @endTCPServer(ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local ptr @TCPServerInit(i32 noundef %0) #4 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca [16 x i8], align 16
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.sockaddr_in, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %struct.timeval, align 8
  %12 = alloca %struct.fd_set, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %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 i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca %struct.ClientInfo, align 8
  %25 = alloca %struct.sockaddr_in, align 4
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #6
  %28 = getelementptr inbounds [16 x i8], ptr %4, i64 0, i64 0
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %28, ptr noundef @.str.20, i32 noundef %29) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %31 = getelementptr inbounds [16 x i8], ptr %4, i64 0, i64 0
  %32 = call ptr @mMornObject(ptr noundef %31, i32 noundef -1)
  %33 = call ptr @GetHandle(ptr noundef %32, i32 noundef 64, i32 noundef 1873781879, ptr noundef @endTCPServer)
  store ptr %33, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct.MHandle, ptr %34, i32 0, i32 3
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  store ptr %36, ptr %6, align 8, !tbaa !9
  %37 = load ptr, ptr %5, align 8, !tbaa !9
  %38 = getelementptr inbounds %struct.MHandle, ptr %37, i32 0, i32 1
  %39 = load volatile i32, ptr %38, align 4, !tbaa !13
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %116

41:                                               ; preds = %1
  %42 = call i32 @socket(i32 noundef 2, i32 noundef 1, i32 noundef 6) #6
  %43 = load ptr, ptr %6, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.HandleTCPServer, ptr %43, i32 0, i32 0
  store i32 %42, ptr %44, align 8, !tbaa !14
  br label %45

45:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %46 = load ptr, ptr %6, align 8, !tbaa !9
  %47 = getelementptr inbounds %struct.HandleTCPServer, ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !14
  %49 = icmp slt i32 %48, 0
  %50 = zext i1 %49 to i32
  store i32 %50, ptr %7, align 4, !tbaa !5
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %55

53:                                               ; preds = %45
  %54 = load i32, ptr %7, align 4, !tbaa !5
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %54, i32 noundef -1, ptr noundef @.str.2, i32 noundef 509, ptr noundef @__FUNCTION__.TCPServerInit, ptr noundef @.str.21)
  br label %55

55:                                               ; preds = %53, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = load ptr, ptr %6, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.HandleTCPServer, ptr %59, i32 0, i32 3
  store i32 %58, ptr %60, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #6
  %61 = getelementptr inbounds %struct.sockaddr_in, ptr %8, i32 0, i32 0
  store i16 2, ptr %61, align 4, !tbaa !17
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = trunc i32 %62 to i16
  %64 = call zeroext i16 @__bswap_16(i16 noundef zeroext %63)
  %65 = getelementptr inbounds %struct.sockaddr_in, ptr %8, i32 0, i32 1
  store i16 %64, ptr %65, align 2, !tbaa !21
  %66 = call i32 @__bswap_32(i32 noundef 0)
  %67 = getelementptr inbounds %struct.sockaddr_in, ptr %8, i32 0, i32 2
  %68 = getelementptr inbounds %struct.in_addr, ptr %67, i32 0, i32 0
  store i32 %66, ptr %68, align 4, !tbaa !22
  br label %69

69:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %70 = load ptr, ptr %6, align 8, !tbaa !9
  %71 = getelementptr inbounds %struct.HandleTCPServer, ptr %70, i32 0, i32 0
  %72 = load i32, ptr %71, align 8, !tbaa !14
  %73 = call i32 @bind(i32 noundef %72, ptr noundef %8, i32 noundef 16) #6
  %74 = icmp slt i32 %73, 0
  %75 = zext i1 %74 to i32
  store i32 %75, ptr %9, align 4, !tbaa !5
  %76 = load i32, ptr %9, align 4, !tbaa !5
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %80

78:                                               ; preds = %69
  %79 = load i32, ptr %9, align 4, !tbaa !5
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %79, i32 noundef -1, ptr noundef @.str.2, i32 noundef 516, ptr noundef @__FUNCTION__.TCPServerInit, ptr noundef @.str.21)
  br label %80

80:                                               ; preds = %78, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %81

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %6, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.HandleTCPServer, ptr %83, i32 0, i32 6
  %85 = load ptr, ptr %84, align 8, !tbaa !23
  %86 = icmp eq ptr %85, null
  br i1 %86, label %87, label %91

87:                                               ; preds = %82
  %88 = call ptr @m_Malloc(i32 noundef 65536)
  %89 = load ptr, ptr %6, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.HandleTCPServer, ptr %89, i32 0, i32 6
  store ptr %88, ptr %90, align 8, !tbaa !23
  br label %91

91:                                               ; preds = %87, %82
  %92 = load ptr, ptr %6, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct.HandleTCPServer, ptr %92, i32 0, i32 5
  %94 = load ptr, ptr %93, align 8, !tbaa !24
  %95 = icmp eq ptr %94, null
  br i1 %95, label %96, label %100

96:                                               ; preds = %91
  %97 = call ptr @ListCreate(i32 noundef -1, ptr noundef null)
  %98 = load ptr, ptr %6, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct.HandleTCPServer, ptr %98, i32 0, i32 5
  store ptr %97, ptr %99, align 8, !tbaa !24
  br label %100

100:                                              ; preds = %96, %91
  %101 = load ptr, ptr %6, align 8, !tbaa !9
  %102 = getelementptr inbounds %struct.HandleTCPServer, ptr %101, i32 0, i32 5
  %103 = load ptr, ptr %102, align 8, !tbaa !24
  call void @mListClear(ptr noundef %103)
  br label %104

104:                                              ; preds = %100
  %105 = getelementptr inbounds [16 x i8], ptr %4, i64 0, i64 0
  %106 = call ptr @mMornObject(ptr noundef %105, i32 noundef -1)
  %107 = getelementptr inbounds [16 x i8], ptr %4, i64 0, i64 0
  call void @m_PropertyFunction(ptr noundef %106, ptr noundef @.str.7, ptr noundef @mornObjectRemove, ptr noundef %107)
  br label %108

108:                                              ; preds = %104
  br label %109

109:                                              ; preds = %108
  %110 = load ptr, ptr %6, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct.HandleTCPServer, ptr %110, i32 0, i32 0
  %112 = load i32, ptr %111, align 8, !tbaa !14
  %113 = call i32 @listen(i32 noundef %112, i32 noundef 10) #6
  %114 = load ptr, ptr %5, align 8, !tbaa !9
  %115 = getelementptr inbounds %struct.MHandle, ptr %114, i32 0, i32 1
  store volatile i32 1, ptr %115, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  br label %116

116:                                              ; preds = %109, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %117 = load ptr, ptr %6, align 8, !tbaa !9
  %118 = getelementptr inbounds %struct.HandleTCPServer, ptr %117, i32 0, i32 5
  %119 = load ptr, ptr %118, align 8, !tbaa !24
  store ptr %119, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #6
  call void @llvm.memset.p0.i64(ptr align 8 %11, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 128, ptr %12) #6
  br label %120

120:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store ptr %12, ptr %14, align 8, !tbaa !9
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %131, %120
  %122 = load i32, ptr %13, align 4, !tbaa !5
  %123 = zext i32 %122 to i64
  %124 = icmp ult i64 %123, 16
  br i1 %124, label %125, label %134

125:                                              ; preds = %121
  %126 = load ptr, ptr %14, align 8, !tbaa !9
  %127 = getelementptr inbounds %struct.fd_set, ptr %126, i32 0, i32 0
  %128 = load i32, ptr %13, align 4, !tbaa !5
  %129 = zext i32 %128 to i64
  %130 = getelementptr inbounds [16 x i64], ptr %127, i64 0, i64 %129
  store i64 0, ptr %130, align 8, !tbaa !25
  br label %131

131:                                              ; preds = %125
  %132 = load i32, ptr %13, align 4, !tbaa !5
  %133 = add i32 %132, 1
  store i32 %133, ptr %13, align 4, !tbaa !5
  br label %121, !llvm.loop !27

134:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %135

135:                                              ; preds = %134
  br label %136

136:                                              ; preds = %135
  %137 = load ptr, ptr %6, align 8, !tbaa !9
  %138 = getelementptr inbounds %struct.HandleTCPServer, ptr %137, i32 0, i32 0
  %139 = load i32, ptr %138, align 8, !tbaa !14
  %140 = srem i32 %139, 64
  %141 = zext i32 %140 to i64
  %142 = shl i64 1, %141
  %143 = getelementptr inbounds %struct.fd_set, ptr %12, i32 0, i32 0
  %144 = load ptr, ptr %6, align 8, !tbaa !9
  %145 = getelementptr inbounds %struct.HandleTCPServer, ptr %144, i32 0, i32 0
  %146 = load i32, ptr %145, align 8, !tbaa !14
  %147 = sdiv i32 %146, 64
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [16 x i64], ptr %143, i64 0, i64 %148
  %150 = load i64, ptr %149, align 8, !tbaa !25
  %151 = or i64 %150, %142
  store i64 %151, ptr %149, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %152 = load ptr, ptr %6, align 8, !tbaa !9
  %153 = getelementptr inbounds %struct.HandleTCPServer, ptr %152, i32 0, i32 0
  %154 = load i32, ptr %153, align 8, !tbaa !14
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %201, %136
  %157 = load i32, ptr %16, align 4, !tbaa !5
  %158 = load ptr, ptr %10, align 8, !tbaa !9
  %159 = getelementptr inbounds %struct.MList, ptr %158, i32 0, i32 0
  %160 = load i32, ptr %159, align 8, !tbaa !29
  %161 = icmp slt i32 %157, %160
  br i1 %161, label %163, label %162

162:                                              ; preds = %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %204

163:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %164 = load ptr, ptr %10, align 8, !tbaa !9
  %165 = getelementptr inbounds %struct.MList, ptr %164, i32 0, i32 1
  %166 = load ptr, ptr %165, align 8, !tbaa !31
  %167 = load i32, ptr %16, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds ptr, ptr %166, i64 %168
  %170 = load ptr, ptr %169, align 8, !tbaa !9
  store ptr %170, ptr %17, align 8, !tbaa !9
  %171 = load ptr, ptr %17, align 8, !tbaa !9
  %172 = getelementptr inbounds %struct.ClientInfo, ptr %171, i32 0, i32 0
  %173 = load i32, ptr %172, align 8, !tbaa !32
  %174 = srem i32 %173, 64
  %175 = zext i32 %174 to i64
  %176 = shl i64 1, %175
  %177 = getelementptr inbounds %struct.fd_set, ptr %12, i32 0, i32 0
  %178 = load ptr, ptr %17, align 8, !tbaa !9
  %179 = getelementptr inbounds %struct.ClientInfo, ptr %178, i32 0, i32 0
  %180 = load i32, ptr %179, align 8, !tbaa !32
  %181 = sdiv i32 %180, 64
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [16 x i64], ptr %177, i64 0, i64 %182
  %184 = load i64, ptr %183, align 8, !tbaa !25
  %185 = or i64 %184, %176
  store i64 %185, ptr %183, align 8, !tbaa !25
  %186 = load i32, ptr %15, align 4, !tbaa !5
  %187 = load ptr, ptr %17, align 8, !tbaa !9
  %188 = getelementptr inbounds %struct.ClientInfo, ptr %187, i32 0, i32 0
  %189 = load i32, ptr %188, align 8, !tbaa !32
  %190 = add nsw i32 %189, 1
  %191 = icmp sgt i32 %186, %190
  br i1 %191, label %192, label %194

192:                                              ; preds = %163
  %193 = load i32, ptr %15, align 4, !tbaa !5
  br label %199

194:                                              ; preds = %163
  %195 = load ptr, ptr %17, align 8, !tbaa !9
  %196 = getelementptr inbounds %struct.ClientInfo, ptr %195, i32 0, i32 0
  %197 = load i32, ptr %196, align 8, !tbaa !32
  %198 = add nsw i32 %197, 1
  br label %199

199:                                              ; preds = %194, %192
  %200 = phi i32 [ %193, %192 ], [ %198, %194 ]
  store i32 %200, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %201

201:                                              ; preds = %199
  %202 = load i32, ptr %16, align 4, !tbaa !5
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %16, align 4, !tbaa !5
  br label %156, !llvm.loop !34

204:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %205 = load i32, ptr %15, align 4, !tbaa !5
  %206 = call i32 @select(i32 noundef %205, ptr noundef %12, ptr noundef null, ptr noundef null, ptr noundef %11)
  store i32 %206, ptr %18, align 4, !tbaa !5
  %207 = load i32, ptr %18, align 4, !tbaa !5
  %208 = icmp eq i32 %207, 0
  br i1 %208, label %209, label %211

209:                                              ; preds = %204
  %210 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr %210, ptr %2, align 8
  store i32 1, ptr %19, align 4
  br label %388

211:                                              ; preds = %204
  br label %212

212:                                              ; preds = %211
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %213 = load i32, ptr %18, align 4, !tbaa !5
  %214 = icmp eq i32 %213, -1
  %215 = zext i1 %214 to i32
  store i32 %215, ptr %20, align 4, !tbaa !5
  %216 = load i32, ptr %20, align 4, !tbaa !5
  %217 = icmp ne i32 %216, 0
  br i1 %217, label %218, label %220

218:                                              ; preds = %212
  %219 = load i32, ptr %20, align 4, !tbaa !5
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %219, i32 noundef -1, ptr noundef @.str.2, i32 noundef 552, ptr noundef @__FUNCTION__.TCPServerInit, ptr noundef @.str.21)
  br label %220

220:                                              ; preds = %218, %212
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %221

221:                                              ; preds = %220
  br label %222

222:                                              ; preds = %221
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %223

223:                                              ; preds = %319, %222
  %224 = load i32, ptr %21, align 4, !tbaa !5
  %225 = load ptr, ptr %10, align 8, !tbaa !9
  %226 = getelementptr inbounds %struct.MList, ptr %225, i32 0, i32 0
  %227 = load i32, ptr %226, align 8, !tbaa !29
  %228 = icmp slt i32 %224, %227
  br i1 %228, label %230, label %229

229:                                              ; preds = %223
  store i32 18, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %322

230:                                              ; preds = %223
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %231 = load ptr, ptr %10, align 8, !tbaa !9
  %232 = getelementptr inbounds %struct.MList, ptr %231, i32 0, i32 1
  %233 = load ptr, ptr %232, align 8, !tbaa !31
  %234 = load i32, ptr %21, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds ptr, ptr %233, i64 %235
  %237 = load ptr, ptr %236, align 8, !tbaa !9
  store ptr %237, ptr %22, align 8, !tbaa !9
  %238 = getelementptr inbounds %struct.fd_set, ptr %12, i32 0, i32 0
  %239 = load ptr, ptr %22, align 8, !tbaa !9
  %240 = getelementptr inbounds %struct.ClientInfo, ptr %239, i32 0, i32 0
  %241 = load i32, ptr %240, align 8, !tbaa !32
  %242 = sdiv i32 %241, 64
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [16 x i64], ptr %238, i64 0, i64 %243
  %245 = load i64, ptr %244, align 8, !tbaa !25
  %246 = load ptr, ptr %22, align 8, !tbaa !9
  %247 = getelementptr inbounds %struct.ClientInfo, ptr %246, i32 0, i32 0
  %248 = load i32, ptr %247, align 8, !tbaa !32
  %249 = srem i32 %248, 64
  %250 = zext i32 %249 to i64
  %251 = shl i64 1, %250
  %252 = and i64 %245, %251
  %253 = icmp ne i64 %252, 0
  br i1 %253, label %255, label %254

254:                                              ; preds = %230
  store i32 20, ptr %19, align 4
  br label %316

255:                                              ; preds = %230
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %256 = load ptr, ptr %22, align 8, !tbaa !9
  %257 = getelementptr inbounds %struct.ClientInfo, ptr %256, i32 0, i32 0
  %258 = load i32, ptr %257, align 8, !tbaa !32
  %259 = load ptr, ptr %22, align 8, !tbaa !9
  %260 = getelementptr inbounds %struct.ClientInfo, ptr %259, i32 0, i32 5
  %261 = load ptr, ptr %260, align 8, !tbaa !35
  %262 = call i64 @recv(i32 noundef %258, ptr noundef %261, i64 noundef 65536, i32 noundef 0)
  %263 = trunc i64 %262 to i32
  store i32 %263, ptr %23, align 4, !tbaa !5
  %264 = load i32, ptr %23, align 4, !tbaa !5
  %265 = icmp sle i32 %264, 0
  br i1 %265, label %266, label %298

266:                                              ; preds = %255
  %267 = load ptr, ptr %22, align 8, !tbaa !9
  %268 = getelementptr inbounds %struct.ClientInfo, ptr %267, i32 0, i32 0
  %269 = load i32, ptr %268, align 8, !tbaa !32
  %270 = srem i32 %269, 64
  %271 = zext i32 %270 to i64
  %272 = shl i64 1, %271
  %273 = xor i64 %272, -1
  %274 = getelementptr inbounds %struct.fd_set, ptr %12, i32 0, i32 0
  %275 = load ptr, ptr %22, align 8, !tbaa !9
  %276 = getelementptr inbounds %struct.ClientInfo, ptr %275, i32 0, i32 0
  %277 = load i32, ptr %276, align 8, !tbaa !32
  %278 = sdiv i32 %277, 64
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [16 x i64], ptr %274, i64 0, i64 %279
  %281 = load i64, ptr %280, align 8, !tbaa !25
  %282 = and i64 %281, %273
  store i64 %282, ptr %280, align 8, !tbaa !25
  %283 = load ptr, ptr %22, align 8, !tbaa !9
  %284 = getelementptr inbounds %struct.ClientInfo, ptr %283, i32 0, i32 0
  %285 = load i32, ptr %284, align 8, !tbaa !32
  %286 = call i32 @close(i32 noundef %285)
  %287 = load ptr, ptr %22, align 8, !tbaa !9
  %288 = getelementptr inbounds %struct.ClientInfo, ptr %287, i32 0, i32 2
  store i32 -1, ptr %288, align 8, !tbaa !36
  %289 = load ptr, ptr %22, align 8, !tbaa !9
  %290 = getelementptr inbounds %struct.ClientInfo, ptr %289, i32 0, i32 3
  store i32 0, ptr %290, align 4, !tbaa !37
  %291 = load ptr, ptr %22, align 8, !tbaa !9
  %292 = getelementptr inbounds %struct.ClientInfo, ptr %291, i32 0, i32 5
  %293 = load ptr, ptr %292, align 8, !tbaa !35
  call void @m_Free(ptr noundef %293)
  %294 = load ptr, ptr %10, align 8, !tbaa !9
  %295 = load i32, ptr %21, align 4, !tbaa !5
  call void @mListElementDelete(ptr noundef %294, i32 noundef %295)
  %296 = load i32, ptr %21, align 4, !tbaa !5
  %297 = add nsw i32 %296, -1
  store i32 %297, ptr %21, align 4, !tbaa !5
  store i32 20, ptr %19, align 4
  br label %315

298:                                              ; preds = %255
  %299 = load i32, ptr %23, align 4, !tbaa !5
  %300 = icmp slt i32 %299, 65536
  br i1 %300, label %301, label %308

301:                                              ; preds = %298
  %302 = load ptr, ptr %22, align 8, !tbaa !9
  %303 = getelementptr inbounds %struct.ClientInfo, ptr %302, i32 0, i32 5
  %304 = load ptr, ptr %303, align 8, !tbaa !35
  %305 = load i32, ptr %23, align 4, !tbaa !5
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds i8, ptr %304, i64 %306
  store i8 0, ptr %307, align 1, !tbaa !38
  br label %308

308:                                              ; preds = %301, %298
  br label %309

309:                                              ; preds = %308
  %310 = load i32, ptr %23, align 4, !tbaa !5
  %311 = load ptr, ptr %22, align 8, !tbaa !9
  %312 = getelementptr inbounds %struct.ClientInfo, ptr %311, i32 0, i32 3
  store i32 %310, ptr %312, align 4, !tbaa !37
  %313 = load ptr, ptr %22, align 8, !tbaa !9
  %314 = getelementptr inbounds %struct.ClientInfo, ptr %313, i32 0, i32 2
  store i32 1, ptr %314, align 8, !tbaa !36
  store i32 0, ptr %19, align 4
  br label %315

315:                                              ; preds = %309, %266
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %316

316:                                              ; preds = %315, %254
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  %317 = load i32, ptr %19, align 4
  switch i32 %317, label %390 [
    i32 0, label %318
    i32 20, label %319
  ]

318:                                              ; preds = %316
  br label %319

319:                                              ; preds = %318, %316
  %320 = load i32, ptr %21, align 4, !tbaa !5
  %321 = add nsw i32 %320, 1
  store i32 %321, ptr %21, align 4, !tbaa !5
  br label %223, !llvm.loop !39

322:                                              ; preds = %229
  %323 = getelementptr inbounds %struct.fd_set, ptr %12, i32 0, i32 0
  %324 = load ptr, ptr %6, align 8, !tbaa !9
  %325 = getelementptr inbounds %struct.HandleTCPServer, ptr %324, i32 0, i32 0
  %326 = load i32, ptr %325, align 8, !tbaa !14
  %327 = sdiv i32 %326, 64
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [16 x i64], ptr %323, i64 0, i64 %328
  %330 = load i64, ptr %329, align 8, !tbaa !25
  %331 = load ptr, ptr %6, align 8, !tbaa !9
  %332 = getelementptr inbounds %struct.HandleTCPServer, ptr %331, i32 0, i32 0
  %333 = load i32, ptr %332, align 8, !tbaa !14
  %334 = srem i32 %333, 64
  %335 = zext i32 %334 to i64
  %336 = shl i64 1, %335
  %337 = and i64 %330, %336
  %338 = icmp ne i64 %337, 0
  br i1 %338, label %339, label %386

339:                                              ; preds = %322
  call void @llvm.lifetime.start.p0(i64 56, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  store i32 16, ptr %26, align 4, !tbaa !5
  %340 = load ptr, ptr %6, align 8, !tbaa !9
  %341 = getelementptr inbounds %struct.HandleTCPServer, ptr %340, i32 0, i32 0
  %342 = load i32, ptr %341, align 8, !tbaa !14
  %343 = call i32 @accept(i32 noundef %342, ptr noundef %25, ptr noundef %26)
  %344 = getelementptr inbounds %struct.ClientInfo, ptr %24, i32 0, i32 0
  store i32 %343, ptr %344, align 8, !tbaa !32
  %345 = getelementptr inbounds %struct.ClientInfo, ptr %24, i32 0, i32 0
  %346 = load i32, ptr %345, align 8, !tbaa !32
  %347 = icmp sge i32 %346, 0
  br i1 %347, label %348, label %385

348:                                              ; preds = %339
  %349 = getelementptr inbounds %struct.sockaddr_in, ptr %25, i32 0, i32 2
  %350 = getelementptr inbounds %struct.in_addr, ptr %349, i32 0, i32 0
  %351 = load i32, ptr %350, align 4, !tbaa !22
  %352 = getelementptr inbounds %struct.ClientInfo, ptr %24, i32 0, i32 1
  store i32 %351, ptr %352, align 4, !tbaa !40
  %353 = load i32, ptr %3, align 4, !tbaa !5
  %354 = getelementptr inbounds %struct.sockaddr_in, ptr %25, i32 0, i32 1
  %355 = load i16, ptr %354, align 2, !tbaa !21
  %356 = zext i16 %355 to i32
  %357 = call i32 (ptr, ...) @printf(ptr noundef @.str.22, i32 noundef %353, i32 noundef %356)
  %358 = getelementptr inbounds %struct.ClientInfo, ptr %24, i32 0, i32 2
  store i32 0, ptr %358, align 8, !tbaa !36
  %359 = getelementptr inbounds %struct.ClientInfo, ptr %24, i32 0, i32 3
  store i32 0, ptr %359, align 4, !tbaa !37
  %360 = call ptr @m_Malloc(i32 noundef 65536)
  %361 = getelementptr inbounds %struct.ClientInfo, ptr %24, i32 0, i32 5
  store ptr %360, ptr %361, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %362 = getelementptr inbounds %struct.ClientInfo, ptr %24, i32 0, i32 1
  store ptr %362, ptr %27, align 8, !tbaa !9
  %363 = getelementptr inbounds %struct.ClientInfo, ptr %24, i32 0, i32 4
  %364 = getelementptr inbounds [32 x i8], ptr %363, i64 0, i64 0
  %365 = load ptr, ptr %27, align 8, !tbaa !9
  %366 = getelementptr inbounds i8, ptr %365, i64 0
  %367 = load i8, ptr %366, align 1, !tbaa !38
  %368 = zext i8 %367 to i32
  %369 = load ptr, ptr %27, align 8, !tbaa !9
  %370 = getelementptr inbounds i8, ptr %369, i64 1
  %371 = load i8, ptr %370, align 1, !tbaa !38
  %372 = zext i8 %371 to i32
  %373 = load ptr, ptr %27, align 8, !tbaa !9
  %374 = getelementptr inbounds i8, ptr %373, i64 2
  %375 = load i8, ptr %374, align 1, !tbaa !38
  %376 = zext i8 %375 to i32
  %377 = load ptr, ptr %27, align 8, !tbaa !9
  %378 = getelementptr inbounds i8, ptr %377, i64 3
  %379 = load i8, ptr %378, align 1, !tbaa !38
  %380 = zext i8 %379 to i32
  %381 = load i32, ptr %3, align 4, !tbaa !5
  %382 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %364, ptr noundef @.str.1, i32 noundef %368, i32 noundef %372, i32 noundef %376, i32 noundef %380, i32 noundef %381) #6
  %383 = load ptr, ptr %10, align 8, !tbaa !9
  %384 = call ptr @mListWrite(ptr noundef %383, i32 noundef -1, ptr noundef %24, i32 noundef 56)
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  br label %385

385:                                              ; preds = %348, %339
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %24) #6
  br label %386

386:                                              ; preds = %385, %322
  %387 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr %387, ptr %2, align 8
  store i32 1, ptr %19, align 4
  br label %388

388:                                              ; preds = %386, %209
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #6
  %389 = load ptr, ptr %2, align 8
  ret ptr %389

390:                                              ; preds = %316
  unreachable
}

declare void @mListClear(ptr noundef) #1

; Function Attrs: nounwind
declare i32 @listen(i32 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) #5

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind "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 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"MHandle", !6, i64 0, !6, i64 4, !10, i64 8, !10, i64 16}
!13 = !{!12, !6, i64 4}
!14 = !{!15, !6, i64 0}
!15 = !{!"HandleTCPServer", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !7, i64 16, !10, i64 48, !10, i64 56}
!16 = !{!15, !6, i64 12}
!17 = !{!18, !19, i64 0}
!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 = !{!18, !19, i64 2}
!22 = !{!18, !6, i64 4}
!23 = !{!15, !10, i64 56}
!24 = !{!15, !10, i64 48}
!25 = !{!26, !26, i64 0}
!26 = !{!"long", !7, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!30, !6, i64 0}
!30 = !{!"MList", !6, i64 0, !10, i64 8}
!31 = !{!30, !10, i64 8}
!32 = !{!33, !6, i64 0}
!33 = !{!"ClientInfo", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !7, i64 16, !10, i64 48}
!34 = distinct !{!34, !28}
!35 = !{!33, !10, i64 48}
!36 = !{!33, !6, i64 8}
!37 = !{!33, !6, i64 12}
!38 = !{!7, !7, i64 0}
!39 = distinct !{!39, !28}
!40 = !{!33, !6, i64 4}


; 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.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }
%struct.timeval = type { i64, i64 }
%struct.fd_set = type { [16 x i64] }
%struct.ClientInfo = type { i32, i32, i32, i32, [32 x i8], ptr }

@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [7 x i8], align 1
@__FUNCTION__.TCPServerInit = external hidden unnamed_addr constant [14 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [40 x i8], align 1

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

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

declare i32 @close(i32 noundef) local_unnamed_addr #1

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #1

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

declare ptr @GetHandle(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare ptr @mMornObject(ptr noundef, i32 noundef) local_unnamed_addr #1

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

declare void @m_PropertyFunction(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @mornObjectRemove(ptr noundef, ptr noundef) #1

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

declare void @m_Free(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @__bswap_32(i32 noundef) local_unnamed_addr #4

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

declare ptr @m_Malloc(i32 noundef) local_unnamed_addr #1

declare ptr @ListCreate(i32 noundef, ptr noundef) local_unnamed_addr #1

declare void @mListElementDelete(ptr noundef, i32 noundef) local_unnamed_addr #1

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

declare ptr @mListWrite(ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare i64 @recv(i32 noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @endTCPServer(ptr noundef) #5

; Function Attrs: nounwind uwtable
define dso_local ptr @TCPServerInit(i32 noundef %0) local_unnamed_addr #5 {
  %2 = alloca [16 x i8], align 16
  %3 = alloca %struct.sockaddr_in, align 4
  %4 = alloca %struct.timeval, align 8
  %5 = alloca %struct.fd_set, align 8
  %6 = alloca %struct.ClientInfo, align 8
  %7 = alloca %struct.sockaddr_in, align 4
  %8 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #8
  %9 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.20, i32 noundef %0) #8
  %10 = call ptr @mMornObject(ptr noundef nonnull %2, i32 noundef -1) #8
  %11 = call ptr @GetHandle(ptr noundef %10, i32 noundef 64, i32 noundef 1873781879, ptr noundef nonnull @endTCPServer) #8
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %11, i64 4
  %15 = load volatile i32, ptr %14, align 4, !tbaa !11
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %17, label %49

17:                                               ; preds = %1
  %18 = call i32 @socket(i32 noundef 2, i32 noundef 1, i32 noundef 6) #8
  store i32 %18, ptr %13, align 8, !tbaa !12
  %19 = icmp slt i32 %18, 0
  br i1 %19, label %20, label %21

20:                                               ; preds = %17
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str.2, i32 noundef 509, ptr noundef nonnull @__FUNCTION__.TCPServerInit, ptr noundef nonnull @.str.21) #8
  br label %21

21:                                               ; preds = %20, %17
  %22 = getelementptr inbounds i8, ptr %13, i64 12
  store i32 %0, ptr %22, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #8
  store i16 2, ptr %3, align 4, !tbaa !15
  %23 = trunc i32 %0 to i16
  %24 = call zeroext i16 @__bswap_16(i16 noundef zeroext %23)
  %25 = getelementptr inbounds i8, ptr %3, i64 2
  store i16 %24, ptr %25, align 2, !tbaa !19
  %26 = call i32 @__bswap_32(i32 noundef 0)
  %27 = getelementptr inbounds i8, ptr %3, i64 4
  store i32 %26, ptr %27, align 4, !tbaa !20
  %28 = load i32, ptr %13, align 8, !tbaa !12
  %29 = call i32 @bind(i32 noundef %28, ptr noundef nonnull %3, i32 noundef 16) #8
  %30 = icmp slt i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %21
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str.2, i32 noundef 516, ptr noundef nonnull @__FUNCTION__.TCPServerInit, ptr noundef nonnull @.str.21) #8
  br label %32

32:                                               ; preds = %31, %21
  %33 = getelementptr inbounds i8, ptr %13, i64 56
  %34 = load ptr, ptr %33, align 8, !tbaa !21
  %35 = icmp eq ptr %34, null
  br i1 %35, label %36, label %38

36:                                               ; preds = %32
  %37 = call ptr @m_Malloc(i32 noundef 65536) #8
  store ptr %37, ptr %33, align 8, !tbaa !21
  br label %38

38:                                               ; preds = %36, %32
  %39 = getelementptr inbounds i8, ptr %13, i64 48
  %40 = load ptr, ptr %39, align 8, !tbaa !22
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %44

42:                                               ; preds = %38
  %43 = call ptr @ListCreate(i32 noundef -1, ptr noundef null) #8
  store ptr %43, ptr %39, align 8, !tbaa !22
  br label %44

44:                                               ; preds = %42, %38
  %45 = phi ptr [ %43, %42 ], [ %40, %38 ]
  call void @mListClear(ptr noundef %45) #8
  %46 = call ptr @mMornObject(ptr noundef nonnull %2, i32 noundef -1) #8
  call void @m_PropertyFunction(ptr noundef %46, ptr noundef nonnull @.str.7, ptr noundef nonnull @mornObjectRemove, ptr noundef nonnull %2) #8
  %47 = load i32, ptr %13, align 8, !tbaa !12
  %48 = call i32 @listen(i32 noundef %47, i32 noundef 10) #8
  store volatile i32 1, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  br label %49

49:                                               ; preds = %44, %1
  %50 = getelementptr inbounds i8, ptr %13, i64 48
  %51 = load ptr, ptr %50, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %5) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(128) %5, i8 0, i64 128, i1 false), !tbaa !23
  %52 = load i32, ptr %13, align 8, !tbaa !12
  %53 = srem i32 %52, 64
  %54 = zext nneg i32 %53 to i64
  %55 = shl nuw i64 1, %54
  %56 = sdiv i32 %52, 64
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [16 x i64], ptr %5, i64 0, i64 %57
  %59 = load i64, ptr %58, align 8, !tbaa !23
  %60 = or i64 %55, %59
  store i64 %60, ptr %58, align 8, !tbaa !23
  %61 = add nsw i32 %52, 1
  %62 = load i32, ptr %51, align 8, !tbaa !25
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %49
  %64 = getelementptr inbounds i8, ptr %51, i64 8
  %65 = load ptr, ptr %64, align 8, !tbaa !27
  %wide.trip.count = zext nneg i32 %62 to i64
  br label %67

._crit_edge:                                      ; preds = %67, %49
  %.082.lcssa = phi i32 [ %61, %49 ], [ %.082., %67 ]
  %66 = call i32 @select(i32 noundef %.082.lcssa, ptr noundef nonnull %5, ptr noundef null, ptr noundef null, ptr noundef nonnull %4) #8
  switch i32 %66, label %81 [
    i32 0, label %168
    i32 -1, label %80
  ]

67:                                               ; preds = %.lr.ph, %67
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %67 ]
  %.08292 = phi i32 [ %61, %.lr.ph ], [ %.082., %67 ]
  %68 = getelementptr inbounds ptr, ptr %65, i64 %indvars.iv
  %69 = load ptr, ptr %68, align 8, !tbaa !28
  %70 = load i32, ptr %69, align 8, !tbaa !29
  %71 = srem i32 %70, 64
  %72 = zext nneg i32 %71 to i64
  %73 = shl nuw i64 1, %72
  %74 = sdiv i32 %70, 64
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [16 x i64], ptr %5, i64 0, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !23
  %78 = or i64 %73, %77
  store i64 %78, ptr %76, align 8, !tbaa !23
  %79 = add nsw i32 %70, 1
  %.082. = call i32 @llvm.smax.i32(i32 %.08292, i32 %79)
  %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 %67, !llvm.loop !31

80:                                               ; preds = %._crit_edge
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str.2, i32 noundef 552, ptr noundef nonnull @__FUNCTION__.TCPServerInit, ptr noundef nonnull @.str.21) #8
  br label %81

81:                                               ; preds = %._crit_edge, %80
  %82 = load i32, ptr %51, align 8, !tbaa !25
  %83 = icmp sgt i32 %82, 0
  br i1 %83, label %.lr.ph95, label %._crit_edge96

.lr.ph95:                                         ; preds = %81
  %84 = getelementptr inbounds i8, ptr %51, i64 8
  br label %94

._crit_edge96:                                    ; preds = %139, %81
  %85 = load i32, ptr %13, align 8, !tbaa !12
  %86 = sdiv i32 %85, 64
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [16 x i64], ptr %5, i64 0, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !23
  %90 = srem i32 %85, 64
  %91 = zext nneg i32 %90 to i64
  %92 = shl nuw i64 1, %91
  %93 = and i64 %92, %89
  %.not = icmp eq i64 %93, 0
  br i1 %.not, label %168, label %143

94:                                               ; preds = %.lr.ph95, %139
  %.08393 = phi i32 [ 0, %.lr.ph95 ], [ %140, %139 ]
  %95 = load ptr, ptr %84, align 8, !tbaa !27
  %96 = sext i32 %.08393 to i64
  %97 = getelementptr inbounds ptr, ptr %95, i64 %96
  %98 = load ptr, ptr %97, align 8, !tbaa !28
  %99 = load i32, ptr %98, align 8, !tbaa !29
  %100 = sdiv i32 %99, 64
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [16 x i64], ptr %5, i64 0, i64 %101
  %103 = load i64, ptr %102, align 8, !tbaa !23
  %104 = srem i32 %99, 64
  %105 = zext nneg i32 %104 to i64
  %106 = shl nuw i64 1, %105
  %107 = and i64 %106, %103
  %.not89 = icmp eq i64 %107, 0
  br i1 %.not89, label %139, label %108

108:                                              ; preds = %94
  %109 = getelementptr inbounds i8, ptr %98, i64 48
  %110 = load ptr, ptr %109, align 8, !tbaa !33
  %111 = call i64 @recv(i32 noundef %99, ptr noundef %110, i64 noundef 65536, i32 noundef 0) #8
  %112 = trunc i64 %111 to i32
  %113 = icmp slt i32 %112, 1
  br i1 %113, label %114, label %130

114:                                              ; preds = %108
  %115 = load i32, ptr %98, align 8, !tbaa !29
  %116 = srem i32 %115, 64
  %117 = zext nneg i32 %116 to i64
  %118 = shl nuw i64 1, %117
  %119 = xor i64 %118, -1
  %120 = sdiv i32 %115, 64
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [16 x i64], ptr %5, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !23
  %124 = and i64 %123, %119
  store i64 %124, ptr %122, align 8, !tbaa !23
  %125 = call i32 @close(i32 noundef %115) #8
  %126 = getelementptr inbounds i8, ptr %98, i64 8
  store i32 -1, ptr %126, align 8, !tbaa !34
  %127 = getelementptr inbounds i8, ptr %98, i64 12
  store i32 0, ptr %127, align 4, !tbaa !35
  %128 = load ptr, ptr %109, align 8, !tbaa !33
  call void @m_Free(ptr noundef %128) #8
  call void @mListElementDelete(ptr noundef nonnull %51, i32 noundef %.08393) #8
  %129 = add nsw i32 %.08393, -1
  br label %139

130:                                              ; preds = %108
  %131 = icmp ult i32 %112, 65536
  br i1 %131, label %132, label %136

132:                                              ; preds = %130
  %133 = load ptr, ptr %109, align 8, !tbaa !33
  %134 = and i64 %111, 65535
  %135 = getelementptr inbounds i8, ptr %133, i64 %134
  store i8 0, ptr %135, align 1, !tbaa !36
  br label %136

136:                                              ; preds = %130, %132
  %137 = getelementptr inbounds i8, ptr %98, i64 12
  store i32 %112, ptr %137, align 4, !tbaa !35
  %138 = getelementptr inbounds i8, ptr %98, i64 8
  store i32 1, ptr %138, align 8, !tbaa !34
  br label %139

139:                                              ; preds = %114, %136, %94
  %.2 = phi i32 [ %.08393, %94 ], [ %129, %114 ], [ %.08393, %136 ]
  %140 = add nsw i32 %.2, 1
  %141 = load i32, ptr %51, align 8, !tbaa !25
  %142 = icmp slt i32 %140, %141
  br i1 %142, label %94, label %._crit_edge96, !llvm.loop !37

143:                                              ; preds = %._crit_edge96
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  store i32 16, ptr %8, align 4, !tbaa !38
  %144 = call i32 @accept(i32 noundef %85, ptr noundef nonnull %7, ptr noundef nonnull %8) #8
  store i32 %144, ptr %6, align 8, !tbaa !29
  %145 = icmp sgt i32 %144, -1
  br i1 %145, label %146, label %167

146:                                              ; preds = %143
  %147 = getelementptr inbounds i8, ptr %7, i64 4
  %148 = load i32, ptr %147, align 4, !tbaa !20
  %149 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 %148, ptr %149, align 4, !tbaa !39
  %150 = getelementptr inbounds i8, ptr %7, i64 2
  %151 = load i16, ptr %150, align 2, !tbaa !19
  %152 = zext i16 %151 to i32
  %153 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, i32 noundef %0, i32 noundef %152)
  %154 = getelementptr inbounds i8, ptr %6, i64 8
  store i32 0, ptr %154, align 8, !tbaa !34
  %155 = getelementptr inbounds i8, ptr %6, i64 12
  store i32 0, ptr %155, align 4, !tbaa !35
  %156 = call ptr @m_Malloc(i32 noundef 65536) #8
  %157 = getelementptr inbounds i8, ptr %6, i64 48
  store ptr %156, ptr %157, align 8, !tbaa !33
  %158 = getelementptr inbounds i8, ptr %6, i64 16
  %159 = and i32 %148, 255
  %160 = lshr i32 %148, 8
  %161 = and i32 %160, 255
  %162 = lshr i32 %148, 16
  %163 = and i32 %162, 255
  %164 = lshr i32 %148, 24
  %165 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %158, ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %159, i32 noundef %161, i32 noundef %163, i32 noundef %164, i32 noundef %0) #8
  %166 = call ptr @mListWrite(ptr noundef nonnull %51, i32 noundef -1, ptr noundef nonnull %6, i32 noundef 56) #8
  br label %167

167:                                              ; preds = %146, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %6) #8
  br label %168

168:                                              ; preds = %._crit_edge, %._crit_edge96, %167
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #8
  ret ptr %13
}

declare void @mListClear(ptr noundef) local_unnamed_addr #1

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 = { 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 #5 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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, !10, i64 16}
!6 = !{!"MHandle", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!13, !7, i64 0}
!13 = !{!"HandleTCPServer", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !8, i64 16, !10, i64 48, !10, i64 56}
!14 = !{!13, !7, i64 12}
!15 = !{!16, !17, i64 0}
!16 = !{!"sockaddr_in", !17, i64 0, !17, i64 2, !18, i64 4, !8, i64 8}
!17 = !{!"short", !8, i64 0}
!18 = !{!"in_addr", !7, i64 0}
!19 = !{!16, !17, i64 2}
!20 = !{!16, !7, i64 4}
!21 = !{!13, !10, i64 56}
!22 = !{!13, !10, i64 48}
!23 = !{!24, !24, i64 0}
!24 = !{!"long", !8, i64 0}
!25 = !{!26, !7, i64 0}
!26 = !{!"MList", !7, i64 0, !10, i64 8}
!27 = !{!26, !10, i64 8}
!28 = !{!10, !10, i64 0}
!29 = !{!30, !7, i64 0}
!30 = !{!"ClientInfo", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !8, i64 16, !10, i64 48}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!30, !10, i64 48}
!34 = !{!30, !7, i64 8}
!35 = !{!30, !7, i64 12}
!36 = !{!8, !8, i64 0}
!37 = distinct !{!37, !32}
!38 = !{!7, !7, i64 0}
!39 = !{!30, !7, i64 4}


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