; LLVM IR from nem0/lumixengine_net :: external/enet (peer)

; 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._ENetIncomingCommand = type { %struct._ENetListNode, i16, i16, %union._ENetProtocol, i32, i32, ptr, ptr }
%struct._ENetListNode = type { ptr, ptr }
%union._ENetProtocol = type { %struct._ENetProtocolConnect }
%struct._ENetProtocolConnect = type { %struct._ENetProtocolCommandHeader, i16, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct._ENetProtocolCommandHeader = type { i8, i8, i16 }
%struct._ENetPeer = type { %struct._ENetListNode, ptr, i16, i16, i32, i8, i8, %struct._ENetAddress, ptr, i32, ptr, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16, %struct._ENetList, %struct._ENetList, %struct._ENetList, %struct._ENetList, %struct._ENetList, %struct._ENetList, i32, i16, i16, [32 x i32], i32, i64 }
%struct._ENetAddress = type { i32, i16 }
%struct._ENetList = type { %struct._ENetListNode }
%struct._ENetChannel = type { i16, i16, i16, [16 x i16], i16, i16, %struct._ENetList, %struct._ENetList }
%struct._ENetProtocolSendUnreliable = type { %struct._ENetProtocolCommandHeader, i16, i16 }
%struct._ENetHost = type <{ i32, %struct._ENetAddress, i32, i32, i32, i32, i32, i32, [4 x i8], ptr, i64, i64, i32, [4 x i8], %struct._ENetList, i32, [4 x i8], i64, i16, [32 x %union._ENetProtocol], [6 x i8], i64, [65 x %struct.ENetBuffer], i64, ptr, %struct._ENetCompressor, [2 x [4096 x i8]], %struct._ENetAddress, ptr, i64, i32, i32, i32, i32, ptr, i64, i64, i64, i64, i64 }>
%struct.ENetBuffer = type { ptr, i64 }
%struct._ENetCompressor = type { ptr, ptr, ptr, ptr }
%struct._ENetPacket = type { i64, i32, ptr, i64, ptr, ptr }

@enet_peer_queue_incoming_command.dummyCommand = external hidden global %struct._ENetIncomingCommand, align 8

; 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

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

declare ptr @enet_malloc(i64 noundef) #2

declare void @enet_free(ptr noundef) #2

declare ptr @enet_list_insert(ptr noundef, ptr noundef) #2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @enet_peer_queue_incoming_command(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3, i32 noundef %4, i32 noundef %5) #5 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i16, align 2
  %18 = alloca i16, align 2
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store i64 %3, ptr %11, align 8, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !11
  store i32 %5, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._ENetPeer, ptr %23, i32 0, i32 10
  %25 = load ptr, ptr %24, align 8, !tbaa !13
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %26, i32 0, i32 1
  %28 = load i8, ptr %27, align 1, !tbaa !19
  %29 = zext i8 %28 to i64
  %30 = getelementptr inbounds %struct._ENetChannel, ptr %25, i64 %29
  store ptr %30, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 2, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  store ptr null, ptr %21, align 8, !tbaa !5
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct._ENetPeer, ptr %31, i32 0, i32 9
  %33 = load i32, ptr %32, align 8, !tbaa !20
  %34 = icmp eq i32 %33, 6
  br i1 %34, label %35, label %36

35:                                               ; preds = %6
  br label %392

36:                                               ; preds = %6
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %37, i32 0, i32 0
  %39 = load i8, ptr %38, align 1, !tbaa !19
  %40 = zext i8 %39 to i32
  %41 = and i32 %40, 15
  %42 = icmp ne i32 %41, 9
  br i1 %42, label %43, label %84

43:                                               ; preds = %36
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %44, i32 0, i32 2
  %46 = load i16, ptr %45, align 1, !tbaa !19
  %47 = zext i16 %46 to i32
  store i32 %47, ptr %16, align 4, !tbaa !11
  %48 = load i32, ptr %16, align 4, !tbaa !11
  %49 = udiv i32 %48, 4096
  %50 = trunc i32 %49 to i16
  store i16 %50, ptr %17, align 2, !tbaa !21
  %51 = load ptr, ptr %14, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._ENetChannel, ptr %51, i32 0, i32 4
  %53 = load i16, ptr %52, align 2, !tbaa !22
  %54 = zext i16 %53 to i32
  %55 = sdiv i32 %54, 4096
  %56 = trunc i32 %55 to i16
  store i16 %56, ptr %18, align 2, !tbaa !21
  %57 = load i32, ptr %16, align 4, !tbaa !11
  %58 = load ptr, ptr %14, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._ENetChannel, ptr %58, i32 0, i32 4
  %60 = load i16, ptr %59, align 2, !tbaa !22
  %61 = zext i16 %60 to i32
  %62 = icmp ult i32 %57, %61
  br i1 %62, label %63, label %68

63:                                               ; preds = %43
  %64 = load i16, ptr %17, align 2, !tbaa !21
  %65 = zext i16 %64 to i32
  %66 = add nsw i32 %65, 16
  %67 = trunc i32 %66 to i16
  store i16 %67, ptr %17, align 2, !tbaa !21
  br label %68

68:                                               ; preds = %63, %43
  %69 = load i16, ptr %17, align 2, !tbaa !21
  %70 = zext i16 %69 to i32
  %71 = load i16, ptr %18, align 2, !tbaa !21
  %72 = zext i16 %71 to i32
  %73 = icmp slt i32 %70, %72
  br i1 %73, label %82, label %74

74:                                               ; preds = %68
  %75 = load i16, ptr %17, align 2, !tbaa !21
  %76 = zext i16 %75 to i32
  %77 = load i16, ptr %18, align 2, !tbaa !21
  %78 = zext i16 %77 to i32
  %79 = add nsw i32 %78, 8
  %80 = sub nsw i32 %79, 1
  %81 = icmp sge i32 %76, %80
  br i1 %81, label %82, label %83

82:                                               ; preds = %74, %68
  br label %392

83:                                               ; preds = %74
  br label %84

84:                                               ; preds = %83, %36
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %85, i32 0, i32 0
  %87 = load i8, ptr %86, align 1, !tbaa !19
  %88 = zext i8 %87 to i32
  %89 = and i32 %88, 15
  switch i32 %89, label %278 [
    i32 8, label %90
    i32 6, label %90
    i32 7, label %164
    i32 12, label %164
    i32 9, label %274
  ]

90:                                               ; preds = %84, %84
  %91 = load i32, ptr %16, align 4, !tbaa !11
  %92 = load ptr, ptr %14, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._ENetChannel, ptr %92, i32 0, i32 4
  %94 = load i16, ptr %93, align 2, !tbaa !22
  %95 = zext i16 %94 to i32
  %96 = icmp eq i32 %91, %95
  br i1 %96, label %97, label %98

97:                                               ; preds = %90
  br label %392

98:                                               ; preds = %90
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._ENetChannel, ptr %99, i32 0, i32 6
  %101 = getelementptr inbounds %struct._ENetList, ptr %100, i32 0, i32 0
  %102 = getelementptr inbounds %struct._ENetListNode, ptr %101, i32 0, i32 1
  %103 = load ptr, ptr %102, align 8, !tbaa !24
  store ptr %103, ptr %20, align 8, !tbaa !5
  br label %104

104:                                              ; preds = %159, %98
  %105 = load ptr, ptr %20, align 8, !tbaa !5
  %106 = load ptr, ptr %14, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._ENetChannel, ptr %106, i32 0, i32 6
  %108 = getelementptr inbounds %struct._ENetList, ptr %107, i32 0, i32 0
  %109 = icmp ne ptr %105, %108
  br i1 %109, label %110, label %163

110:                                              ; preds = %104
  %111 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %111, ptr %19, align 8, !tbaa !5
  %112 = load i32, ptr %16, align 4, !tbaa !11
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._ENetChannel, ptr %113, i32 0, i32 4
  %115 = load i16, ptr %114, align 2, !tbaa !22
  %116 = zext i16 %115 to i32
  %117 = icmp uge i32 %112, %116
  br i1 %117, label %118, label %130

118:                                              ; preds = %110
  %119 = load ptr, ptr %19, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %119, i32 0, i32 1
  %121 = load i16, ptr %120, align 8, !tbaa !25
  %122 = zext i16 %121 to i32
  %123 = load ptr, ptr %14, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._ENetChannel, ptr %123, i32 0, i32 4
  %125 = load i16, ptr %124, align 2, !tbaa !22
  %126 = zext i16 %125 to i32
  %127 = icmp slt i32 %122, %126
  br i1 %127, label %128, label %129

128:                                              ; preds = %118
  br label %159

129:                                              ; preds = %118
  br label %142

130:                                              ; preds = %110
  %131 = load ptr, ptr %19, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %131, i32 0, i32 1
  %133 = load i16, ptr %132, align 8, !tbaa !25
  %134 = zext i16 %133 to i32
  %135 = load ptr, ptr %14, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._ENetChannel, ptr %135, i32 0, i32 4
  %137 = load i16, ptr %136, align 2, !tbaa !22
  %138 = zext i16 %137 to i32
  %139 = icmp sge i32 %134, %138
  br i1 %139, label %140, label %141

140:                                              ; preds = %130
  br label %163

141:                                              ; preds = %130
  br label %142

142:                                              ; preds = %141, %129
  %143 = load ptr, ptr %19, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %143, i32 0, i32 1
  %145 = load i16, ptr %144, align 8, !tbaa !25
  %146 = zext i16 %145 to i32
  %147 = load i32, ptr %16, align 4, !tbaa !11
  %148 = icmp ule i32 %146, %147
  br i1 %148, label %149, label %158

149:                                              ; preds = %142
  %150 = load ptr, ptr %19, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %150, i32 0, i32 1
  %152 = load i16, ptr %151, align 8, !tbaa !25
  %153 = zext i16 %152 to i32
  %154 = load i32, ptr %16, align 4, !tbaa !11
  %155 = icmp ult i32 %153, %154
  br i1 %155, label %156, label %157

156:                                              ; preds = %149
  br label %163

157:                                              ; preds = %149
  br label %392

158:                                              ; preds = %142
  br label %159

159:                                              ; preds = %158, %128
  %160 = load ptr, ptr %20, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct._ENetListNode, ptr %160, i32 0, i32 1
  %162 = load ptr, ptr %161, align 8, !tbaa !27
  store ptr %162, ptr %20, align 8, !tbaa !5
  br label %104, !llvm.loop !28

163:                                              ; preds = %156, %140, %104
  br label %279

164:                                              ; preds = %84, %84
  %165 = load ptr, ptr %9, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct._ENetProtocolSendUnreliable, ptr %165, i32 0, i32 1
  %167 = load i16, ptr %166, align 1, !tbaa !19
  %168 = call zeroext i16 @__bswap_16(i16 noundef zeroext %167)
  %169 = zext i16 %168 to i32
  store i32 %169, ptr %15, align 4, !tbaa !11
  %170 = load i32, ptr %16, align 4, !tbaa !11
  %171 = load ptr, ptr %14, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct._ENetChannel, ptr %171, i32 0, i32 4
  %173 = load i16, ptr %172, align 2, !tbaa !22
  %174 = zext i16 %173 to i32
  %175 = icmp eq i32 %170, %174
  br i1 %175, label %176, label %184

176:                                              ; preds = %164
  %177 = load i32, ptr %15, align 4, !tbaa !11
  %178 = load ptr, ptr %14, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct._ENetChannel, ptr %178, i32 0, i32 5
  %180 = load i16, ptr %179, align 8, !tbaa !30
  %181 = zext i16 %180 to i32
  %182 = icmp ule i32 %177, %181
  br i1 %182, label %183, label %184

183:                                              ; preds = %176
  br label %392

184:                                              ; preds = %176, %164
  %185 = load ptr, ptr %14, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct._ENetChannel, ptr %185, i32 0, i32 7
  %187 = getelementptr inbounds %struct._ENetList, ptr %186, i32 0, i32 0
  %188 = getelementptr inbounds %struct._ENetListNode, ptr %187, i32 0, i32 1
  %189 = load ptr, ptr %188, align 8, !tbaa !31
  store ptr %189, ptr %20, align 8, !tbaa !5
  br label %190

190:                                              ; preds = %269, %184
  %191 = load ptr, ptr %20, align 8, !tbaa !5
  %192 = load ptr, ptr %14, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct._ENetChannel, ptr %192, i32 0, i32 7
  %194 = getelementptr inbounds %struct._ENetList, ptr %193, i32 0, i32 0
  %195 = icmp ne ptr %191, %194
  br i1 %195, label %196, label %273

196:                                              ; preds = %190
  %197 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %197, ptr %19, align 8, !tbaa !5
  %198 = load ptr, ptr %9, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %198, i32 0, i32 0
  %200 = load i8, ptr %199, align 1, !tbaa !19
  %201 = zext i8 %200 to i32
  %202 = and i32 %201, 15
  %203 = icmp eq i32 %202, 9
  br i1 %203, label %204, label %205

204:                                              ; preds = %196
  br label %269

205:                                              ; preds = %196
  %206 = load i32, ptr %16, align 4, !tbaa !11
  %207 = load ptr, ptr %14, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct._ENetChannel, ptr %207, i32 0, i32 4
  %209 = load i16, ptr %208, align 2, !tbaa !22
  %210 = zext i16 %209 to i32
  %211 = icmp uge i32 %206, %210
  br i1 %211, label %212, label %224

212:                                              ; preds = %205
  %213 = load ptr, ptr %19, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %213, i32 0, i32 1
  %215 = load i16, ptr %214, align 8, !tbaa !25
  %216 = zext i16 %215 to i32
  %217 = load ptr, ptr %14, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct._ENetChannel, ptr %217, i32 0, i32 4
  %219 = load i16, ptr %218, align 2, !tbaa !22
  %220 = zext i16 %219 to i32
  %221 = icmp slt i32 %216, %220
  br i1 %221, label %222, label %223

222:                                              ; preds = %212
  br label %269

223:                                              ; preds = %212
  br label %236

224:                                              ; preds = %205
  %225 = load ptr, ptr %19, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %225, i32 0, i32 1
  %227 = load i16, ptr %226, align 8, !tbaa !25
  %228 = zext i16 %227 to i32
  %229 = load ptr, ptr %14, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct._ENetChannel, ptr %229, i32 0, i32 4
  %231 = load i16, ptr %230, align 2, !tbaa !22
  %232 = zext i16 %231 to i32
  %233 = icmp sge i32 %228, %232
  br i1 %233, label %234, label %235

234:                                              ; preds = %224
  br label %273

235:                                              ; preds = %224
  br label %236

236:                                              ; preds = %235, %223
  %237 = load ptr, ptr %19, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %237, i32 0, i32 1
  %239 = load i16, ptr %238, align 8, !tbaa !25
  %240 = zext i16 %239 to i32
  %241 = load i32, ptr %16, align 4, !tbaa !11
  %242 = icmp ult i32 %240, %241
  br i1 %242, label %243, label %244

243:                                              ; preds = %236
  br label %273

244:                                              ; preds = %236
  %245 = load ptr, ptr %19, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %245, i32 0, i32 1
  %247 = load i16, ptr %246, align 8, !tbaa !25
  %248 = zext i16 %247 to i32
  %249 = load i32, ptr %16, align 4, !tbaa !11
  %250 = icmp ugt i32 %248, %249
  br i1 %250, label %251, label %252

251:                                              ; preds = %244
  br label %269

252:                                              ; preds = %244
  %253 = load ptr, ptr %19, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %253, i32 0, i32 2
  %255 = load i16, ptr %254, align 2, !tbaa !32
  %256 = zext i16 %255 to i32
  %257 = load i32, ptr %15, align 4, !tbaa !11
  %258 = icmp ule i32 %256, %257
  br i1 %258, label %259, label %268

259:                                              ; preds = %252
  %260 = load ptr, ptr %19, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %260, i32 0, i32 2
  %262 = load i16, ptr %261, align 2, !tbaa !32
  %263 = zext i16 %262 to i32
  %264 = load i32, ptr %15, align 4, !tbaa !11
  %265 = icmp ult i32 %263, %264
  br i1 %265, label %266, label %267

266:                                              ; preds = %259
  br label %273

267:                                              ; preds = %259
  br label %392

268:                                              ; preds = %252
  br label %269

269:                                              ; preds = %268, %251, %222, %204
  %270 = load ptr, ptr %20, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct._ENetListNode, ptr %270, i32 0, i32 1
  %272 = load ptr, ptr %271, align 8, !tbaa !27
  store ptr %272, ptr %20, align 8, !tbaa !5
  br label %190, !llvm.loop !33

273:                                              ; preds = %266, %243, %234, %190
  br label %279

274:                                              ; preds = %84
  %275 = load ptr, ptr %14, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct._ENetChannel, ptr %275, i32 0, i32 7
  %277 = getelementptr inbounds %struct._ENetList, ptr %276, i32 0, i32 0
  store ptr %277, ptr %20, align 8, !tbaa !5
  br label %279

278:                                              ; preds = %84
  br label %392

279:                                              ; preds = %274, %273, %163
  %280 = load ptr, ptr %8, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct._ENetPeer, ptr %280, i32 0, i32 59
  %282 = load i64, ptr %281, align 8, !tbaa !34
  %283 = load ptr, ptr %8, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct._ENetPeer, ptr %283, i32 0, i32 1
  %285 = load ptr, ptr %284, align 8, !tbaa !35
  %286 = getelementptr inbounds %struct._ENetHost, ptr %285, i32 0, i32 39
  %287 = load i64, ptr %286, align 8, !tbaa !36
  %288 = icmp uge i64 %282, %287
  br i1 %288, label %289, label %290

289:                                              ; preds = %279
  br label %407

290:                                              ; preds = %279
  %291 = load ptr, ptr %10, align 8, !tbaa !5
  %292 = load i64, ptr %11, align 8, !tbaa !9
  %293 = load i32, ptr %12, align 4, !tbaa !11
  %294 = call ptr @enet_packet_create(ptr noundef %291, i64 noundef %292, i32 noundef %293)
  store ptr %294, ptr %21, align 8, !tbaa !5
  %295 = load ptr, ptr %21, align 8, !tbaa !5
  %296 = icmp eq ptr %295, null
  br i1 %296, label %297, label %298

297:                                              ; preds = %290
  br label %407

298:                                              ; preds = %290
  %299 = call ptr @enet_malloc(i64 noundef 96)
  store ptr %299, ptr %19, align 8, !tbaa !5
  %300 = load ptr, ptr %19, align 8, !tbaa !5
  %301 = icmp eq ptr %300, null
  br i1 %301, label %302, label %303

302:                                              ; preds = %298
  br label %407

303:                                              ; preds = %298
  %304 = load ptr, ptr %9, align 8, !tbaa !5
  %305 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %304, i32 0, i32 2
  %306 = load i16, ptr %305, align 1, !tbaa !19
  %307 = load ptr, ptr %19, align 8, !tbaa !5
  %308 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %307, i32 0, i32 1
  store i16 %306, ptr %308, align 8, !tbaa !25
  %309 = load i32, ptr %15, align 4, !tbaa !11
  %310 = and i32 %309, 65535
  %311 = trunc i32 %310 to i16
  %312 = load ptr, ptr %19, align 8, !tbaa !5
  %313 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %312, i32 0, i32 2
  store i16 %311, ptr %313, align 2, !tbaa !32
  %314 = load ptr, ptr %19, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %314, i32 0, i32 3
  %316 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %315, ptr align 1 %316, i64 48, i1 false), !tbaa.struct !39
  %317 = load i32, ptr %13, align 4, !tbaa !11
  %318 = load ptr, ptr %19, align 8, !tbaa !5
  %319 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %318, i32 0, i32 4
  store i32 %317, ptr %319, align 4, !tbaa !40
  %320 = load i32, ptr %13, align 4, !tbaa !11
  %321 = load ptr, ptr %19, align 8, !tbaa !5
  %322 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %321, i32 0, i32 5
  store i32 %320, ptr %322, align 8, !tbaa !41
  %323 = load ptr, ptr %21, align 8, !tbaa !5
  %324 = load ptr, ptr %19, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %324, i32 0, i32 7
  store ptr %323, ptr %325, align 8, !tbaa !42
  %326 = load ptr, ptr %19, align 8, !tbaa !5
  %327 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %326, i32 0, i32 6
  store ptr null, ptr %327, align 8, !tbaa !43
  %328 = load i32, ptr %13, align 4, !tbaa !11
  %329 = icmp ugt i32 %328, 0
  br i1 %329, label %330, label %358

330:                                              ; preds = %303
  %331 = load i32, ptr %13, align 4, !tbaa !11
  %332 = icmp ule i32 %331, 1048576
  br i1 %332, label %333, label %342

333:                                              ; preds = %330
  %334 = load i32, ptr %13, align 4, !tbaa !11
  %335 = add i32 %334, 31
  %336 = udiv i32 %335, 32
  %337 = zext i32 %336 to i64
  %338 = mul i64 %337, 4
  %339 = call ptr @enet_malloc(i64 noundef %338)
  %340 = load ptr, ptr %19, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %340, i32 0, i32 6
  store ptr %339, ptr %341, align 8, !tbaa !43
  br label %342

342:                                              ; preds = %333, %330
  %343 = load ptr, ptr %19, align 8, !tbaa !5
  %344 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %343, i32 0, i32 6
  %345 = load ptr, ptr %344, align 8, !tbaa !43
  %346 = icmp eq ptr %345, null
  br i1 %346, label %347, label %349

347:                                              ; preds = %342
  %348 = load ptr, ptr %19, align 8, !tbaa !5
  call void @enet_free(ptr noundef %348)
  br label %407

349:                                              ; preds = %342
  %350 = load ptr, ptr %19, align 8, !tbaa !5
  %351 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %350, i32 0, i32 6
  %352 = load ptr, ptr %351, align 8, !tbaa !43
  %353 = load i32, ptr %13, align 4, !tbaa !11
  %354 = add i32 %353, 31
  %355 = udiv i32 %354, 32
  %356 = zext i32 %355 to i64
  %357 = mul i64 %356, 4
  call void @llvm.memset.p0.i64(ptr align 4 %352, i8 0, i64 %357, i1 false)
  br label %358

358:                                              ; preds = %349, %303
  %359 = load ptr, ptr %21, align 8, !tbaa !5
  %360 = icmp ne ptr %359, null
  br i1 %360, label %361, label %373

361:                                              ; preds = %358
  %362 = load ptr, ptr %21, align 8, !tbaa !5
  %363 = getelementptr inbounds %struct._ENetPacket, ptr %362, i32 0, i32 0
  %364 = load i64, ptr %363, align 8, !tbaa !44
  %365 = add i64 %364, 1
  store i64 %365, ptr %363, align 8, !tbaa !44
  %366 = load ptr, ptr %21, align 8, !tbaa !5
  %367 = getelementptr inbounds %struct._ENetPacket, ptr %366, i32 0, i32 3
  %368 = load i64, ptr %367, align 8, !tbaa !46
  %369 = load ptr, ptr %8, align 8, !tbaa !5
  %370 = getelementptr inbounds %struct._ENetPeer, ptr %369, i32 0, i32 59
  %371 = load i64, ptr %370, align 8, !tbaa !34
  %372 = add i64 %371, %368
  store i64 %372, ptr %370, align 8, !tbaa !34
  br label %373

373:                                              ; preds = %361, %358
  %374 = load ptr, ptr %20, align 8, !tbaa !5
  %375 = getelementptr inbounds %struct._ENetListNode, ptr %374, i32 0, i32 0
  %376 = load ptr, ptr %375, align 8, !tbaa !47
  %377 = load ptr, ptr %19, align 8, !tbaa !5
  %378 = call ptr @enet_list_insert(ptr noundef %376, ptr noundef %377)
  %379 = load ptr, ptr %9, align 8, !tbaa !5
  %380 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %379, i32 0, i32 0
  %381 = load i8, ptr %380, align 1, !tbaa !19
  %382 = zext i8 %381 to i32
  %383 = and i32 %382, 15
  switch i32 %383, label %387 [
    i32 8, label %384
    i32 6, label %384
  ]

384:                                              ; preds = %373, %373
  %385 = load ptr, ptr %8, align 8, !tbaa !5
  %386 = load ptr, ptr %14, align 8, !tbaa !5
  call void @enet_peer_dispatch_incoming_reliable_commands(ptr noundef %385, ptr noundef %386)
  br label %390

387:                                              ; preds = %373
  %388 = load ptr, ptr %8, align 8, !tbaa !5
  %389 = load ptr, ptr %14, align 8, !tbaa !5
  call void @enet_peer_dispatch_incoming_unreliable_commands(ptr noundef %388, ptr noundef %389)
  br label %390

390:                                              ; preds = %387, %384
  %391 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %391, ptr %7, align 8
  store i32 1, ptr %22, align 4
  br label %418

392:                                              ; preds = %278, %267, %183, %157, %97, %82, %35
  %393 = load i32, ptr %13, align 4, !tbaa !11
  %394 = icmp ugt i32 %393, 0
  br i1 %394, label %395, label %396

395:                                              ; preds = %392
  br label %407

396:                                              ; preds = %392
  %397 = load ptr, ptr %21, align 8, !tbaa !5
  %398 = icmp ne ptr %397, null
  br i1 %398, label %399, label %406

399:                                              ; preds = %396
  %400 = load ptr, ptr %21, align 8, !tbaa !5
  %401 = getelementptr inbounds %struct._ENetPacket, ptr %400, i32 0, i32 0
  %402 = load i64, ptr %401, align 8, !tbaa !44
  %403 = icmp eq i64 %402, 0
  br i1 %403, label %404, label %406

404:                                              ; preds = %399
  %405 = load ptr, ptr %21, align 8, !tbaa !5
  call void @enet_packet_destroy(ptr noundef %405)
  br label %406

406:                                              ; preds = %404, %399, %396
  store ptr @enet_peer_queue_incoming_command.dummyCommand, ptr %7, align 8
  store i32 1, ptr %22, align 4
  br label %418

407:                                              ; preds = %395, %347, %302, %297, %289
  %408 = load ptr, ptr %21, align 8, !tbaa !5
  %409 = icmp ne ptr %408, null
  br i1 %409, label %410, label %417

410:                                              ; preds = %407
  %411 = load ptr, ptr %21, align 8, !tbaa !5
  %412 = getelementptr inbounds %struct._ENetPacket, ptr %411, i32 0, i32 0
  %413 = load i64, ptr %412, align 8, !tbaa !44
  %414 = icmp eq i64 %413, 0
  br i1 %414, label %415, label %417

415:                                              ; preds = %410
  %416 = load ptr, ptr %21, align 8, !tbaa !5
  call void @enet_packet_destroy(ptr noundef %416)
  br label %417

417:                                              ; preds = %415, %410, %407
  store ptr null, ptr %7, align 8
  store i32 1, ptr %22, align 4
  br label %418

418:                                              ; preds = %417, %406, %390
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %419 = load ptr, ptr %7, align 8
  ret ptr %419
}

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

declare void @enet_packet_destroy(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 64}
!14 = !{!"_ENetPeer", !15, i64 0, !6, i64 16, !16, i64 24, !16, i64 26, !12, i64 28, !7, i64 32, !7, i64 33, !17, i64 36, !6, i64 48, !12, i64 56, !6, i64 64, !10, i64 72, !12, i64 80, !12, i64 84, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !12, i64 148, !12, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !12, i64 172, !12, i64 176, !12, i64 180, !12, i64 184, !12, i64 188, !12, i64 192, !12, i64 196, !12, i64 200, !12, i64 204, !12, i64 208, !12, i64 212, !12, i64 216, !16, i64 220, !18, i64 224, !18, i64 240, !18, i64 256, !18, i64 272, !18, i64 288, !18, i64 304, !12, i64 320, !16, i64 324, !16, i64 326, !7, i64 328, !12, i64 456, !10, i64 464}
!15 = !{!"_ENetListNode", !6, i64 0, !6, i64 8}
!16 = !{!"short", !7, i64 0}
!17 = !{!"_ENetAddress", !12, i64 0, !16, i64 4}
!18 = !{!"_ENetList", !15, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!14, !12, i64 56}
!21 = !{!16, !16, i64 0}
!22 = !{!23, !16, i64 38}
!23 = !{!"_ENetChannel", !16, i64 0, !16, i64 2, !16, i64 4, !7, i64 6, !16, i64 38, !16, i64 40, !18, i64 48, !18, i64 64}
!24 = !{!23, !6, i64 56}
!25 = !{!26, !16, i64 16}
!26 = !{!"_ENetIncomingCommand", !15, i64 0, !16, i64 16, !16, i64 18, !7, i64 20, !12, i64 68, !12, i64 72, !6, i64 80, !6, i64 88}
!27 = !{!15, !6, i64 8}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!23, !16, i64 40}
!31 = !{!23, !6, i64 72}
!32 = !{!26, !16, i64 18}
!33 = distinct !{!33, !29}
!34 = !{!14, !10, i64 464}
!35 = !{!14, !6, i64 16}
!36 = !{!37, !10, i64 11016}
!37 = !{!"_ENetHost", !12, i64 0, !17, i64 4, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !6, i64 40, !10, i64 48, !10, i64 56, !12, i64 64, !18, i64 72, !12, i64 88, !10, i64 96, !16, i64 104, !7, i64 106, !10, i64 1648, !7, i64 1656, !10, i64 2696, !6, i64 2704, !38, i64 2712, !7, i64 2744, !17, i64 10936, !6, i64 10944, !10, i64 10952, !12, i64 10960, !12, i64 10964, !12, i64 10968, !12, i64 10972, !6, i64 10976, !10, i64 10984, !10, i64 10992, !10, i64 11000, !10, i64 11008, !10, i64 11016}
!38 = !{!"_ENetCompressor", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!39 = !{i64 0, i64 48, !19}
!40 = !{!26, !12, i64 68}
!41 = !{!26, !12, i64 72}
!42 = !{!26, !6, i64 88}
!43 = !{!26, !6, i64 80}
!44 = !{!45, !10, i64 0}
!45 = !{!"_ENetPacket", !10, i64 0, !12, i64 8, !6, i64 16, !10, i64 24, !6, i64 32, !6, i64 40}
!46 = !{!45, !10, i64 24}
!47 = !{!15, !6, i64 0}


; 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._ENetIncomingCommand = type { %struct._ENetListNode, i16, i16, %union._ENetProtocol, i32, i32, ptr, ptr }
%struct._ENetListNode = type { ptr, ptr }
%union._ENetProtocol = type { %struct._ENetProtocolConnect }
%struct._ENetProtocolConnect = type { %struct._ENetProtocolCommandHeader, i16, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct._ENetProtocolCommandHeader = type { i8, i8, i16 }
%struct._ENetChannel = type { i16, i16, i16, [16 x i16], i16, i16, %struct._ENetList, %struct._ENetList }
%struct._ENetList = type { %struct._ENetListNode }

@enet_peer_queue_incoming_command.dummyCommand = external hidden global %struct._ENetIncomingCommand, align 8

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

declare ptr @enet_malloc(i64 noundef) local_unnamed_addr #1

declare void @enet_free(ptr noundef) local_unnamed_addr #1

declare ptr @enet_list_insert(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @enet_peer_queue_incoming_command(ptr noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2, i64 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #4 {
  %7 = getelementptr inbounds i8, ptr %0, i64 64
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %1, i64 1
  %10 = load i8, ptr %9, align 1, !tbaa !16
  %11 = zext i8 %10 to i64
  %12 = getelementptr inbounds %struct._ENetChannel, ptr %8, i64 %11
  %13 = getelementptr inbounds i8, ptr %0, i64 56
  %14 = load i32, ptr %13, align 8, !tbaa !17
  %15 = icmp eq i32 %14, 6
  br i1 %15, label %132, label %16

16:                                               ; preds = %6
  %17 = load i8, ptr %1, align 1, !tbaa !16
  %18 = and i8 %17, 15
  %.not = icmp eq i8 %18, 9
  br i1 %.not, label %.thread, label %19

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %1, i64 2
  %21 = load i16, ptr %20, align 1, !tbaa !16
  %22 = lshr i16 %21, 12
  %23 = getelementptr inbounds i8, ptr %12, i64 38
  %24 = load i16, ptr %23, align 2, !tbaa !18
  %25 = lshr i16 %24, 12
  %26 = icmp ult i16 %21, %24
  %27 = or disjoint i16 %22, 16
  %spec.select = select i1 %26, i16 %27, i16 %22
  %28 = icmp uge i16 %spec.select, %25
  %29 = add nuw nsw i16 %25, 7
  %.not125 = icmp ult i16 %spec.select, %29
  %or.cond = select i1 %28, i1 %.not125, i1 false
  br i1 %or.cond, label %30, label %132

30:                                               ; preds = %19
  switch i8 %18, label %132 [
    i8 8, label %31
    i8 6, label %31
    i8 7, label %47
    i8 12, label %47
    i8 9, label %.thread
  ]

31:                                               ; preds = %30, %30
  %32 = icmp eq i16 %21, %24
  br i1 %32, label %132, label %33

33:                                               ; preds = %31
  %34 = getelementptr inbounds i8, ptr %12, i64 48
  %35 = getelementptr inbounds i8, ptr %12, i64 56
  %.0105164 = load ptr, ptr %35, align 8, !tbaa !20
  %.not131165 = icmp eq ptr %.0105164, %34
  br i1 %.not131165, label %.loopexit, label %.lr.ph167

.lr.ph167:                                        ; preds = %33
  br i1 %26, label %.lr.ph167.split.us, label %.lr.ph167.split

.lr.ph167.split.us:                               ; preds = %.lr.ph167, %39
  %.0105166.us = phi ptr [ %.0105.us, %39 ], [ %.0105164, %.lr.ph167 ]
  %36 = getelementptr inbounds i8, ptr %.0105166.us, i64 16
  %37 = load i16, ptr %36, align 8, !tbaa !21
  %.not133.us = icmp ult i16 %37, %24
  br i1 %.not133.us, label %38, label %.loopexit

38:                                               ; preds = %.lr.ph167.split.us
  %.not134.us = icmp ult i16 %21, %37
  br i1 %.not134.us, label %39, label %.split173.us

39:                                               ; preds = %38
  %40 = getelementptr inbounds i8, ptr %.0105166.us, i64 8
  %.0105.us = load ptr, ptr %40, align 8, !tbaa !20
  %.not131.us = icmp eq ptr %.0105.us, %34
  br i1 %.not131.us, label %.loopexit, label %.lr.ph167.split.us, !llvm.loop !23

.lr.ph167.split:                                  ; preds = %.lr.ph167, %45
  %.0105166 = phi ptr [ %.0105, %45 ], [ %.0105164, %.lr.ph167 ]
  %41 = getelementptr inbounds i8, ptr %.0105166, i64 16
  %42 = load i16, ptr %41, align 8, !tbaa !21
  %43 = icmp ult i16 %42, %24
  %.not134 = icmp ult i16 %21, %42
  %or.cond208 = or i1 %43, %.not134
  br i1 %or.cond208, label %45, label %.split173.us

.split173.us:                                     ; preds = %.lr.ph167.split, %38
  %.us-phi174 = phi i16 [ %37, %38 ], [ %42, %.lr.ph167.split ]
  %.us-phi175 = phi ptr [ %.0105166.us, %38 ], [ %.0105166, %.lr.ph167.split ]
  %44 = icmp ugt i16 %21, %.us-phi174
  br i1 %44, label %.loopexit, label %132

45:                                               ; preds = %.lr.ph167.split
  %46 = getelementptr inbounds i8, ptr %.0105166, i64 8
  %.0105 = load ptr, ptr %46, align 8, !tbaa !20
  %.not131 = icmp eq ptr %.0105, %34
  br i1 %.not131, label %.loopexit, label %.lr.ph167.split, !llvm.loop !23

47:                                               ; preds = %30, %30
  %48 = getelementptr inbounds i8, ptr %1, i64 4
  %49 = load i16, ptr %48, align 1, !tbaa !16
  %50 = tail call zeroext i16 @__bswap_16(i16 noundef zeroext %49)
  %51 = load i16, ptr %23, align 2, !tbaa !18
  %52 = icmp eq i16 %21, %51
  br i1 %52, label %53, label %56

53:                                               ; preds = %47
  %54 = getelementptr inbounds i8, ptr %12, i64 40
  %55 = load i16, ptr %54, align 8, !tbaa !25
  %.not126 = icmp ugt i16 %50, %55
  br i1 %.not126, label %56, label %132

56:                                               ; preds = %53, %47
  %57 = getelementptr inbounds i8, ptr %12, i64 64
  %58 = getelementptr inbounds i8, ptr %12, i64 72
  %.1148 = load ptr, ptr %58, align 8, !tbaa !20
  %.not127149 = icmp eq ptr %.1148, %57
  br i1 %.not127149, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %56
  %59 = load i8, ptr %1, align 1, !tbaa !16
  %60 = and i8 %59, 15
  %61 = icmp eq i8 %60, 9
  br i1 %61, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.lr.ph.split.us
  %.1150.us = phi ptr [ %.1.us, %.lr.ph.split.us ], [ %.1148, %.lr.ph ]
  %62 = getelementptr inbounds i8, ptr %.1150.us, i64 8
  %.1.us = load ptr, ptr %62, align 8, !tbaa !20
  %.not127.us = icmp eq ptr %.1.us, %57
  br i1 %.not127.us, label %.loopexit, label %.lr.ph.split.us, !llvm.loop !26

.lr.ph.split:                                     ; preds = %.lr.ph
  %.not128 = icmp ult i16 %21, %51
  br i1 %.not128, label %.lr.ph.split.split.us, label %.lr.ph.split.split

.lr.ph.split.split.us:                            ; preds = %.lr.ph.split, %71
  %.1150.us155 = phi ptr [ %.1.us156, %71 ], [ %.1148, %.lr.ph.split ]
  %63 = getelementptr inbounds i8, ptr %.1150.us155, i64 16
  %64 = load i16, ptr %63, align 8, !tbaa !21
  %.not129.us = icmp uge i16 %64, %51
  %65 = icmp ugt i16 %21, %64
  %or.cond209 = or i1 %.not129.us, %65
  br i1 %or.cond209, label %.loopexit, label %66

66:                                               ; preds = %.lr.ph.split.split.us
  %67 = icmp ult i16 %21, %64
  br i1 %67, label %71, label %68

68:                                               ; preds = %66
  %69 = getelementptr inbounds i8, ptr %.1150.us155, i64 18
  %70 = load i16, ptr %69, align 2, !tbaa !27
  %.not130.us = icmp ugt i16 %70, %50
  br i1 %.not130.us, label %71, label %.split.us

71:                                               ; preds = %68, %66
  %72 = getelementptr inbounds i8, ptr %.1150.us155, i64 8
  %.1.us156 = load ptr, ptr %72, align 8, !tbaa !20
  %.not127.us157 = icmp eq ptr %.1.us156, %57
  br i1 %.not127.us157, label %.loopexit, label %.lr.ph.split.split.us, !llvm.loop !26

.lr.ph.split.split:                               ; preds = %.lr.ph.split, %84
  %.1150 = phi ptr [ %.1, %84 ], [ %.1148, %.lr.ph.split ]
  %73 = getelementptr inbounds i8, ptr %.1150, i64 16
  %74 = load i16, ptr %73, align 8, !tbaa !21
  %75 = icmp ult i16 %74, %51
  br i1 %75, label %84, label %76

76:                                               ; preds = %.lr.ph.split.split
  %77 = icmp ugt i16 %21, %74
  br i1 %77, label %.loopexit, label %78

78:                                               ; preds = %76
  %79 = icmp ult i16 %21, %74
  br i1 %79, label %84, label %80

80:                                               ; preds = %78
  %81 = getelementptr inbounds i8, ptr %.1150, i64 18
  %82 = load i16, ptr %81, align 2, !tbaa !27
  %.not130 = icmp ugt i16 %82, %50
  br i1 %.not130, label %84, label %.split.us

.split.us:                                        ; preds = %80, %68
  %.us-phi160 = phi i16 [ %70, %68 ], [ %82, %80 ]
  %.us-phi161 = phi ptr [ %.1150.us155, %68 ], [ %.1150, %80 ]
  %83 = icmp ult i16 %.us-phi160, %50
  br i1 %83, label %.loopexit, label %132

84:                                               ; preds = %80, %78, %.lr.ph.split.split
  %85 = getelementptr inbounds i8, ptr %.1150, i64 8
  %.1 = load ptr, ptr %85, align 8, !tbaa !20
  %.not127 = icmp eq ptr %.1, %57
  br i1 %.not127, label %.loopexit, label %.lr.ph.split.split, !llvm.loop !26

.thread:                                          ; preds = %16, %30
  %86 = getelementptr inbounds i8, ptr %12, i64 64
  br label %.loopexit

.loopexit:                                        ; preds = %76, %84, %.lr.ph.split.split.us, %71, %.lr.ph.split.us, %45, %.lr.ph167.split.us, %39, %56, %33, %.split.us, %.split173.us, %.thread
  %.0109.shrunk = phi i16 [ 0, %.thread ], [ %50, %.split.us ], [ 0, %.split173.us ], [ 0, %33 ], [ %50, %56 ], [ 0, %39 ], [ 0, %.lr.ph167.split.us ], [ 0, %45 ], [ %50, %.lr.ph.split.us ], [ %50, %71 ], [ %50, %.lr.ph.split.split.us ], [ %50, %84 ], [ %50, %76 ]
  %.2 = phi ptr [ %86, %.thread ], [ %.us-phi161, %.split.us ], [ %.us-phi175, %.split173.us ], [ %.0105164, %33 ], [ %.1148, %56 ], [ %.0105166.us, %.lr.ph167.split.us ], [ %.0105.us, %39 ], [ %.0105, %45 ], [ %.1.us, %.lr.ph.split.us ], [ %.1150.us155, %.lr.ph.split.split.us ], [ %.1.us156, %71 ], [ %.1150, %76 ], [ %.1, %84 ]
  %87 = getelementptr inbounds i8, ptr %0, i64 464
  %88 = load i64, ptr %87, align 8, !tbaa !28
  %89 = getelementptr inbounds i8, ptr %0, i64 16
  %90 = load ptr, ptr %89, align 8, !tbaa !29
  %91 = getelementptr inbounds i8, ptr %90, i64 11016
  %92 = load i64, ptr %91, align 8, !tbaa !30
  %.not135 = icmp ult i64 %88, %92
  br i1 %.not135, label %93, label %.thread141

93:                                               ; preds = %.loopexit
  %94 = tail call ptr @enet_packet_create(ptr noundef %2, i64 noundef %3, i32 noundef %4) #5
  %95 = icmp eq ptr %94, null
  br i1 %95, label %.thread141, label %96

96:                                               ; preds = %93
  %97 = tail call ptr @enet_malloc(i64 noundef 96) #5
  %98 = icmp eq ptr %97, null
  br i1 %98, label %133, label %99

99:                                               ; preds = %96
  %100 = getelementptr inbounds i8, ptr %1, i64 2
  %101 = load i16, ptr %100, align 1, !tbaa !16
  %102 = getelementptr inbounds i8, ptr %97, i64 16
  store i16 %101, ptr %102, align 8, !tbaa !21
  %103 = getelementptr inbounds i8, ptr %97, i64 18
  store i16 %.0109.shrunk, ptr %103, align 2, !tbaa !27
  %104 = getelementptr inbounds i8, ptr %97, i64 20
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(48) %104, ptr noundef nonnull align 1 dereferenceable(48) %1, i64 48, i1 false), !tbaa.struct !33
  %105 = getelementptr inbounds i8, ptr %97, i64 68
  store i32 %5, ptr %105, align 4, !tbaa !34
  %106 = getelementptr inbounds i8, ptr %97, i64 72
  store i32 %5, ptr %106, align 8, !tbaa !35
  %107 = getelementptr inbounds i8, ptr %97, i64 88
  store ptr %94, ptr %107, align 8, !tbaa !36
  %108 = getelementptr inbounds i8, ptr %97, i64 80
  store ptr null, ptr %108, align 8, !tbaa !37
  %.not136 = icmp eq i32 %5, 0
  br i1 %.not136, label %119, label %109

109:                                              ; preds = %99
  %110 = icmp ult i32 %5, 1048577
  br i1 %110, label %111, label %.thread140

111:                                              ; preds = %109
  %112 = add nuw nsw i32 %5, 31
  %113 = lshr i32 %112, 3
  %114 = and i32 %113, 524284
  %115 = zext nneg i32 %114 to i64
  %116 = tail call ptr @enet_malloc(i64 noundef %115) #5
  store ptr %116, ptr %108, align 8, !tbaa !37
  %117 = icmp eq ptr %116, null
  br i1 %117, label %.thread140, label %118

.thread140:                                       ; preds = %109, %111
  tail call void @enet_free(ptr noundef nonnull %97) #5
  br label %133

118:                                              ; preds = %111
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 %116, i8 0, i64 %115, i1 false)
  br label %119

119:                                              ; preds = %99, %118
  %120 = load i64, ptr %94, align 8, !tbaa !38
  %121 = add i64 %120, 1
  store i64 %121, ptr %94, align 8, !tbaa !38
  %122 = getelementptr inbounds i8, ptr %94, i64 24
  %123 = load i64, ptr %122, align 8, !tbaa !40
  %124 = load i64, ptr %87, align 8, !tbaa !28
  %125 = add i64 %124, %123
  store i64 %125, ptr %87, align 8, !tbaa !28
  %126 = load ptr, ptr %.2, align 8, !tbaa !41
  %127 = tail call ptr @enet_list_insert(ptr noundef %126, ptr noundef nonnull %97) #5
  %128 = load i8, ptr %1, align 1, !tbaa !16
  %129 = and i8 %128, 15
  switch i8 %129, label %131 [
    i8 8, label %130
    i8 6, label %130
  ]

130:                                              ; preds = %119, %119
  tail call void @enet_peer_dispatch_incoming_reliable_commands(ptr noundef nonnull %0, ptr noundef %12)
  br label %137

131:                                              ; preds = %119
  tail call void @enet_peer_dispatch_incoming_unreliable_commands(ptr noundef nonnull %0, ptr noundef %12)
  br label %137

132:                                              ; preds = %30, %.split.us, %53, %.split173.us, %31, %19, %6
  %.not137 = icmp eq i32 %5, 0
  br i1 %.not137, label %137, label %.thread141

.thread141:                                       ; preds = %132, %.loopexit, %93
  br label %137

133:                                              ; preds = %.thread140, %96
  %134 = load i64, ptr %94, align 8, !tbaa !38
  %135 = icmp eq i64 %134, 0
  br i1 %135, label %136, label %137

136:                                              ; preds = %133
  tail call void @enet_packet_destroy(ptr noundef nonnull %94) #5
  br label %137

137:                                              ; preds = %.thread141, %133, %136, %132, %130, %131
  %.0106 = phi ptr [ %97, %131 ], [ %97, %130 ], [ @enet_peer_queue_incoming_command.dummyCommand, %132 ], [ null, %136 ], [ null, %133 ], [ null, %.thread141 ]
  ret ptr %.0106
}

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

declare void @enet_packet_destroy(ptr noundef) local_unnamed_addr #1

attributes #0 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !8, i64 64}
!6 = !{!"_ENetPeer", !7, i64 0, !8, i64 16, !11, i64 24, !11, i64 26, !12, i64 28, !9, i64 32, !9, i64 33, !13, i64 36, !8, i64 48, !12, i64 56, !8, i64 64, !14, i64 72, !12, i64 80, !12, i64 84, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !12, i64 148, !12, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !12, i64 172, !12, i64 176, !12, i64 180, !12, i64 184, !12, i64 188, !12, i64 192, !12, i64 196, !12, i64 200, !12, i64 204, !12, i64 208, !12, i64 212, !12, i64 216, !11, i64 220, !15, i64 224, !15, i64 240, !15, i64 256, !15, i64 272, !15, i64 288, !15, i64 304, !12, i64 320, !11, i64 324, !11, i64 326, !9, i64 328, !12, i64 456, !14, i64 464}
!7 = !{!"_ENetListNode", !8, i64 0, !8, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"short", !9, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!"_ENetAddress", !12, i64 0, !11, i64 4}
!14 = !{!"long", !9, i64 0}
!15 = !{!"_ENetList", !7, i64 0}
!16 = !{!9, !9, i64 0}
!17 = !{!6, !12, i64 56}
!18 = !{!19, !11, i64 38}
!19 = !{!"_ENetChannel", !11, i64 0, !11, i64 2, !11, i64 4, !9, i64 6, !11, i64 38, !11, i64 40, !15, i64 48, !15, i64 64}
!20 = !{!7, !8, i64 8}
!21 = !{!22, !11, i64 16}
!22 = !{!"_ENetIncomingCommand", !7, i64 0, !11, i64 16, !11, i64 18, !9, i64 20, !12, i64 68, !12, i64 72, !8, i64 80, !8, i64 88}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!19, !11, i64 40}
!26 = distinct !{!26, !24}
!27 = !{!22, !11, i64 18}
!28 = !{!6, !14, i64 464}
!29 = !{!6, !8, i64 16}
!30 = !{!31, !14, i64 11016}
!31 = !{!"_ENetHost", !12, i64 0, !13, i64 4, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !8, i64 40, !14, i64 48, !14, i64 56, !12, i64 64, !15, i64 72, !12, i64 88, !14, i64 96, !11, i64 104, !9, i64 106, !14, i64 1648, !9, i64 1656, !14, i64 2696, !8, i64 2704, !32, i64 2712, !9, i64 2744, !13, i64 10936, !8, i64 10944, !14, i64 10952, !12, i64 10960, !12, i64 10964, !12, i64 10968, !12, i64 10972, !8, i64 10976, !14, i64 10984, !14, i64 10992, !14, i64 11000, !14, i64 11008, !14, i64 11016}
!32 = !{!"_ENetCompressor", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24}
!33 = !{i64 0, i64 48, !16}
!34 = !{!22, !12, i64 68}
!35 = !{!22, !12, i64 72}
!36 = !{!22, !8, i64 88}
!37 = !{!22, !8, i64 80}
!38 = !{!39, !14, i64 0}
!39 = !{!"_ENetPacket", !14, i64 0, !12, i64 8, !8, i64 16, !14, i64 24, !8, i64 32, !8, i64 40}
!40 = !{!39, !14, i64 24}
!41 = !{!7, !8, i64 0}


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