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

; 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 ptr @enet_list_insert(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @enet_peer_dispatch_incoming_unreliable_commands(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i16, align 2
  %11 = alloca i16, align 2
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct._ENetChannel, ptr %12, i32 0, i32 7
  %14 = getelementptr inbounds %struct._ENetList, ptr %13, i32 0, i32 0
  %15 = getelementptr inbounds %struct._ENetListNode, ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %16, ptr %7, align 8, !tbaa !5
  store ptr %16, ptr %6, align 8, !tbaa !5
  store ptr %16, ptr %5, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %179, %2
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct._ENetChannel, ptr %19, i32 0, i32 7
  %21 = getelementptr inbounds %struct._ENetList, ptr %20, i32 0, i32 0
  %22 = icmp ne ptr %18, %21
  br i1 %22, label %23, label %183

23:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %24, ptr %8, align 8, !tbaa !5
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %25, i32 0, i32 3
  %27 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %26, i32 0, i32 0
  %28 = load i8, ptr %27, align 4, !tbaa !14
  %29 = zext i8 %28 to i32
  %30 = and i32 %29, 15
  %31 = icmp eq i32 %30, 9
  br i1 %31, label %32, label %33

32:                                               ; preds = %23
  store i32 4, ptr %9, align 4
  br label %176

33:                                               ; preds = %23
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %34, i32 0, i32 1
  %36 = load i16, ptr %35, align 8, !tbaa !15
  %37 = zext i16 %36 to i32
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._ENetChannel, ptr %38, i32 0, i32 4
  %40 = load i16, ptr %39, align 2, !tbaa !18
  %41 = zext i16 %40 to i32
  %42 = icmp eq i32 %37, %41
  br i1 %42, label %43, label %94

43:                                               ; preds = %33
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %44, i32 0, i32 5
  %46 = load i32, ptr %45, align 8, !tbaa !19
  %47 = icmp ule i32 %46, 0
  br i1 %47, label %48, label %54

48:                                               ; preds = %43
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %49, i32 0, i32 2
  %51 = load i16, ptr %50, align 2, !tbaa !20
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._ENetChannel, ptr %52, i32 0, i32 5
  store i16 %51, ptr %53, align 8, !tbaa !21
  store i32 4, ptr %9, align 4
  br label %176

54:                                               ; preds = %43
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = icmp ne ptr %55, %56
  br i1 %57, label %58, label %84

58:                                               ; preds = %54
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._ENetPeer, ptr %59, i32 0, i32 53
  %61 = getelementptr inbounds %struct._ENetList, ptr %60, i32 0, i32 0
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._ENetListNode, ptr %63, i32 0, i32 1
  %65 = load ptr, ptr %64, align 8, !tbaa !22
  %66 = call ptr @enet_list_move(ptr noundef %61, ptr noundef %62, ptr noundef %65)
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._ENetPeer, ptr %67, i32 0, i32 54
  %69 = load i32, ptr %68, align 8, !tbaa !23
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %82, label %71

71:                                               ; preds = %58
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._ENetPeer, ptr %72, i32 0, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !27
  %75 = getelementptr inbounds %struct._ENetHost, ptr %74, i32 0, i32 14
  %76 = getelementptr inbounds %struct._ENetList, ptr %75, i32 0, i32 0
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._ENetPeer, ptr %77, i32 0, i32 0
  %79 = call ptr @enet_list_insert(ptr noundef %76, ptr noundef %78)
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._ENetPeer, ptr %80, i32 0, i32 54
  store i32 1, ptr %81, align 8, !tbaa !23
  br label %82

82:                                               ; preds = %71, %58
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %83, ptr %5, align 8, !tbaa !5
  br label %93

84:                                               ; preds = %54
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = icmp ne ptr %85, %86
  br i1 %87, label %88, label %92

88:                                               ; preds = %84
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._ENetListNode, ptr %89, i32 0, i32 1
  %91 = load ptr, ptr %90, align 8, !tbaa !22
  store ptr %91, ptr %5, align 8, !tbaa !5
  br label %92

92:                                               ; preds = %88, %84
  br label %93

93:                                               ; preds = %92, %82
  br label %172

94:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #3
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %95, i32 0, i32 1
  %97 = load i16, ptr %96, align 8, !tbaa !15
  %98 = zext i16 %97 to i32
  %99 = sdiv i32 %98, 4096
  %100 = trunc i32 %99 to i16
  store i16 %100, ptr %10, align 2, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #3
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._ENetChannel, ptr %101, i32 0, i32 4
  %103 = load i16, ptr %102, align 2, !tbaa !18
  %104 = zext i16 %103 to i32
  %105 = sdiv i32 %104, 4096
  %106 = trunc i32 %105 to i16
  store i16 %106, ptr %11, align 2, !tbaa !28
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._ENetIncomingCommand, ptr %107, i32 0, i32 1
  %109 = load i16, ptr %108, align 8, !tbaa !15
  %110 = zext i16 %109 to i32
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._ENetChannel, ptr %111, i32 0, i32 4
  %113 = load i16, ptr %112, align 2, !tbaa !18
  %114 = zext i16 %113 to i32
  %115 = icmp slt i32 %110, %114
  br i1 %115, label %116, label %121

116:                                              ; preds = %94
  %117 = load i16, ptr %10, align 2, !tbaa !28
  %118 = zext i16 %117 to i32
  %119 = add nsw i32 %118, 16
  %120 = trunc i32 %119 to i16
  store i16 %120, ptr %10, align 2, !tbaa !28
  br label %121

121:                                              ; preds = %116, %94
  %122 = load i16, ptr %10, align 2, !tbaa !28
  %123 = zext i16 %122 to i32
  %124 = load i16, ptr %11, align 2, !tbaa !28
  %125 = zext i16 %124 to i32
  %126 = icmp sge i32 %123, %125
  br i1 %126, label %127, label %136

127:                                              ; preds = %121
  %128 = load i16, ptr %10, align 2, !tbaa !28
  %129 = zext i16 %128 to i32
  %130 = load i16, ptr %11, align 2, !tbaa !28
  %131 = zext i16 %130 to i32
  %132 = add nsw i32 %131, 8
  %133 = sub nsw i32 %132, 1
  %134 = icmp slt i32 %129, %133
  br i1 %134, label %135, label %136

135:                                              ; preds = %127
  store i32 2, ptr %9, align 4
  br label %169

136:                                              ; preds = %127, %121
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._ENetListNode, ptr %137, i32 0, i32 0
  %139 = load ptr, ptr %138, align 8, !tbaa !29
  store ptr %139, ptr %5, align 8, !tbaa !5
  %140 = load ptr, ptr %6, align 8, !tbaa !5
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = icmp ne ptr %140, %141
  br i1 %142, label %143, label %168

143:                                              ; preds = %136
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct._ENetPeer, ptr %144, i32 0, i32 53
  %146 = getelementptr inbounds %struct._ENetList, ptr %145, i32 0, i32 0
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct._ENetListNode, ptr %148, i32 0, i32 1
  %150 = load ptr, ptr %149, align 8, !tbaa !22
  %151 = call ptr @enet_list_move(ptr noundef %146, ptr noundef %147, ptr noundef %150)
  %152 = load ptr, ptr %3, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._ENetPeer, ptr %152, i32 0, i32 54
  %154 = load i32, ptr %153, align 8, !tbaa !23
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %167, label %156

156:                                              ; preds = %143
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct._ENetPeer, ptr %157, i32 0, i32 1
  %159 = load ptr, ptr %158, align 8, !tbaa !27
  %160 = getelementptr inbounds %struct._ENetHost, ptr %159, i32 0, i32 14
  %161 = getelementptr inbounds %struct._ENetList, ptr %160, i32 0, i32 0
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct._ENetPeer, ptr %162, i32 0, i32 0
  %164 = call ptr @enet_list_insert(ptr noundef %161, ptr noundef %163)
  %165 = load ptr, ptr %3, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct._ENetPeer, ptr %165, i32 0, i32 54
  store i32 1, ptr %166, align 8, !tbaa !23
  br label %167

167:                                              ; preds = %156, %143
  br label %168

168:                                              ; preds = %167, %136
  store i32 0, ptr %9, align 4
  br label %169

169:                                              ; preds = %168, %135
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #3
  %170 = load i32, ptr %9, align 4
  switch i32 %170, label %176 [
    i32 0, label %171
  ]

171:                                              ; preds = %169
  br label %172

172:                                              ; preds = %171, %93
  %173 = load ptr, ptr %7, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct._ENetListNode, ptr %173, i32 0, i32 0
  %175 = load ptr, ptr %174, align 8, !tbaa !29
  store ptr %175, ptr %6, align 8, !tbaa !5
  store i32 0, ptr %9, align 4
  br label %176

176:                                              ; preds = %172, %169, %48, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %177 = load i32, ptr %9, align 4
  switch i32 %177, label %222 [
    i32 0, label %178
    i32 4, label %179
    i32 2, label %183
  ]

178:                                              ; preds = %176
  br label %179

179:                                              ; preds = %178, %176
  %180 = load ptr, ptr %7, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct._ENetListNode, ptr %180, i32 0, i32 0
  %182 = load ptr, ptr %181, align 8, !tbaa !29
  store ptr %182, ptr %7, align 8, !tbaa !5
  br label %17, !llvm.loop !30

183:                                              ; preds = %176, %17
  %184 = load ptr, ptr %6, align 8, !tbaa !5
  %185 = load ptr, ptr %7, align 8, !tbaa !5
  %186 = icmp ne ptr %184, %185
  br i1 %186, label %187, label %213

187:                                              ; preds = %183
  %188 = load ptr, ptr %3, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct._ENetPeer, ptr %188, i32 0, i32 53
  %190 = getelementptr inbounds %struct._ENetList, ptr %189, i32 0, i32 0
  %191 = load ptr, ptr %6, align 8, !tbaa !5
  %192 = load ptr, ptr %7, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct._ENetListNode, ptr %192, i32 0, i32 1
  %194 = load ptr, ptr %193, align 8, !tbaa !22
  %195 = call ptr @enet_list_move(ptr noundef %190, ptr noundef %191, ptr noundef %194)
  %196 = load ptr, ptr %3, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct._ENetPeer, ptr %196, i32 0, i32 54
  %198 = load i32, ptr %197, align 8, !tbaa !23
  %199 = icmp ne i32 %198, 0
  br i1 %199, label %211, label %200

200:                                              ; preds = %187
  %201 = load ptr, ptr %3, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct._ENetPeer, ptr %201, i32 0, i32 1
  %203 = load ptr, ptr %202, align 8, !tbaa !27
  %204 = getelementptr inbounds %struct._ENetHost, ptr %203, i32 0, i32 14
  %205 = getelementptr inbounds %struct._ENetList, ptr %204, i32 0, i32 0
  %206 = load ptr, ptr %3, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct._ENetPeer, ptr %206, i32 0, i32 0
  %208 = call ptr @enet_list_insert(ptr noundef %205, ptr noundef %207)
  %209 = load ptr, ptr %3, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct._ENetPeer, ptr %209, i32 0, i32 54
  store i32 1, ptr %210, align 8, !tbaa !23
  br label %211

211:                                              ; preds = %200, %187
  %212 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %212, ptr %5, align 8, !tbaa !5
  br label %213

213:                                              ; preds = %211, %183
  %214 = load ptr, ptr %4, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct._ENetChannel, ptr %214, i32 0, i32 7
  %216 = load ptr, ptr %4, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct._ENetChannel, ptr %216, i32 0, i32 7
  %218 = getelementptr inbounds %struct._ENetList, ptr %217, i32 0, i32 0
  %219 = getelementptr inbounds %struct._ENetListNode, ptr %218, i32 0, i32 0
  %220 = load ptr, ptr %219, align 8, !tbaa !9
  %221 = load ptr, ptr %5, align 8, !tbaa !5
  call void @enet_peer_remove_incoming_commands(ptr noundef %215, ptr noundef %220, ptr noundef %221)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret void

222:                                              ; preds = %176
  unreachable
}

declare ptr @enet_list_move(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @enet_peer_remove_incoming_commands(ptr noundef, ptr noundef, ptr noundef) #2

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 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 #3 = { 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, !6, i64 64}
!10 = !{!"_ENetChannel", !11, i64 0, !11, i64 2, !11, i64 4, !7, i64 6, !11, i64 38, !11, i64 40, !12, i64 48, !12, i64 64}
!11 = !{!"short", !7, i64 0}
!12 = !{!"_ENetList", !13, i64 0}
!13 = !{!"_ENetListNode", !6, i64 0, !6, i64 8}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !11, i64 16}
!16 = !{!"_ENetIncomingCommand", !13, i64 0, !11, i64 16, !11, i64 18, !7, i64 20, !17, i64 68, !17, i64 72, !6, i64 80, !6, i64 88}
!17 = !{!"int", !7, i64 0}
!18 = !{!10, !11, i64 38}
!19 = !{!16, !17, i64 72}
!20 = !{!16, !11, i64 18}
!21 = !{!10, !11, i64 40}
!22 = !{!13, !6, i64 8}
!23 = !{!24, !17, i64 320}
!24 = !{!"_ENetPeer", !13, i64 0, !6, i64 16, !11, i64 24, !11, i64 26, !17, i64 28, !7, i64 32, !7, i64 33, !25, i64 36, !6, i64 48, !17, i64 56, !6, i64 64, !26, i64 72, !17, i64 80, !17, i64 84, !17, i64 88, !17, i64 92, !17, i64 96, !17, i64 100, !17, i64 104, !17, i64 108, !17, i64 112, !17, i64 116, !17, i64 120, !17, i64 124, !17, i64 128, !17, i64 132, !17, i64 136, !17, i64 140, !17, i64 144, !17, i64 148, !17, i64 152, !17, i64 156, !17, i64 160, !17, i64 164, !17, i64 168, !17, i64 172, !17, i64 176, !17, i64 180, !17, i64 184, !17, i64 188, !17, i64 192, !17, i64 196, !17, i64 200, !17, i64 204, !17, i64 208, !17, i64 212, !17, i64 216, !11, i64 220, !12, i64 224, !12, i64 240, !12, i64 256, !12, i64 272, !12, i64 288, !12, i64 304, !17, i64 320, !11, i64 324, !11, i64 326, !7, i64 328, !17, i64 456, !26, i64 464}
!25 = !{!"_ENetAddress", !17, i64 0, !11, i64 4}
!26 = !{!"long", !7, i64 0}
!27 = !{!24, !6, i64 16}
!28 = !{!11, !11, i64 0}
!29 = !{!13, !6, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


; 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"

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

; Function Attrs: nounwind uwtable
define dso_local void @enet_peer_dispatch_incoming_unreliable_commands(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %1, i64 64
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %.not90 = icmp eq ptr %4, %3
  br i1 %.not90, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %5 = getelementptr inbounds i8, ptr %1, i64 38
  %6 = getelementptr inbounds i8, ptr %0, i64 304
  %7 = getelementptr inbounds i8, ptr %0, i64 320
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = getelementptr inbounds i8, ptr %1, i64 40
  br label %10

10:                                               ; preds = %.lr.ph, %60
  %.094 = phi ptr [ %4, %.lr.ph ], [ %.3.ph, %60 ]
  %.06193 = phi ptr [ %4, %.lr.ph ], [ %.162.ph, %60 ]
  %.06491 = phi ptr [ %4, %.lr.ph ], [ %61, %60 ]
  %11 = getelementptr inbounds i8, ptr %.06491, i64 20
  %12 = load i8, ptr %11, align 4, !tbaa !13
  %13 = and i8 %12, 15
  %14 = icmp eq i8 %13, 9
  br i1 %14, label %60, label %15

15:                                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %.06491, i64 16
  %17 = load i16, ptr %16, align 8, !tbaa !14
  %18 = load i16, ptr %5, align 2, !tbaa !17
  %19 = icmp eq i16 %17, %18
  br i1 %19, label %20, label %41

20:                                               ; preds = %15
  %21 = getelementptr inbounds i8, ptr %.06491, i64 72
  %22 = load i32, ptr %21, align 8, !tbaa !18
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %27

24:                                               ; preds = %20
  %25 = getelementptr inbounds i8, ptr %.06491, i64 18
  %26 = load i16, ptr %25, align 2, !tbaa !19
  store i16 %26, ptr %9, align 8, !tbaa !20
  br label %60

27:                                               ; preds = %20
  %.not72 = icmp eq ptr %.06193, %.06491
  br i1 %.not72, label %37, label %28

28:                                               ; preds = %27
  %29 = getelementptr inbounds i8, ptr %.06491, i64 8
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  %31 = tail call ptr @enet_list_move(ptr noundef nonnull %6, ptr noundef %.06193, ptr noundef %30) #2
  %32 = load i32, ptr %7, align 8, !tbaa !22
  %.not74 = icmp eq i32 %32, 0
  br i1 %.not74, label %33, label %.thread

33:                                               ; preds = %28
  %34 = load ptr, ptr %8, align 8, !tbaa !26
  %35 = getelementptr inbounds i8, ptr %34, i64 72
  %36 = tail call ptr @enet_list_insert(ptr noundef nonnull %35, ptr noundef nonnull %0) #2
  store i32 1, ptr %7, align 8, !tbaa !22
  br label %.thread

37:                                               ; preds = %27
  %.not73 = icmp eq ptr %.094, %.06193
  br i1 %.not73, label %.thread, label %38

38:                                               ; preds = %37
  %39 = getelementptr inbounds i8, ptr %.06491, i64 8
  %40 = load ptr, ptr %39, align 8, !tbaa !21
  br label %.thread

41:                                               ; preds = %15
  %42 = lshr i16 %17, 12
  %43 = lshr i16 %18, 12
  %44 = icmp ult i16 %17, %18
  %45 = or disjoint i16 %42, 16
  %spec.select = select i1 %44, i16 %45, i16 %42
  %.not69 = icmp uge i16 %spec.select, %43
  %46 = add nuw nsw i16 %43, 7
  %47 = icmp ult i16 %spec.select, %46
  %or.cond = select i1 %.not69, i1 %47, i1 false
  br i1 %or.cond, label %._crit_edge, label %48

48:                                               ; preds = %41
  %49 = load ptr, ptr %.06491, align 8, !tbaa !27
  %.not70 = icmp eq ptr %.06193, %.06491
  br i1 %.not70, label %.thread, label %50

50:                                               ; preds = %48
  %51 = getelementptr inbounds i8, ptr %.06491, i64 8
  %52 = load ptr, ptr %51, align 8, !tbaa !21
  %53 = tail call ptr @enet_list_move(ptr noundef nonnull %6, ptr noundef %.06193, ptr noundef %52) #2
  %54 = load i32, ptr %7, align 8, !tbaa !22
  %.not71 = icmp eq i32 %54, 0
  br i1 %.not71, label %55, label %.thread

55:                                               ; preds = %50
  %56 = load ptr, ptr %8, align 8, !tbaa !26
  %57 = getelementptr inbounds i8, ptr %56, i64 72
  %58 = tail call ptr @enet_list_insert(ptr noundef nonnull %57, ptr noundef nonnull %0) #2
  store i32 1, ptr %7, align 8, !tbaa !22
  br label %.thread

.thread:                                          ; preds = %48, %55, %50, %28, %33, %38, %37
  %.2 = phi ptr [ %40, %38 ], [ %.094, %37 ], [ %.06491, %33 ], [ %.06491, %28 ], [ %49, %50 ], [ %49, %55 ], [ %49, %48 ]
  %59 = load ptr, ptr %.06491, align 8, !tbaa !27
  br label %60

60:                                               ; preds = %24, %.thread, %10
  %.162.ph = phi ptr [ %.06193, %10 ], [ %59, %.thread ], [ %.06193, %24 ]
  %.3.ph = phi ptr [ %.094, %10 ], [ %.2, %.thread ], [ %.094, %24 ]
  %61 = load ptr, ptr %.06491, align 8, !tbaa !27
  %.not = icmp eq ptr %61, %3
  br i1 %.not, label %._crit_edge, label %10, !llvm.loop !28

._crit_edge:                                      ; preds = %60, %41
  %.064.lcssa = phi ptr [ %61, %60 ], [ %.06491, %41 ]
  %.061.lcssa = phi ptr [ %.162.ph, %60 ], [ %.06193, %41 ]
  %.0.lcssa = phi ptr [ %.3.ph, %60 ], [ %.094, %41 ]
  %.not75 = icmp eq ptr %.061.lcssa, %.064.lcssa
  br i1 %.not75, label %._crit_edge.thread, label %62

62:                                               ; preds = %._crit_edge
  %63 = getelementptr inbounds i8, ptr %0, i64 304
  %64 = getelementptr inbounds i8, ptr %.064.lcssa, i64 8
  %65 = load ptr, ptr %64, align 8, !tbaa !21
  %66 = tail call ptr @enet_list_move(ptr noundef nonnull %63, ptr noundef %.061.lcssa, ptr noundef %65) #2
  %67 = getelementptr inbounds i8, ptr %0, i64 320
  %68 = load i32, ptr %67, align 8, !tbaa !22
  %.not76 = icmp eq i32 %68, 0
  br i1 %.not76, label %69, label %._crit_edge.thread

69:                                               ; preds = %62
  %70 = getelementptr inbounds i8, ptr %0, i64 16
  %71 = load ptr, ptr %70, align 8, !tbaa !26
  %72 = getelementptr inbounds i8, ptr %71, i64 72
  %73 = tail call ptr @enet_list_insert(ptr noundef nonnull %72, ptr noundef nonnull %0) #2
  store i32 1, ptr %67, align 8, !tbaa !22
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %2, %62, %69, %._crit_edge
  %.5 = phi ptr [ %.0.lcssa, %._crit_edge ], [ %.064.lcssa, %69 ], [ %.064.lcssa, %62 ], [ %4, %2 ]
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  tail call void @enet_peer_remove_incoming_commands(ptr noundef nonnull %3, ptr noundef %74, ptr noundef %.5)
  ret void
}

declare ptr @enet_list_move(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @enet_peer_remove_incoming_commands(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #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 = { 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 = { 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, !12, i64 64}
!6 = !{!"_ENetChannel", !7, i64 0, !7, i64 2, !7, i64 4, !8, i64 6, !7, i64 38, !7, i64 40, !10, i64 48, !10, i64 64}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_ENetList", !11, i64 0}
!11 = !{!"_ENetListNode", !12, i64 0, !12, i64 8}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!8, !8, i64 0}
!14 = !{!15, !7, i64 16}
!15 = !{!"_ENetIncomingCommand", !11, i64 0, !7, i64 16, !7, i64 18, !8, i64 20, !16, i64 68, !16, i64 72, !12, i64 80, !12, i64 88}
!16 = !{!"int", !8, i64 0}
!17 = !{!6, !7, i64 38}
!18 = !{!15, !16, i64 72}
!19 = !{!15, !7, i64 18}
!20 = !{!6, !7, i64 40}
!21 = !{!11, !12, i64 8}
!22 = !{!23, !16, i64 320}
!23 = !{!"_ENetPeer", !11, i64 0, !12, i64 16, !7, i64 24, !7, i64 26, !16, i64 28, !8, i64 32, !8, i64 33, !24, i64 36, !12, i64 48, !16, i64 56, !12, i64 64, !25, i64 72, !16, i64 80, !16, i64 84, !16, i64 88, !16, i64 92, !16, i64 96, !16, i64 100, !16, i64 104, !16, i64 108, !16, i64 112, !16, i64 116, !16, i64 120, !16, i64 124, !16, i64 128, !16, i64 132, !16, i64 136, !16, i64 140, !16, i64 144, !16, i64 148, !16, i64 152, !16, i64 156, !16, i64 160, !16, i64 164, !16, i64 168, !16, i64 172, !16, i64 176, !16, i64 180, !16, i64 184, !16, i64 188, !16, i64 192, !16, i64 196, !16, i64 200, !16, i64 204, !16, i64 208, !16, i64 212, !16, i64 216, !7, i64 220, !10, i64 224, !10, i64 240, !10, i64 256, !10, i64 272, !10, i64 288, !10, i64 304, !16, i64 320, !7, i64 324, !7, i64 326, !8, i64 328, !16, i64 456, !25, i64 464}
!24 = !{!"_ENetAddress", !16, i64 0, !7, i64 4}
!25 = !{!"long", !8, i64 0}
!26 = !{!23, !12, i64 16}
!27 = !{!11, !12, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


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