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

; 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.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] }
%struct._LIST_ENTRY = type { ptr, ptr }
%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 }
%struct._IP4_INTERFACE = type { i32, %struct._LIST_ENTRY, i64, i32, i32, i32, i32, i8, ptr, ptr, ptr, ptr, ptr, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i32, %struct._LIST_ENTRY, i8 }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.IP4_HEAD = type { i8, i8, i16, i16, i16, i8, i8, i16, i32, i32 }
%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] }

@.str = external hidden unnamed_addr constant [150 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [119 x i8], align 1

; 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 zeroext i8 @DebugAssertEnabled() #1

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) #1

declare i64 @Ip4PrependHead(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ip4InstanceEnquePacket(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip4InterfaceEnquePacket(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5) #2 {
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store i32 %4, ptr %12, align 4, !tbaa !9
  store ptr %5, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  store i64 0, ptr %18, align 8, !tbaa !11
  %21 = load ptr, ptr %10, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.NET_BUF, ptr %21, i32 0, i32 6
  %23 = getelementptr inbounds [64 x i8], ptr %22, i64 0, i64 0
  store ptr %23, ptr %15, align 8, !tbaa !5
  %24 = load ptr, ptr %15, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.IP4_CLIP_INFO, ptr %24, i32 0, i32 1
  %26 = load i64, ptr %25, align 8, !tbaa !13
  %27 = icmp eq i64 %26, 3
  br i1 %27, label %33, label %28

28:                                               ; preds = %6
  %29 = load ptr, ptr %15, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.IP4_CLIP_INFO, ptr %29, i32 0, i32 1
  %31 = load i64, ptr %30, align 8, !tbaa !13
  %32 = icmp eq i64 %31, 4
  br i1 %32, label %33, label %37

33:                                               ; preds = %28, %6
  %34 = load ptr, ptr %15, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.IP4_CLIP_INFO, ptr %34, i32 0, i32 1
  %36 = load i64, ptr %35, align 8, !tbaa !13
  store i64 %36, ptr %18, align 8, !tbaa !11
  br label %60

37:                                               ; preds = %28
  %38 = load ptr, ptr %13, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %38, i32 0, i32 3
  %40 = load i32, ptr %39, align 8, !tbaa !15
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %37
  store i64 2, ptr %18, align 8, !tbaa !11
  br label %59

43:                                               ; preds = %37
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.IP4_HEAD, ptr %44, i32 0, i32 9
  %46 = load i32, ptr %45, align 1, !tbaa !19
  %47 = load ptr, ptr %13, align 8, !tbaa !5
  %48 = call i64 @Ip4GetNetCast(i32 noundef %46, ptr noundef %47)
  store i64 %48, ptr %18, align 8, !tbaa !11
  %49 = load i64, ptr %18, align 8, !tbaa !11
  %50 = icmp eq i64 %49, 0
  br i1 %50, label %51, label %58

51:                                               ; preds = %43
  %52 = load ptr, ptr %13, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %52, i32 0, i32 20
  %54 = load i8, ptr %53, align 8, !tbaa !22
  %55 = zext i8 %54 to i32
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %51
  store i64 1, ptr %18, align 8, !tbaa !11
  br label %58

58:                                               ; preds = %57, %51, %43
  br label %59

59:                                               ; preds = %58, %42
  br label %60

60:                                               ; preds = %59, %33
  %61 = load i64, ptr %18, align 8, !tbaa !11
  %62 = icmp eq i64 %61, 0
  br i1 %62, label %63, label %64

63:                                               ; preds = %60
  store i64 0, ptr %7, align 8
  store i32 1, ptr %20, align 4
  br label %138

64:                                               ; preds = %60
  %65 = load ptr, ptr %15, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.IP4_CLIP_INFO, ptr %65, i32 0, i32 1
  %67 = load i64, ptr %66, align 8, !tbaa !13
  store i64 %67, ptr %19, align 8, !tbaa !11
  %68 = load i64, ptr %18, align 8, !tbaa !11
  %69 = load ptr, ptr %15, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.IP4_CLIP_INFO, ptr %69, i32 0, i32 1
  store i64 %68, ptr %70, align 8, !tbaa !13
  store i64 0, ptr %17, align 8, !tbaa !11
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %71, i32 0, i32 19
  %73 = getelementptr inbounds %struct._LIST_ENTRY, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !23
  store ptr %74, ptr %16, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %129, %64
  %76 = load ptr, ptr %16, align 8, !tbaa !5
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._IP4_INTERFACE, ptr %77, i32 0, i32 19
  %79 = icmp ne ptr %76, %78
  br i1 %79, label %80, label %133

80:                                               ; preds = %75
  %81 = load ptr, ptr %16, align 8, !tbaa !5
  %82 = ptrtoint ptr %81 to i64
  %83 = sub i64 %82, ptrtoint (ptr getelementptr inbounds (%struct._IP4_PROTOCOL, ptr null, i32 0, i32 12) to i64)
  %84 = inttoptr i64 %83 to ptr
  store ptr %84, ptr %14, align 8, !tbaa !5
  br label %85

85:                                               ; preds = %80
  %86 = call zeroext i8 @DebugAssertEnabled()
  %87 = icmp ne i8 %86, 0
  br i1 %87, label %88, label %98

88:                                               ; preds = %85
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  %90 = icmp ne ptr %89, null
  br i1 %90, label %91, label %96

91:                                               ; preds = %88
  %92 = load ptr, ptr %14, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %92, i32 0, i32 0
  %94 = load i32, ptr %93, align 8, !tbaa !24
  %95 = icmp eq i32 %94, 1345605705
  br i1 %95, label %97, label %96

96:                                               ; preds = %91, %88
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1423, ptr noundef @.str.12)
  br label %97

97:                                               ; preds = %96, %91
  br label %98

98:                                               ; preds = %97, %85
  br label %99

99:                                               ; preds = %98
  br label %100

100:                                              ; preds = %99
  %101 = load ptr, ptr %14, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._IP4_PROTOCOL, ptr %101, i32 0, i32 18
  %103 = getelementptr inbounds %struct.EFI_IP4_CONFIG_DATA, ptr %102, i32 0, i32 11
  %104 = load i8, ptr %103, align 1, !tbaa !30
  %105 = zext i8 %104 to i32
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %107, label %119

107:                                              ; preds = %100
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  %109 = icmp ne ptr %108, null
  br i1 %109, label %110, label %119

110:                                              ; preds = %107
  %111 = load i32, ptr %12, align 4, !tbaa !9
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %119

113:                                              ; preds = %110
  %114 = load ptr, ptr %10, align 8, !tbaa !5
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = load i32, ptr %12, align 4, !tbaa !9
  %118 = call i64 @Ip4PrependHead(ptr noundef %114, ptr noundef %115, ptr noundef %116, i32 noundef %117)
  br label %119

119:                                              ; preds = %113, %110, %107, %100
  %120 = load ptr, ptr %14, align 8, !tbaa !5
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = load ptr, ptr %10, align 8, !tbaa !5
  %123 = call i64 @Ip4InstanceEnquePacket(ptr noundef %120, ptr noundef %121, ptr noundef %122)
  %124 = icmp eq i64 %123, 0
  br i1 %124, label %125, label %128

125:                                              ; preds = %119
  %126 = load i64, ptr %17, align 8, !tbaa !11
  %127 = add nsw i64 %126, 1
  store i64 %127, ptr %17, align 8, !tbaa !11
  br label %128

128:                                              ; preds = %125, %119
  br label %129

129:                                              ; preds = %128
  %130 = load ptr, ptr %16, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct._LIST_ENTRY, ptr %130, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8, !tbaa !31
  store ptr %132, ptr %16, align 8, !tbaa !5
  br label %75, !llvm.loop !32

133:                                              ; preds = %75
  %134 = load i64, ptr %19, align 8, !tbaa !11
  %135 = load ptr, ptr %15, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.IP4_CLIP_INFO, ptr %135, i32 0, i32 1
  store i64 %134, ptr %136, align 8, !tbaa !13
  %137 = load i64, ptr %17, align 8, !tbaa !11
  store i64 %137, ptr %7, align 8
  store i32 1, ptr %20, align 4
  br label %138

138:                                              ; preds = %133, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %139 = load i64, ptr %7, align 8
  ret i64 %139
}

declare i64 @Ip4GetNetCast(i32 noundef, ptr noundef) #1

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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !12, i64 8}
!14 = !{!"", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !10, i64 40, !12, i64 48}
!15 = !{!16, !10, i64 32}
!16 = !{!"_IP4_INTERFACE", !10, i64 0, !17, i64 8, !12, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !7, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !17, i64 96, !17, i64 112, !6, i64 128, !18, i64 136, !18, i64 168, !10, i64 200, !17, i64 208, !7, i64 224}
!17 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!18 = !{!"", !7, i64 0}
!19 = !{!20, !10, i64 16}
!20 = !{!"", !7, i64 0, !7, i64 0, !7, i64 1, !21, i64 2, !21, i64 4, !21, i64 6, !7, i64 8, !7, i64 9, !21, i64 10, !10, i64 12, !10, i64 16}
!21 = !{!"short", !7, i64 0}
!22 = !{!16, !7, i64 224}
!23 = !{!16, !6, i64 208}
!24 = !{!25, !10, i64 0}
!25 = !{!"_IP4_PROTOCOL", !10, i64 0, !26, i64 8, !6, i64 72, !12, i64 80, !6, i64 88, !17, i64 96, !27, i64 112, !27, i64 152, !17, i64 192, !17, i64 208, !28, i64 224, !6, i64 248, !17, i64 256, !6, i64 272, !6, i64 280, !10, i64 288, !6, i64 296, !10, i64 304, !29, i64 308}
!26 = !{!"_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}
!27 = !{!"", !17, i64 0, !17, i64 16, !12, i64 32}
!28 = !{!"", !12, i64 0, !12, i64 8, !10, i64 16}
!29 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !18, i64 6, !18, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !10, i64 20, !10, i64 24}
!30 = !{!25, !7, i64 325}
!31 = !{!17, !6, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"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"

@.str = external hidden unnamed_addr constant [150 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [119 x i8], align 1

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

declare i64 @Ip4PrependHead(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ip4InstanceEnquePacket(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip4InterfaceEnquePacket(ptr nocapture noundef readnone %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5) local_unnamed_addr #1 {
  %7 = getelementptr inbounds i8, ptr %2, i64 64
  %8 = load i64, ptr %7, align 8, !tbaa !5
  %.off = add i64 %8, -3
  %switch = icmp ult i64 %.off, 2
  br i1 %switch, label %21, label %9

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %5, i64 32
  %11 = load i32, ptr %10, align 8, !tbaa !11
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %21, label %13

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %1, i64 16
  %15 = load i32, ptr %14, align 1, !tbaa !16
  %16 = tail call i64 @Ip4GetNetCast(i32 noundef %15, ptr noundef nonnull %5) #2
  %17 = icmp eq i64 %16, 0
  br i1 %17, label %18, label %21

18:                                               ; preds = %13
  %19 = getelementptr inbounds i8, ptr %5, i64 224
  %20 = load i8, ptr %19, align 8, !tbaa !19
  %.not = icmp eq i8 %20, 0
  br i1 %.not, label %58, label %21

21:                                               ; preds = %13, %9, %18, %6
  %.037.ph = phi i64 [ %8, %6 ], [ 1, %18 ], [ 2, %9 ], [ %16, %13 ]
  %22 = load i64, ptr %7, align 8, !tbaa !5
  store i64 %.037.ph, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %5, i64 208
  %.03952 = load ptr, ptr %23, align 8, !tbaa !20
  %.not4653 = icmp eq ptr %.03952, %23
  br i1 %.not4653, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %21
  %24 = icmp ne ptr %3, null
  %25 = icmp ne i32 %4, 0
  %26 = and i1 %25, %24
  br i1 %26, label %.lr.ph.split, label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph, %36
  %.03955.us = phi ptr [ %.039.us, %36 ], [ %.03952, %.lr.ph ]
  %.03854.us = phi i64 [ %spec.select49.us, %36 ], [ 0, %.lr.ph ]
  %27 = ptrtoint ptr %.03955.us to i64
  %28 = add i64 %27, -256
  %29 = inttoptr i64 %28 to ptr
  %30 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not47.us = icmp eq i8 %30, 0
  br i1 %.not47.us, label %36, label %31

31:                                               ; preds = %.lr.ph.split.us
  %.not48.us = icmp eq i64 %28, 0
  br i1 %.not48.us, label %35, label %32

32:                                               ; preds = %31
  %33 = load i32, ptr %29, align 8, !tbaa !21
  %34 = icmp eq i32 %33, 1345605705
  br i1 %34, label %36, label %35

35:                                               ; preds = %32, %31
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1423, ptr noundef nonnull @.str.12) #2
  br label %36

36:                                               ; preds = %35, %32, %.lr.ph.split.us
  %37 = tail call i64 @Ip4InstanceEnquePacket(ptr noundef nonnull %29, ptr noundef %1, ptr noundef %2)
  %38 = icmp eq i64 %37, 0
  %39 = zext i1 %38 to i64
  %spec.select49.us = add nuw nsw i64 %.03854.us, %39
  %.039.us = load ptr, ptr %.03955.us, align 8, !tbaa !20
  %.not46.us = icmp eq ptr %.039.us, %23
  br i1 %.not46.us, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !27

.lr.ph.split:                                     ; preds = %.lr.ph, %54
  %.03955 = phi ptr [ %.039, %54 ], [ %.03952, %.lr.ph ]
  %.03854 = phi i64 [ %spec.select49, %54 ], [ 0, %.lr.ph ]
  %40 = ptrtoint ptr %.03955 to i64
  %41 = add i64 %40, -256
  %42 = inttoptr i64 %41 to ptr
  %43 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not47 = icmp eq i8 %43, 0
  br i1 %.not47, label %49, label %44

44:                                               ; preds = %.lr.ph.split
  %.not48 = icmp eq i64 %41, 0
  br i1 %.not48, label %48, label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %42, align 8, !tbaa !21
  %47 = icmp eq i32 %46, 1345605705
  br i1 %47, label %49, label %48

48:                                               ; preds = %45, %44
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1423, ptr noundef nonnull @.str.12) #2
  br label %49

49:                                               ; preds = %45, %48, %.lr.ph.split
  %50 = getelementptr inbounds i8, ptr %42, i64 325
  %51 = load i8, ptr %50, align 1, !tbaa !29
  %.not56 = icmp eq i8 %51, 0
  br i1 %.not56, label %54, label %52

52:                                               ; preds = %49
  %53 = tail call i64 @Ip4PrependHead(ptr noundef %2, ptr noundef %1, ptr noundef nonnull %3, i32 noundef %4) #2
  br label %54

54:                                               ; preds = %52, %49
  %55 = tail call i64 @Ip4InstanceEnquePacket(ptr noundef nonnull %42, ptr noundef %1, ptr noundef %2)
  %56 = icmp eq i64 %55, 0
  %57 = zext i1 %56 to i64
  %spec.select49 = add nuw nsw i64 %.03854, %57
  %.039 = load ptr, ptr %.03955, align 8, !tbaa !20
  %.not46 = icmp eq ptr %.039, %23
  br i1 %.not46, label %._crit_edge, label %.lr.ph.split, !llvm.loop !27

._crit_edge:                                      ; preds = %36, %54, %21
  %.038.lcssa = phi i64 [ 0, %21 ], [ %spec.select49, %54 ], [ %spec.select49.us, %36 ]
  store i64 %22, ptr %7, align 8, !tbaa !5
  br label %58

58:                                               ; preds = %18, %._crit_edge
  %.0 = phi i64 [ %.038.lcssa, %._crit_edge ], [ 0, %18 ]
  ret i64 %.0
}

declare i64 @Ip4GetNetCast(i32 noundef, ptr noundef) local_unnamed_addr #0

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


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