; 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._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._ENetListNode = type { ptr, ptr }
%struct._ENetAddress = type { i32, i16 }
%struct._ENetList = type { %struct._ENetListNode }
%struct._ENetOutgoingCommand = type { %struct._ENetListNode, i16, i16, i32, i32, i32, i32, i16, i16, %union._ENetProtocol, 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._ENetProtocolSendUnreliable = type { %struct._ENetProtocolCommandHeader, i16, i16 }
%struct._ENetProtocolSendUnsequenced = type { %struct._ENetProtocolCommandHeader, i16, i16 }

; 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_list_insert(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @enet_peer_setup_outgoing_command(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  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) #4
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct._ENetPeer, ptr %6, i32 0, i32 10
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %9, i32 0, i32 9
  %11 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %10, i32 0, i32 1
  %12 = load i8, ptr %11, align 1, !tbaa !17
  %13 = zext i8 %12 to i64
  %14 = getelementptr inbounds %struct._ENetChannel, ptr %8, i64 %13
  store ptr %14, ptr %5, align 8, !tbaa !5
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %15, i32 0, i32 9
  %17 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %16, i32 0, i32 0
  %18 = load i8, ptr %17, align 8, !tbaa !17
  %19 = call i64 @enet_protocol_command_size(i8 noundef zeroext %18)
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %20, i32 0, i32 7
  %22 = load i16, ptr %21, align 4, !tbaa !18
  %23 = zext i16 %22 to i64
  %24 = add i64 %19, %23
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._ENetPeer, ptr %25, i32 0, i32 17
  %27 = load i32, ptr %26, align 4, !tbaa !20
  %28 = zext i32 %27 to i64
  %29 = add i64 %28, %24
  %30 = trunc i64 %29 to i32
  store i32 %30, ptr %26, align 4, !tbaa !20
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %31, i32 0, i32 9
  %33 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %32, i32 0, i32 1
  %34 = load i8, ptr %33, align 1, !tbaa !17
  %35 = zext i8 %34 to i32
  %36 = icmp eq i32 %35, 255
  br i1 %36, label %37, label %49

37:                                               ; preds = %2
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._ENetPeer, ptr %38, i32 0, i32 47
  %40 = load i16, ptr %39, align 4, !tbaa !21
  %41 = add i16 %40, 1
  store i16 %41, ptr %39, align 4, !tbaa !21
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct._ENetPeer, ptr %42, i32 0, i32 47
  %44 = load i16, ptr %43, align 4, !tbaa !21
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %45, i32 0, i32 1
  store i16 %44, ptr %46, align 8, !tbaa !22
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %47, i32 0, i32 2
  store i16 0, ptr %48, align 2, !tbaa !23
  br label %111

49:                                               ; preds = %2
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %50, i32 0, i32 9
  %52 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %51, i32 0, i32 0
  %53 = load i8, ptr %52, align 8, !tbaa !17
  %54 = zext i8 %53 to i32
  %55 = and i32 %54, 128
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %71

57:                                               ; preds = %49
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._ENetChannel, ptr %58, i32 0, i32 0
  %60 = load i16, ptr %59, align 8, !tbaa !24
  %61 = add i16 %60, 1
  store i16 %61, ptr %59, align 8, !tbaa !24
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._ENetChannel, ptr %62, i32 0, i32 1
  store i16 0, ptr %63, align 2, !tbaa !26
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._ENetChannel, ptr %64, i32 0, i32 0
  %66 = load i16, ptr %65, align 8, !tbaa !24
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %67, i32 0, i32 1
  store i16 %66, ptr %68, align 8, !tbaa !22
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %69, i32 0, i32 2
  store i16 0, ptr %70, align 2, !tbaa !23
  br label %110

71:                                               ; preds = %49
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %72, i32 0, i32 9
  %74 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %73, i32 0, i32 0
  %75 = load i8, ptr %74, align 8, !tbaa !17
  %76 = zext i8 %75 to i32
  %77 = and i32 %76, 64
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %88

79:                                               ; preds = %71
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._ENetPeer, ptr %80, i32 0, i32 56
  %82 = load i16, ptr %81, align 2, !tbaa !27
  %83 = add i16 %82, 1
  store i16 %83, ptr %81, align 2, !tbaa !27
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %84, i32 0, i32 1
  store i16 0, ptr %85, align 8, !tbaa !22
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %86, i32 0, i32 2
  store i16 0, ptr %87, align 2, !tbaa !23
  br label %109

88:                                               ; preds = %71
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %89, i32 0, i32 6
  %91 = load i32, ptr %90, align 8, !tbaa !28
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %93, label %98

93:                                               ; preds = %88
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._ENetChannel, ptr %94, i32 0, i32 1
  %96 = load i16, ptr %95, align 2, !tbaa !26
  %97 = add i16 %96, 1
  store i16 %97, ptr %95, align 2, !tbaa !26
  br label %98

98:                                               ; preds = %93, %88
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._ENetChannel, ptr %99, i32 0, i32 0
  %101 = load i16, ptr %100, align 8, !tbaa !24
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %102, i32 0, i32 1
  store i16 %101, ptr %103, align 8, !tbaa !22
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._ENetChannel, ptr %104, i32 0, i32 1
  %106 = load i16, ptr %105, align 2, !tbaa !26
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %107, i32 0, i32 2
  store i16 %106, ptr %108, align 2, !tbaa !23
  br label %109

109:                                              ; preds = %98, %79
  br label %110

110:                                              ; preds = %109, %57
  br label %111

111:                                              ; preds = %110, %37
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %112, i32 0, i32 8
  store i16 0, ptr %113, align 2, !tbaa !29
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %114, i32 0, i32 3
  store i32 0, ptr %115, align 4, !tbaa !30
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %116, i32 0, i32 4
  store i32 0, ptr %117, align 8, !tbaa !31
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %118, i32 0, i32 5
  store i32 0, ptr %119, align 4, !tbaa !32
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %120, i32 0, i32 1
  %122 = load i16, ptr %121, align 8, !tbaa !22
  %123 = call zeroext i16 @__bswap_16(i16 noundef zeroext %122)
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %124, i32 0, i32 9
  %126 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %125, i32 0, i32 2
  store i16 %123, ptr %126, align 2, !tbaa !17
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %127, i32 0, i32 9
  %129 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %128, i32 0, i32 0
  %130 = load i8, ptr %129, align 8, !tbaa !17
  %131 = zext i8 %130 to i32
  %132 = and i32 %131, 15
  switch i32 %132, label %149 [
    i32 7, label %133
    i32 9, label %141
  ]

133:                                              ; preds = %111
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %134, i32 0, i32 2
  %136 = load i16, ptr %135, align 2, !tbaa !23
  %137 = call zeroext i16 @__bswap_16(i16 noundef zeroext %136)
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %138, i32 0, i32 9
  %140 = getelementptr inbounds %struct._ENetProtocolSendUnreliable, ptr %139, i32 0, i32 1
  store i16 %137, ptr %140, align 4, !tbaa !17
  br label %150

141:                                              ; preds = %111
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct._ENetPeer, ptr %142, i32 0, i32 56
  %144 = load i16, ptr %143, align 2, !tbaa !27
  %145 = call zeroext i16 @__bswap_16(i16 noundef zeroext %144)
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %146, i32 0, i32 9
  %148 = getelementptr inbounds %struct._ENetProtocolSendUnsequenced, ptr %147, i32 0, i32 1
  store i16 %145, ptr %148, align 4, !tbaa !17
  br label %150

149:                                              ; preds = %111
  br label %150

150:                                              ; preds = %149, %141, %133
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct._ENetOutgoingCommand, ptr %151, i32 0, i32 9
  %153 = getelementptr inbounds %struct._ENetProtocolCommandHeader, ptr %152, i32 0, i32 0
  %154 = load i8, ptr %153, align 8, !tbaa !17
  %155 = zext i8 %154 to i32
  %156 = and i32 %155, 128
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %158, label %164

158:                                              ; preds = %150
  %159 = load ptr, ptr %3, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct._ENetPeer, ptr %159, i32 0, i32 51
  %161 = getelementptr inbounds %struct._ENetList, ptr %160, i32 0, i32 0
  %162 = load ptr, ptr %4, align 8, !tbaa !5
  %163 = call ptr @enet_list_insert(ptr noundef %161, ptr noundef %162)
  br label %170

164:                                              ; preds = %150
  %165 = load ptr, ptr %3, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct._ENetPeer, ptr %165, i32 0, i32 52
  %167 = getelementptr inbounds %struct._ENetList, ptr %166, i32 0, i32 0
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = call ptr @enet_list_insert(ptr noundef %167, ptr noundef %168)
  br label %170

170:                                              ; preds = %164, %158
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

declare i64 @enet_protocol_command_size(i8 noundef zeroext) #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 = { 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 }

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


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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @enet_peer_setup_outgoing_command(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 64
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 40
  %6 = getelementptr inbounds i8, ptr %1, i64 41
  %7 = load i8, ptr %6, align 1, !tbaa !16
  %8 = zext i8 %7 to i64
  %9 = getelementptr inbounds %struct._ENetChannel, ptr %4, i64 %8
  %10 = load i8, ptr %5, align 8, !tbaa !16
  %11 = tail call i64 @enet_protocol_command_size(i8 noundef zeroext %10) #3
  %12 = getelementptr inbounds i8, ptr %1, i64 36
  %13 = load i16, ptr %12, align 4, !tbaa !17
  %14 = zext i16 %13 to i64
  %15 = add i64 %11, %14
  %16 = getelementptr inbounds i8, ptr %0, i64 100
  %17 = load i32, ptr %16, align 4, !tbaa !19
  %18 = trunc i64 %15 to i32
  %19 = add i32 %17, %18
  store i32 %19, ptr %16, align 4, !tbaa !19
  %20 = load i8, ptr %6, align 1, !tbaa !16
  %21 = icmp eq i8 %20, -1
  br i1 %21, label %22, label %26

22:                                               ; preds = %2
  %23 = getelementptr inbounds i8, ptr %0, i64 220
  %24 = load i16, ptr %23, align 4, !tbaa !20
  %25 = add i16 %24, 1
  store i16 %25, ptr %23, align 4, !tbaa !20
  br label %47

26:                                               ; preds = %2
  %27 = load i8, ptr %5, align 8, !tbaa !16
  %.not = icmp sgt i8 %27, -1
  br i1 %.not, label %32, label %28

28:                                               ; preds = %26
  %29 = load i16, ptr %9, align 8, !tbaa !21
  %30 = add i16 %29, 1
  store i16 %30, ptr %9, align 8, !tbaa !21
  %31 = getelementptr inbounds i8, ptr %9, i64 2
  store i16 0, ptr %31, align 2, !tbaa !23
  br label %47

32:                                               ; preds = %26
  %.not42 = icmp ult i8 %27, 64
  br i1 %.not42, label %37, label %33

33:                                               ; preds = %32
  %34 = getelementptr inbounds i8, ptr %0, i64 326
  %35 = load i16, ptr %34, align 2, !tbaa !24
  %36 = add i16 %35, 1
  store i16 %36, ptr %34, align 2, !tbaa !24
  br label %47

37:                                               ; preds = %32
  %38 = getelementptr inbounds i8, ptr %1, i64 32
  %39 = load i32, ptr %38, align 8, !tbaa !25
  %40 = icmp eq i32 %39, 0
  %41 = getelementptr inbounds i8, ptr %9, i64 2
  %42 = load i16, ptr %41, align 2, !tbaa !23
  br i1 %40, label %43, label %._crit_edge

43:                                               ; preds = %37
  %44 = add i16 %42, 1
  store i16 %44, ptr %41, align 2, !tbaa !23
  br label %._crit_edge

._crit_edge:                                      ; preds = %37, %43
  %45 = phi i16 [ %44, %43 ], [ %42, %37 ]
  %46 = load i16, ptr %9, align 8, !tbaa !21
  br label %47

47:                                               ; preds = %28, %._crit_edge, %33, %22
  %.sink45 = phi i16 [ %30, %28 ], [ %46, %._crit_edge ], [ 0, %33 ], [ %25, %22 ]
  %.sink = phi i16 [ 0, %28 ], [ %45, %._crit_edge ], [ 0, %33 ], [ 0, %22 ]
  %48 = getelementptr inbounds i8, ptr %1, i64 16
  store i16 %.sink45, ptr %48, align 8, !tbaa !26
  %49 = getelementptr inbounds i8, ptr %1, i64 18
  store i16 %.sink, ptr %49, align 2, !tbaa !27
  %50 = getelementptr inbounds i8, ptr %1, i64 38
  store i16 0, ptr %50, align 2, !tbaa !28
  %51 = getelementptr inbounds i8, ptr %1, i64 20
  store i32 0, ptr %51, align 4, !tbaa !29
  %52 = getelementptr inbounds i8, ptr %1, i64 24
  store i32 0, ptr %52, align 8, !tbaa !30
  %53 = getelementptr inbounds i8, ptr %1, i64 28
  store i32 0, ptr %53, align 4, !tbaa !31
  %54 = tail call zeroext i16 @__bswap_16(i16 noundef zeroext %.sink45)
  %55 = getelementptr inbounds i8, ptr %1, i64 42
  store i16 %54, ptr %55, align 2, !tbaa !16
  %56 = load i8, ptr %5, align 8, !tbaa !16
  %57 = and i8 %56, 15
  switch i8 %57, label %65 [
    i8 7, label %58
    i8 9, label %60
  ]

58:                                               ; preds = %47
  %59 = getelementptr inbounds i8, ptr %1, i64 18
  br label %thread-pre-split

60:                                               ; preds = %47
  %61 = getelementptr inbounds i8, ptr %0, i64 326
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %58, %60
  %.sink50 = phi ptr [ %59, %58 ], [ %61, %60 ]
  %62 = load i16, ptr %.sink50, align 2, !tbaa !32
  %63 = tail call zeroext i16 @__bswap_16(i16 noundef zeroext %62)
  %64 = getelementptr inbounds i8, ptr %1, i64 44
  store i16 %63, ptr %64, align 4, !tbaa !16
  %.pr = load i8, ptr %5, align 8, !tbaa !16
  br label %65

65:                                               ; preds = %thread-pre-split, %47
  %66 = phi i8 [ %.pr, %thread-pre-split ], [ %56, %47 ]
  %.not43 = icmp sgt i8 %66, -1
  %. = select i1 %.not43, i64 288, i64 272
  %67 = getelementptr inbounds i8, ptr %0, i64 %.
  %68 = tail call ptr @enet_list_insert(ptr noundef nonnull %67, ptr noundef nonnull %1) #3
  ret void
}

declare i64 @enet_protocol_command_size(i8 noundef zeroext) 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 = { 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, !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 = !{!18, !11, i64 36}
!18 = !{!"_ENetOutgoingCommand", !7, i64 0, !11, i64 16, !11, i64 18, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !11, i64 36, !11, i64 38, !9, i64 40, !8, i64 88}
!19 = !{!6, !12, i64 100}
!20 = !{!6, !11, i64 220}
!21 = !{!22, !11, i64 0}
!22 = !{!"_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}
!23 = !{!22, !11, i64 2}
!24 = !{!6, !11, i64 326}
!25 = !{!18, !12, i64 32}
!26 = !{!18, !11, i64 16}
!27 = !{!18, !11, i64 18}
!28 = !{!18, !11, i64 38}
!29 = !{!18, !12, i64 20}
!30 = !{!18, !12, i64 24}
!31 = !{!18, !12, i64 28}
!32 = !{!11, !11, i64 0}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass