; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal (Ip4PacketTimerTicking)

; 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._IP4_SERVICE = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, i64, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, ptr, %struct.IP4_ASSEMBLE_TABLE, %struct.IGMP_SERVICE_DATA, ptr, ptr, ptr, ptr, %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, %struct.EFI_SIMPLE_NETWORK_MODE, ptr, ptr, ptr, ptr, ptr, i32, i32 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.IP4_ASSEMBLE_TABLE = type { [31 x %struct._LIST_ENTRY] }
%struct.IGMP_SERVICE_DATA = type { i64, %struct._LIST_ENTRY }
%struct.EFI_MANAGED_NETWORK_CONFIG_DATA = type { i32, i32, i16, i8, i8, i8, i8, i8, i8, i8 }
%struct.EFI_SIMPLE_NETWORK_MODE = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x %struct.EFI_MAC_ADDRESS], %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i8, i8 }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.IP4_ASSEMBLE_ENTRY = type { %struct._LIST_ENTRY, i32, i32, i16, i8, i64, i64, %struct._LIST_ENTRY, ptr, ptr, i64 }
%struct._IP4_PROTOCOL = type { i32, %struct._EFI_IP4_PROTOCOL, ptr, i64, ptr, %struct._LIST_ENTRY, %struct.NET_MAP, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct.EFI_LOCK, ptr, %struct._LIST_ENTRY, ptr, ptr, i32, ptr, i32, %struct.EFI_IP4_CONFIG_DATA }
%struct._EFI_IP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct.EFI_LOCK = type { i64, i64, i32 }
%struct.EFI_IP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i8, i8, i8, i8, i32, i32 }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.NET_BUF = type { i32, i64, %struct._LIST_ENTRY, %union.NET_IP_HEAD, ptr, ptr, [64 x i8], ptr, i32, i32, [1 x %struct.NET_BLOCK_OP] }
%union.NET_IP_HEAD = type { ptr }
%struct.NET_BLOCK_OP = type { ptr, ptr, ptr, ptr, i32 }
%struct.IP4_CLIP_INFO = type { i64, i64, i64, i64, i64, i32, i64 }

; 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: nounwind uwtable
declare dso_local void @Ip4FreeAssembleEntry(ptr noundef) #1

declare ptr @RemoveEntryList(ptr noundef) #2

declare void @NetbufFree(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @Ip4PacketTimerTicking(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %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 ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %61, %1
  %12 = load i32, ptr %10, align 4, !tbaa !9
  %13 = icmp ult i32 %12, 31
  br i1 %13, label %14, label %64

14:                                               ; preds = %11
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct._IP4_SERVICE, ptr %15, i32 0, i32 8
  %17 = getelementptr inbounds %struct.IP4_ASSEMBLE_TABLE, ptr %16, i32 0, i32 0
  %18 = load i32, ptr %10, align 4, !tbaa !9
  %19 = zext i32 %18 to i64
  %20 = getelementptr inbounds [31 x %struct._LIST_ENTRY], ptr %17, i64 0, i64 %19
  %21 = getelementptr inbounds %struct._LIST_ENTRY, ptr %20, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  store ptr %22, ptr %4, align 8, !tbaa !5
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._LIST_ENTRY, ptr %23, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !11
  store ptr %25, ptr %5, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %55, %14
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._IP4_SERVICE, ptr %28, i32 0, i32 8
  %30 = getelementptr inbounds %struct.IP4_ASSEMBLE_TABLE, ptr %29, i32 0, i32 0
  %31 = load i32, ptr %10, align 4, !tbaa !9
  %32 = zext i32 %31 to i64
  %33 = getelementptr inbounds [31 x %struct._LIST_ENTRY], ptr %30, i64 0, i64 %32
  %34 = icmp ne ptr %27, %33
  br i1 %34, label %35, label %60

35:                                               ; preds = %26
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = ptrtoint ptr %36 to i64
  %38 = sub i64 %37, 0
  %39 = inttoptr i64 %38 to ptr
  store ptr %39, ptr %7, align 8, !tbaa !5
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.IP4_ASSEMBLE_ENTRY, ptr %40, i32 0, i32 10
  %42 = load i64, ptr %41, align 8, !tbaa !13
  %43 = icmp sgt i64 %42, 0
  br i1 %43, label %44, label %54

44:                                               ; preds = %35
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.IP4_ASSEMBLE_ENTRY, ptr %45, i32 0, i32 10
  %47 = load i64, ptr %46, align 8, !tbaa !13
  %48 = add nsw i64 %47, -1
  store i64 %48, ptr %46, align 8, !tbaa !13
  %49 = icmp eq i64 %48, 0
  br i1 %49, label %50, label %54

50:                                               ; preds = %44
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = call ptr @RemoveEntryList(ptr noundef %51)
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  call void @Ip4FreeAssembleEntry(ptr noundef %53)
  br label %54

54:                                               ; preds = %50, %44, %35
  br label %55

55:                                               ; preds = %54
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %56, ptr %4, align 8, !tbaa !5
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct._LIST_ENTRY, ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !11
  store ptr %59, ptr %5, align 8, !tbaa !5
  br label %26, !llvm.loop !17

60:                                               ; preds = %26
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = add i32 %62, 1
  store i32 %63, ptr %10, align 4, !tbaa !9
  br label %11, !llvm.loop !19

64:                                               ; preds = %11
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._IP4_SERVICE, ptr %65, i32 0, i32 4
  %67 = getelementptr inbounds %struct._LIST_ENTRY, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !20
  store ptr %68, ptr %3, align 8, !tbaa !5
  br label %69

69:                                               ; preds = %123, %64
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = load ptr, ptr %2, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._IP4_SERVICE, ptr %71, i32 0, i32 4
  %73 = icmp ne ptr %70, %72
  br i1 %73, label %74, label %127

74:                                               ; preds = %69
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = ptrtoint ptr %75 to i64
  %77 = sub i64 %76, ptrtoint (ptr getelementptr inbounds (%struct._IP4_PROTOCOL, ptr null, i32 0, i32 5) to i64)
  %78 = inttoptr i64 %77 to ptr
  store ptr %78, ptr %6, align 8, !tbaa !5
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %79, i32 0, i32 8
  %81 = getelementptr inbounds %struct._LIST_ENTRY, ptr %80, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !27
  store ptr %82, ptr %4, align 8, !tbaa !5
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct._LIST_ENTRY, ptr %83, i32 0, i32 0
  %85 = load ptr, ptr %84, align 8, !tbaa !11
  store ptr %85, ptr %5, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %114, %74
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %88, i32 0, i32 8
  %90 = icmp ne ptr %87, %89
  br i1 %90, label %91, label %119

91:                                               ; preds = %86
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = ptrtoint ptr %92 to i64
  %94 = sub i64 %93, ptrtoint (ptr getelementptr inbounds (%struct.NET_BUF, ptr null, i32 0, i32 2) to i64)
  %95 = inttoptr i64 %94 to ptr
  store ptr %95, ptr %8, align 8, !tbaa !5
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.NET_BUF, ptr %96, i32 0, i32 6
  %98 = getelementptr inbounds [64 x i8], ptr %97, i64 0, i64 0
  store ptr %98, ptr %9, align 8, !tbaa !5
  %99 = load ptr, ptr %9, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.IP4_CLIP_INFO, ptr %99, i32 0, i32 5
  %101 = load i32, ptr %100, align 8, !tbaa !33
  %102 = icmp ugt i32 %101, 0
  br i1 %102, label %103, label %113

103:                                              ; preds = %91
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.IP4_CLIP_INFO, ptr %104, i32 0, i32 5
  %106 = load i32, ptr %105, align 8, !tbaa !33
  %107 = add i32 %106, -1
  store i32 %107, ptr %105, align 8, !tbaa !33
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %109, label %113

109:                                              ; preds = %103
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = call ptr @RemoveEntryList(ptr noundef %110)
  %112 = load ptr, ptr %8, align 8, !tbaa !5
  call void @NetbufFree(ptr noundef %112)
  br label %113

113:                                              ; preds = %109, %103, %91
  br label %114

114:                                              ; preds = %113
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %115, ptr %4, align 8, !tbaa !5
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._LIST_ENTRY, ptr %116, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8, !tbaa !11
  store ptr %118, ptr %5, align 8, !tbaa !5
  br label %86, !llvm.loop !35

119:                                              ; preds = %86
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %120, i32 0, i32 7
  %122 = call i64 @NetMapIterate(ptr noundef %121, ptr noundef @Ip4SentPacketTicking, ptr noundef null)
  br label %123

123:                                              ; preds = %119
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._LIST_ENTRY, ptr %124, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8, !tbaa !11
  store ptr %126, ptr %3, align 8, !tbaa !5
  br label %69, !llvm.loop !36

127:                                              ; preds = %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret void
}

declare i64 @NetMapIterate(ptr noundef, ptr noundef, ptr noundef) #2

declare i64 @Ip4SentPacketTicking(ptr noundef, ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!14, !16, i64 80}
!14 = !{!"", !12, i64 0, !10, i64 16, !10, i64 20, !15, i64 24, !7, i64 26, !16, i64 32, !16, i64 40, !12, i64 48, !6, i64 64, !6, i64 72, !16, i64 80}
!15 = !{!"short", !7, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!21, !6, i64 40}
!21 = !{!"_IP4_SERVICE", !10, i64 0, !22, i64 8, !16, i64 24, !16, i64 32, !12, i64 40, !12, i64 56, !6, i64 72, !6, i64 80, !23, i64 88, !24, i64 584, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !25, i64 640, !26, i64 660, !6, i64 1320, !6, i64 1328, !6, i64 1336, !6, i64 1344, !6, i64 1352, !10, i64 1360, !10, i64 1364}
!22 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!23 = !{!"", !7, i64 0}
!24 = !{!"", !16, i64 0, !12, i64 8}
!25 = !{!"", !10, i64 0, !10, i64 4, !15, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!26 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !7, i64 40, !23, i64 552, !23, i64 584, !23, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!27 = !{!28, !6, i64 192}
!28 = !{!"_IP4_PROTOCOL", !10, i64 0, !29, i64 8, !6, i64 72, !16, i64 80, !6, i64 88, !12, i64 96, !30, i64 112, !30, i64 152, !12, i64 192, !12, i64 208, !31, i64 224, !6, i64 248, !12, i64 256, !6, i64 272, !6, i64 280, !10, i64 288, !6, i64 296, !10, i64 304, !32, i64 308}
!29 = !{!"_EFI_IP4_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!30 = !{!"", !12, i64 0, !12, i64 16, !16, i64 32}
!31 = !{!"", !16, i64 0, !16, i64 8, !10, i64 16}
!32 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !23, i64 6, !23, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !10, i64 20, !10, i64 24}
!33 = !{!34, !10, i64 40}
!34 = !{!"", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !10, i64 40, !16, i64 48}
!35 = distinct !{!35, !18}
!36 = distinct !{!36, !18}


; 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._LIST_ENTRY = type { ptr, ptr }

; Function Attrs: nounwind uwtable
declare dso_local void @Ip4FreeAssembleEntry(ptr noundef) local_unnamed_addr #0

declare ptr @RemoveEntryList(ptr noundef) local_unnamed_addr #1

declare void @NetbufFree(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @Ip4PacketTimerTicking(ptr noundef readonly %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 88
  br label %3

3:                                                ; preds = %1, %._crit_edge
  %indvars.iv = phi i64 [ 0, %1 ], [ %indvars.iv.next, %._crit_edge ]
  %4 = getelementptr inbounds [31 x %struct._LIST_ENTRY], ptr %2, i64 0, i64 %indvars.iv
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %.not4042 = icmp eq ptr %5, %4
  br i1 %.not4042, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3, %14
  %.03343 = phi ptr [ %.03444, %14 ], [ %5, %3 ]
  %.03444 = load ptr, ptr %.03343, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %.03343, i64 80
  %7 = load i64, ptr %6, align 8, !tbaa !10
  %8 = icmp sgt i64 %7, 0
  br i1 %8, label %9, label %14

9:                                                ; preds = %.lr.ph
  %10 = add nsw i64 %7, -1
  store i64 %10, ptr %6, align 8, !tbaa !10
  %11 = icmp eq i64 %10, 0
  br i1 %11, label %12, label %14

12:                                               ; preds = %9
  %13 = tail call ptr @RemoveEntryList(ptr noundef nonnull %.03343) #2
  tail call void @Ip4FreeAssembleEntry(ptr noundef nonnull %.03343)
  br label %14

14:                                               ; preds = %.lr.ph, %9, %12
  %.not40 = icmp eq ptr %.03444, %4
  br i1 %.not40, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %14, %3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 31
  br i1 %exitcond.not, label %15, label %3, !llvm.loop !17

15:                                               ; preds = %._crit_edge
  %16 = getelementptr inbounds i8, ptr %0, i64 40
  %.03253 = load ptr, ptr %16, align 8, !tbaa !5
  %.not54 = icmp eq ptr %.03253, %16
  br i1 %.not54, label %._crit_edge58, label %.lr.ph57

.lr.ph57:                                         ; preds = %15, %._crit_edge52
  %.03255 = phi ptr [ %.032, %._crit_edge52 ], [ %.03253, %15 ]
  %17 = ptrtoint ptr %.03255 to i64
  %18 = add i64 %17, -96
  %19 = inttoptr i64 %18 to ptr
  %20 = getelementptr inbounds i8, ptr %19, i64 192
  %21 = load ptr, ptr %20, align 8, !tbaa !18
  %.not3847 = icmp eq ptr %21, %20
  br i1 %.not3847, label %._crit_edge52, label %.lr.ph51

.lr.ph51:                                         ; preds = %.lr.ph57, %32
  %.148 = phi ptr [ %.13549, %32 ], [ %21, %.lr.ph57 ]
  %.13549 = load ptr, ptr %.148, align 8, !tbaa !5
  %22 = ptrtoint ptr %.148 to i64
  %23 = add i64 %22, -16
  %24 = inttoptr i64 %23 to ptr
  %25 = getelementptr inbounds i8, ptr %24, i64 96
  %26 = load i32, ptr %25, align 8, !tbaa !25
  %.not39 = icmp eq i32 %26, 0
  br i1 %.not39, label %32, label %27

27:                                               ; preds = %.lr.ph51
  %28 = add i32 %26, -1
  store i32 %28, ptr %25, align 8, !tbaa !25
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %30, label %32

30:                                               ; preds = %27
  %31 = tail call ptr @RemoveEntryList(ptr noundef nonnull %.148) #2
  tail call void @NetbufFree(ptr noundef nonnull %24) #2
  br label %32

32:                                               ; preds = %.lr.ph51, %27, %30
  %.not38 = icmp eq ptr %.13549, %20
  br i1 %.not38, label %._crit_edge52, label %.lr.ph51, !llvm.loop !27

._crit_edge52:                                    ; preds = %32, %.lr.ph57
  %33 = getelementptr inbounds i8, ptr %19, i64 152
  %34 = tail call i64 @NetMapIterate(ptr noundef nonnull %33, ptr noundef nonnull @Ip4SentPacketTicking, ptr noundef null) #2
  %.032 = load ptr, ptr %.03255, align 8, !tbaa !5
  %.not = icmp eq ptr %.032, %16
  br i1 %.not, label %._crit_edge58, label %.lr.ph57, !llvm.loop !28

._crit_edge58:                                    ; preds = %._crit_edge52, %15
  ret void
}

declare i64 @NetMapIterate(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i64 @Ip4SentPacketTicking(ptr noundef, ptr noundef, ptr noundef) #1

attributes #0 = { 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 }

!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 = !{!"_LIST_ENTRY", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !14, i64 80}
!11 = !{!"", !6, i64 0, !12, i64 16, !12, i64 20, !13, i64 24, !8, i64 26, !14, i64 32, !14, i64 40, !6, i64 48, !7, i64 64, !7, i64 72, !14, i64 80}
!12 = !{!"int", !8, i64 0}
!13 = !{!"short", !8, i64 0}
!14 = !{!"long long", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!19, !7, i64 192}
!19 = !{!"_IP4_PROTOCOL", !12, i64 0, !20, i64 8, !7, i64 72, !14, i64 80, !7, i64 88, !6, i64 96, !21, i64 112, !21, i64 152, !6, i64 192, !6, i64 208, !22, i64 224, !7, i64 248, !6, i64 256, !7, i64 272, !7, i64 280, !12, i64 288, !7, i64 296, !12, i64 304, !23, i64 308}
!20 = !{!"_EFI_IP4_PROTOCOL", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56}
!21 = !{!"", !6, i64 0, !6, i64 16, !14, i64 32}
!22 = !{!"", !14, i64 0, !14, i64 8, !12, i64 16}
!23 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !24, i64 6, !24, i64 10, !8, i64 14, !8, i64 15, !8, i64 16, !8, i64 17, !12, i64 20, !12, i64 24}
!24 = !{!"", !8, i64 0}
!25 = !{!26, !12, i64 40}
!26 = !{!"", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !12, i64 40, !14, i64 48}
!27 = distinct !{!27, !16}
!28 = distinct !{!28, !16}


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