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

; 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._ENetEvent = type { i32, ptr, i8, i32, ptr }
%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._ENetList = type { %struct._ENetListNode }
%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.ENetBuffer = type { ptr, i64 }
%struct._ENetCompressor = type { ptr, ptr, ptr, ptr }
%struct._ENetAddress = type { i32, i16 }

declare i32 @enet_time_get() #0

; Function Attrs: nounwind uwtable
declare hidden i32 @enet_protocol_send_outgoing_commands(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @enet_protocol_dispatch_incoming_commands(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @enet_host_service(ptr noundef %0, ptr noundef %1, i32 noundef %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %10 = load ptr, ptr %6, align 8, !tbaa !5
  %11 = icmp ne ptr %10, null
  br i1 %11, label %12, label %26

12:                                               ; preds = %3
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct._ENetEvent, ptr %13, i32 0, i32 0
  store i32 0, ptr %14, align 8, !tbaa !11
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct._ENetEvent, ptr %15, i32 0, i32 1
  store ptr null, ptr %16, align 8, !tbaa !13
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct._ENetEvent, ptr %17, i32 0, i32 4
  store ptr null, ptr %18, align 8, !tbaa !14
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call i32 @enet_protocol_dispatch_incoming_commands(ptr noundef %19, ptr noundef %20)
  switch i32 %21, label %24 [
    i32 1, label %22
    i32 -1, label %23
  ]

22:                                               ; preds = %12
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %158

23:                                               ; preds = %12
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %158

24:                                               ; preds = %12
  br label %25

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %25, %3
  %27 = call i32 @enet_time_get()
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._ENetHost, ptr %28, i32 0, i32 12
  store i32 %27, ptr %29, align 8, !tbaa !15
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._ENetHost, ptr %30, i32 0, i32 12
  %32 = load i32, ptr %31, align 8, !tbaa !15
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = add i32 %33, %32
  store i32 %34, ptr %7, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %153, %26
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._ENetHost, ptr %36, i32 0, i32 12
  %38 = load i32, ptr %37, align 8, !tbaa !15
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._ENetHost, ptr %39, i32 0, i32 4
  %41 = load i32, ptr %40, align 4, !tbaa !23
  %42 = sub i32 %38, %41
  %43 = icmp uge i32 %42, 86400000
  br i1 %43, label %44, label %52

44:                                               ; preds = %35
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._ENetHost, ptr %45, i32 0, i32 4
  %47 = load i32, ptr %46, align 4, !tbaa !23
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._ENetHost, ptr %48, i32 0, i32 12
  %50 = load i32, ptr %49, align 8, !tbaa !15
  %51 = sub i32 %47, %50
  br label %60

52:                                               ; preds = %35
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._ENetHost, ptr %53, i32 0, i32 12
  %55 = load i32, ptr %54, align 8, !tbaa !15
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._ENetHost, ptr %56, i32 0, i32 4
  %58 = load i32, ptr %57, align 4, !tbaa !23
  %59 = sub i32 %55, %58
  br label %60

60:                                               ; preds = %52, %44
  %61 = phi i32 [ %51, %44 ], [ %59, %52 ]
  %62 = icmp uge i32 %61, 1000
  br i1 %62, label %63, label %65

63:                                               ; preds = %60
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  call void @enet_host_bandwidth_throttle(ptr noundef %64)
  br label %65

65:                                               ; preds = %63, %60
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = call i32 @enet_protocol_send_outgoing_commands(ptr noundef %66, ptr noundef %67, i32 noundef 1)
  switch i32 %68, label %71 [
    i32 1, label %69
    i32 -1, label %70
  ]

69:                                               ; preds = %65
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %158

70:                                               ; preds = %65
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %158

71:                                               ; preds = %65
  br label %72

72:                                               ; preds = %71
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = call i32 @enet_protocol_receive_incoming_commands(ptr noundef %73, ptr noundef %74)
  switch i32 %75, label %78 [
    i32 1, label %76
    i32 -1, label %77
  ]

76:                                               ; preds = %72
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %158

77:                                               ; preds = %72
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %158

78:                                               ; preds = %72
  br label %79

79:                                               ; preds = %78
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = call i32 @enet_protocol_send_outgoing_commands(ptr noundef %80, ptr noundef %81, i32 noundef 1)
  switch i32 %82, label %85 [
    i32 1, label %83
    i32 -1, label %84
  ]

83:                                               ; preds = %79
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %158

84:                                               ; preds = %79
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %158

85:                                               ; preds = %79
  br label %86

86:                                               ; preds = %85
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = icmp ne ptr %87, null
  br i1 %88, label %89, label %97

89:                                               ; preds = %86
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = call i32 @enet_protocol_dispatch_incoming_commands(ptr noundef %90, ptr noundef %91)
  switch i32 %92, label %95 [
    i32 1, label %93
    i32 -1, label %94
  ]

93:                                               ; preds = %89
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %158

94:                                               ; preds = %89
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %158

95:                                               ; preds = %89
  br label %96

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96, %86
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._ENetHost, ptr %98, i32 0, i32 12
  %100 = load i32, ptr %99, align 8, !tbaa !15
  %101 = load i32, ptr %7, align 4, !tbaa !9
  %102 = sub i32 %100, %101
  %103 = icmp uge i32 %102, 86400000
  br i1 %103, label %105, label %104

104:                                              ; preds = %97
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %158

105:                                              ; preds = %97
  br label %106

106:                                              ; preds = %145, %105
  %107 = call i32 @enet_time_get()
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._ENetHost, ptr %108, i32 0, i32 12
  store i32 %107, ptr %109, align 8, !tbaa !15
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._ENetHost, ptr %110, i32 0, i32 12
  %112 = load i32, ptr %111, align 8, !tbaa !15
  %113 = load i32, ptr %7, align 4, !tbaa !9
  %114 = sub i32 %112, %113
  %115 = icmp uge i32 %114, 86400000
  br i1 %115, label %117, label %116

116:                                              ; preds = %106
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %158

117:                                              ; preds = %106
  store i32 6, ptr %8, align 4, !tbaa !9
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._ENetHost, ptr %118, i32 0, i32 0
  %120 = load i32, ptr %119, align 8, !tbaa !24
  %121 = load i32, ptr %7, align 4, !tbaa !9
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._ENetHost, ptr %122, i32 0, i32 12
  %124 = load i32, ptr %123, align 8, !tbaa !15
  %125 = sub i32 %121, %124
  %126 = icmp uge i32 %125, 86400000
  br i1 %126, label %127, label %133

127:                                              ; preds = %117
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._ENetHost, ptr %128, i32 0, i32 12
  %130 = load i32, ptr %129, align 8, !tbaa !15
  %131 = load i32, ptr %7, align 4, !tbaa !9
  %132 = sub i32 %130, %131
  br label %139

133:                                              ; preds = %117
  %134 = load i32, ptr %7, align 4, !tbaa !9
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._ENetHost, ptr %135, i32 0, i32 12
  %137 = load i32, ptr %136, align 8, !tbaa !15
  %138 = sub i32 %134, %137
  br label %139

139:                                              ; preds = %133, %127
  %140 = phi i32 [ %132, %127 ], [ %138, %133 ]
  %141 = call i32 @enet_socket_wait(i32 noundef %120, ptr noundef %8, i32 noundef %140)
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %144

143:                                              ; preds = %139
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %158

144:                                              ; preds = %139
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %8, align 4, !tbaa !9
  %147 = and i32 %146, 4
  %148 = icmp ne i32 %147, 0
  br i1 %148, label %106, label %149, !llvm.loop !25

149:                                              ; preds = %145
  %150 = call i32 @enet_time_get()
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct._ENetHost, ptr %151, i32 0, i32 12
  store i32 %150, ptr %152, align 8, !tbaa !15
  br label %153

153:                                              ; preds = %149
  %154 = load i32, ptr %8, align 4, !tbaa !9
  %155 = and i32 %154, 2
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %35, label %157, !llvm.loop !27

157:                                              ; preds = %153
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %158

158:                                              ; preds = %157, %143, %116, %104, %94, %93, %84, %83, %77, %76, %70, %69, %23, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %159 = load i32, ptr %4, align 4
  ret i32 %159
}

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

declare void @enet_host_bandwidth_throttle(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @enet_protocol_receive_incoming_commands(ptr noundef, ptr noundef) #1

declare i32 @enet_socket_wait(i32 noundef, ptr noundef, i32 noundef) #0

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ENetEvent", !10, i64 0, !6, i64 8, !7, i64 16, !10, i64 20, !6, i64 24}
!13 = !{!12, !6, i64 8}
!14 = !{!12, !6, i64 24}
!15 = !{!16, !10, i64 64}
!16 = !{!"_ENetHost", !10, i64 0, !17, i64 4, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !6, i64 40, !19, i64 48, !19, i64 56, !10, i64 64, !20, i64 72, !10, i64 88, !19, i64 96, !18, i64 104, !7, i64 106, !19, i64 1648, !7, i64 1656, !19, i64 2696, !6, i64 2704, !22, i64 2712, !7, i64 2744, !17, i64 10936, !6, i64 10944, !19, i64 10952, !10, i64 10960, !10, i64 10964, !10, i64 10968, !10, i64 10972, !6, i64 10976, !19, i64 10984, !19, i64 10992, !19, i64 11000, !19, i64 11008, !19, i64 11016}
!17 = !{!"_ENetAddress", !10, i64 0, !18, i64 4}
!18 = !{!"short", !7, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ENetList", !21, i64 0}
!21 = !{!"_ENetListNode", !6, i64 0, !6, i64 8}
!22 = !{!"_ENetCompressor", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!23 = !{!16, !10, i64 20}
!24 = !{!16, !10, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}


; 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 i32 @enet_time_get() local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @enet_host_service(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %9, label %5

5:                                                ; preds = %3
  store i32 0, ptr %1, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr null, ptr %6, align 8, !tbaa !11
  %7 = getelementptr inbounds i8, ptr %1, i64 24
  store ptr null, ptr %7, align 8, !tbaa !12
  %8 = tail call i32 @enet_protocol_dispatch_incoming_commands(ptr noundef %0, ptr noundef nonnull %1)
  switch i32 %8, label %9 [
    i32 1, label %.loopexit
    i32 -1, label %.loopexit
  ]

9:                                                ; preds = %5, %3
  %10 = tail call i32 @enet_time_get() #3
  %11 = getelementptr inbounds i8, ptr %0, i64 64
  store i32 %10, ptr %11, align 8, !tbaa !13
  %12 = add i32 %10, %2
  %13 = getelementptr inbounds i8, ptr %0, i64 20
  br label %14

14:                                               ; preds = %48, %9
  %15 = phi i32 [ %49, %48 ], [ %10, %9 ]
  %16 = load i32, ptr %13, align 4, !tbaa !21
  %17 = sub i32 %15, %16
  %18 = icmp ugt i32 %17, 86399999
  %19 = sub i32 %16, %15
  %20 = select i1 %18, i32 %19, i32 %17
  %21 = icmp ugt i32 %20, 999
  br i1 %21, label %22, label %23

22:                                               ; preds = %14
  call void @enet_host_bandwidth_throttle(ptr noundef nonnull %0) #3
  br label %23

23:                                               ; preds = %22, %14
  %24 = call i32 @enet_protocol_send_outgoing_commands(ptr noundef nonnull %0, ptr noundef %1, i32 noundef 1)
  switch i32 %24, label %25 [
    i32 1, label %.loopexit.loopexit50
    i32 -1, label %.loopexit
  ]

25:                                               ; preds = %23
  %26 = call i32 @enet_protocol_receive_incoming_commands(ptr noundef %0, ptr noundef %1)
  switch i32 %26, label %27 [
    i32 1, label %.loopexit.loopexit50
    i32 -1, label %.loopexit
  ]

27:                                               ; preds = %25
  %28 = call i32 @enet_protocol_send_outgoing_commands(ptr noundef %0, ptr noundef %1, i32 noundef 1)
  switch i32 %28, label %29 [
    i32 1, label %.loopexit.loopexit50
    i32 -1, label %.loopexit
  ]

29:                                               ; preds = %27
  br i1 %.not, label %32, label %30

30:                                               ; preds = %29
  %31 = call i32 @enet_protocol_dispatch_incoming_commands(ptr noundef %0, ptr noundef nonnull %1)
  switch i32 %31, label %32 [
    i32 1, label %.loopexit.loopexit50
    i32 -1, label %.loopexit
  ]

32:                                               ; preds = %30, %29
  %33 = load i32, ptr %11, align 8, !tbaa !13
  %34 = sub i32 %33, %12
  %35 = icmp ugt i32 %34, 86399999
  br i1 %35, label %.preheader, label %.loopexit.loopexit50

.preheader:                                       ; preds = %32, %45
  %36 = call i32 @enet_time_get() #3
  store i32 %36, ptr %11, align 8, !tbaa !13
  %37 = sub i32 %36, %12
  %38 = icmp ugt i32 %37, 86399999
  br i1 %38, label %39, label %.loopexit

39:                                               ; preds = %.preheader
  store i32 6, ptr %4, align 4, !tbaa !22
  %40 = load i32, ptr %0, align 8, !tbaa !23
  %41 = sub i32 %12, %36
  %42 = icmp ugt i32 %41, 86399999
  %43 = select i1 %42, i32 %37, i32 %41
  %44 = call i32 @enet_socket_wait(i32 noundef %40, ptr noundef nonnull %4, i32 noundef %43) #3
  %.not41 = icmp eq i32 %44, 0
  br i1 %.not41, label %45, label %.loopexit

45:                                               ; preds = %39
  %46 = load i32, ptr %4, align 4, !tbaa !22
  %47 = and i32 %46, 4
  %.not42 = icmp eq i32 %47, 0
  br i1 %.not42, label %48, label %.preheader, !llvm.loop !24

48:                                               ; preds = %45
  %49 = call i32 @enet_time_get() #3
  store i32 %49, ptr %11, align 8, !tbaa !13
  %50 = load i32, ptr %4, align 4, !tbaa !22
  %51 = and i32 %50, 2
  %.not43 = icmp eq i32 %51, 0
  br i1 %.not43, label %.loopexit.loopexit50, label %14, !llvm.loop !26

.loopexit.loopexit50:                             ; preds = %23, %25, %27, %30, %32, %48
  %.0.ph51 = phi i32 [ 0, %48 ], [ 0, %32 ], [ %31, %30 ], [ %28, %27 ], [ %26, %25 ], [ %24, %23 ]
  br label %.loopexit

.loopexit:                                        ; preds = %39, %.preheader, %30, %27, %25, %23, %.loopexit.loopexit50, %5, %5
  %.0 = phi i32 [ %8, %5 ], [ %8, %5 ], [ %.0.ph51, %.loopexit.loopexit50 ], [ -1, %23 ], [ -1, %25 ], [ -1, %27 ], [ -1, %30 ], [ -1, %39 ], [ 0, %.preheader ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  ret i32 %.0
}

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

declare void @enet_host_bandwidth_throttle(ptr noundef) local_unnamed_addr #0

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

declare i32 @enet_socket_wait(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !7, i64 0}
!6 = !{!"_ENetEvent", !7, i64 0, !10, i64 8, !8, i64 16, !7, i64 20, !10, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!6, !10, i64 24}
!13 = !{!14, !7, i64 64}
!14 = !{!"_ENetHost", !7, i64 0, !15, i64 4, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !10, i64 40, !17, i64 48, !17, i64 56, !7, i64 64, !18, i64 72, !7, i64 88, !17, i64 96, !16, i64 104, !8, i64 106, !17, i64 1648, !8, i64 1656, !17, i64 2696, !10, i64 2704, !20, i64 2712, !8, i64 2744, !15, i64 10936, !10, i64 10944, !17, i64 10952, !7, i64 10960, !7, i64 10964, !7, i64 10968, !7, i64 10972, !10, i64 10976, !17, i64 10984, !17, i64 10992, !17, i64 11000, !17, i64 11008, !17, i64 11016}
!15 = !{!"_ENetAddress", !7, i64 0, !16, i64 4}
!16 = !{!"short", !8, i64 0}
!17 = !{!"long", !8, i64 0}
!18 = !{!"_ENetList", !19, i64 0}
!19 = !{!"_ENetListNode", !10, i64 0, !10, i64 8}
!20 = !{!"_ENetCompressor", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!21 = !{!14, !7, i64 20}
!22 = !{!7, !7, i64 0}
!23 = !{!14, !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}


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