; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/NetworkPkg/UefiPxeBcDxe_ (PxeBcUdp6Read)

; 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.EFI_UDP6_COMPLETION_TOKEN = type { ptr, i64, %union.anon.5 }
%union.anon.5 = type { ptr }
%struct._EFI_UDP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_BOOT_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }
%struct.EFI_UDP6_RECEIVE_DATA = type { %struct.EFI_TIME, ptr, %struct.EFI_UDP6_SESSION_DATA, i32, i32, [1 x %struct.EFI_UDP6_FRAGMENT_DATA] }
%struct.EFI_TIME = type { i16, i8, i8, i8, i8, i8, i8, i32, i16, i8, i8 }
%struct.EFI_UDP6_SESSION_DATA = type { %struct.EFI_IPv6_ADDRESS, i16, %struct.EFI_IPv6_ADDRESS, i16 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct.EFI_UDP6_FRAGMENT_DATA = type { i32, ptr }

@gBS = external global ptr, align 8

; 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 zeroext i8 @PxeBcCheckByIpFilter(ptr noundef, ptr noundef, i16 noundef zeroext) #1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @PxeBcCheckByDestIp(ptr noundef, ptr noundef, ptr noundef, i16 noundef zeroext) #1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @PxeBcCheckByDestPort(ptr noundef, ptr noundef, ptr noundef, i16 noundef zeroext) #1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @PxeBcFilterBySrcIp(ptr noundef, ptr noundef, ptr noundef, i16 noundef zeroext) #1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @PxeBcFilterBySrcPort(ptr noundef, ptr noundef, ptr noundef, i16 noundef zeroext) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeBcUdp6Read(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i16 noundef zeroext %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10) #1 {
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i16, align 2
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i64, align 8
  %27 = alloca i32, align 4
  store ptr %0, ptr %13, align 8, !tbaa !5
  store ptr %1, ptr %14, align 8, !tbaa !5
  store ptr %2, ptr %15, align 8, !tbaa !5
  store ptr %3, ptr %16, align 8, !tbaa !5
  store i16 %4, ptr %17, align 2, !tbaa !9
  store ptr %5, ptr %18, align 8, !tbaa !5
  store ptr %6, ptr %19, align 8, !tbaa !5
  store ptr %7, ptr %20, align 8, !tbaa !5
  store ptr %8, ptr %21, align 8, !tbaa !5
  store ptr %9, ptr %22, align 8, !tbaa !5
  store ptr %10, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #2
  %28 = load ptr, ptr %14, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.EFI_UDP6_COMPLETION_TOKEN, ptr %28, i32 0, i32 1
  store i64 -9223372036854775802, ptr %29, align 8, !tbaa !11
  %30 = load ptr, ptr %18, align 8, !tbaa !5
  store i8 0, ptr %30, align 1, !tbaa !14
  %31 = load ptr, ptr %13, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct._EFI_UDP6_PROTOCOL, ptr %31, i32 0, i32 4
  %33 = load ptr, ptr %32, align 8, !tbaa !15
  %34 = load ptr, ptr %13, align 8, !tbaa !5
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  %36 = call i64 %33(ptr noundef %34, ptr noundef %35)
  store i64 %36, ptr %26, align 8, !tbaa !17
  %37 = load i64, ptr %26, align 8, !tbaa !17
  %38 = icmp slt i64 %37, 0
  br i1 %38, label %39, label %41

39:                                               ; preds = %11
  %40 = load i64, ptr %26, align 8, !tbaa !17
  store i64 %40, ptr %12, align 8
  store i32 1, ptr %27, align 4
  br label %175

41:                                               ; preds = %11
  br label %42

42:                                               ; preds = %91, %41
  %43 = load ptr, ptr %18, align 8, !tbaa !5
  %44 = load i8, ptr %43, align 1, !tbaa !14
  %45 = icmp ne i8 %44, 0
  br i1 %45, label %58, label %46

46:                                               ; preds = %42
  %47 = load ptr, ptr %14, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.EFI_UDP6_COMPLETION_TOKEN, ptr %47, i32 0, i32 1
  %49 = load i64, ptr %48, align 8, !tbaa !11
  %50 = icmp eq i64 %49, -9223372036854775802
  br i1 %50, label %51, label %58

51:                                               ; preds = %46
  %52 = load ptr, ptr @gBS, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %52, i32 0, i32 13
  %54 = load ptr, ptr %53, align 8, !tbaa !18
  %55 = load ptr, ptr %16, align 8, !tbaa !5
  %56 = call i64 %54(ptr noundef %55)
  %57 = icmp slt i64 %56, 0
  br label %58

58:                                               ; preds = %51, %46, %42
  %59 = phi i1 [ false, %46 ], [ false, %42 ], [ %57, %51 ]
  br i1 %59, label %60, label %92

60:                                               ; preds = %58
  %61 = load ptr, ptr %13, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._EFI_UDP6_PROTOCOL, ptr %61, i32 0, i32 6
  %63 = load ptr, ptr %62, align 8, !tbaa !22
  %64 = load ptr, ptr %13, align 8, !tbaa !5
  %65 = call i64 %63(ptr noundef %64)
  %66 = load ptr, ptr %14, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.EFI_UDP6_COMPLETION_TOKEN, ptr %66, i32 0, i32 1
  %68 = load i64, ptr %67, align 8, !tbaa !11
  %69 = icmp eq i64 %68, -9223372036854775786
  br i1 %69, label %90, label %70

70:                                               ; preds = %60
  %71 = load ptr, ptr %14, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.EFI_UDP6_COMPLETION_TOKEN, ptr %71, i32 0, i32 1
  %73 = load i64, ptr %72, align 8, !tbaa !11
  %74 = icmp eq i64 %73, -9223372036854775708
  br i1 %74, label %90, label %75

75:                                               ; preds = %70
  %76 = load ptr, ptr %14, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.EFI_UDP6_COMPLETION_TOKEN, ptr %76, i32 0, i32 1
  %78 = load i64, ptr %77, align 8, !tbaa !11
  %79 = icmp eq i64 %78, -9223372036854775707
  br i1 %79, label %90, label %80

80:                                               ; preds = %75
  %81 = load ptr, ptr %14, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.EFI_UDP6_COMPLETION_TOKEN, ptr %81, i32 0, i32 1
  %83 = load i64, ptr %82, align 8, !tbaa !11
  %84 = icmp eq i64 %83, -9223372036854775706
  br i1 %84, label %90, label %85

85:                                               ; preds = %80
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.EFI_UDP6_COMPLETION_TOKEN, ptr %86, i32 0, i32 1
  %88 = load i64, ptr %87, align 8, !tbaa !11
  %89 = icmp eq i64 %88, -9223372036854775705
  br i1 %89, label %90, label %91

90:                                               ; preds = %85, %80, %75, %70, %60
  br label %92

91:                                               ; preds = %85
  br label %42, !llvm.loop !23

92:                                               ; preds = %90, %58
  %93 = load ptr, ptr %14, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.EFI_UDP6_COMPLETION_TOKEN, ptr %93, i32 0, i32 1
  %95 = load i64, ptr %94, align 8, !tbaa !11
  %96 = icmp eq i64 %95, -9223372036854775802
  br i1 %96, label %97, label %98

97:                                               ; preds = %92
  br label %102

98:                                               ; preds = %92
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.EFI_UDP6_COMPLETION_TOKEN, ptr %99, i32 0, i32 1
  %101 = load i64, ptr %100, align 8, !tbaa !11
  br label %102

102:                                              ; preds = %98, %97
  %103 = phi i64 [ -9223372036854775790, %97 ], [ %101, %98 ]
  store i64 %103, ptr %26, align 8, !tbaa !17
  %104 = load i64, ptr %26, align 8, !tbaa !17
  %105 = icmp slt i64 %104, 0
  br i1 %105, label %173, label %106

106:                                              ; preds = %102
  %107 = load ptr, ptr %14, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.EFI_UDP6_COMPLETION_TOKEN, ptr %107, i32 0, i32 2
  %109 = load ptr, ptr %108, align 8, !tbaa !14
  store ptr %109, ptr %24, align 8, !tbaa !5
  %110 = load ptr, ptr %24, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.EFI_UDP6_RECEIVE_DATA, ptr %110, i32 0, i32 2
  store ptr %111, ptr %25, align 8, !tbaa !5
  %112 = load ptr, ptr %15, align 8, !tbaa !5
  %113 = load ptr, ptr %25, align 8, !tbaa !5
  %114 = load i16, ptr %17, align 2, !tbaa !9
  %115 = call zeroext i8 @PxeBcCheckByIpFilter(ptr noundef %112, ptr noundef %113, i16 noundef zeroext %114)
  %116 = load ptr, ptr %19, align 8, !tbaa !5
  store i8 %115, ptr %116, align 1, !tbaa !14
  %117 = load ptr, ptr %19, align 8, !tbaa !5
  %118 = load i8, ptr %117, align 1, !tbaa !14
  %119 = icmp ne i8 %118, 0
  br i1 %119, label %120, label %127

120:                                              ; preds = %106
  %121 = load ptr, ptr %15, align 8, !tbaa !5
  %122 = load ptr, ptr %25, align 8, !tbaa !5
  %123 = load ptr, ptr %20, align 8, !tbaa !5
  %124 = load i16, ptr %17, align 2, !tbaa !9
  %125 = call zeroext i8 @PxeBcCheckByDestIp(ptr noundef %121, ptr noundef %122, ptr noundef %123, i16 noundef zeroext %124)
  %126 = load ptr, ptr %19, align 8, !tbaa !5
  store i8 %125, ptr %126, align 1, !tbaa !14
  br label %127

127:                                              ; preds = %120, %106
  %128 = load ptr, ptr %19, align 8, !tbaa !5
  %129 = load i8, ptr %128, align 1, !tbaa !14
  %130 = icmp ne i8 %129, 0
  br i1 %130, label %131, label %138

131:                                              ; preds = %127
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  %133 = load ptr, ptr %25, align 8, !tbaa !5
  %134 = load ptr, ptr %21, align 8, !tbaa !5
  %135 = load i16, ptr %17, align 2, !tbaa !9
  %136 = call zeroext i8 @PxeBcCheckByDestPort(ptr noundef %132, ptr noundef %133, ptr noundef %134, i16 noundef zeroext %135)
  %137 = load ptr, ptr %19, align 8, !tbaa !5
  store i8 %136, ptr %137, align 1, !tbaa !14
  br label %138

138:                                              ; preds = %131, %127
  %139 = load ptr, ptr %19, align 8, !tbaa !5
  %140 = load i8, ptr %139, align 1, !tbaa !14
  %141 = icmp ne i8 %140, 0
  br i1 %141, label %142, label %149

142:                                              ; preds = %138
  %143 = load ptr, ptr %15, align 8, !tbaa !5
  %144 = load ptr, ptr %25, align 8, !tbaa !5
  %145 = load ptr, ptr %22, align 8, !tbaa !5
  %146 = load i16, ptr %17, align 2, !tbaa !9
  %147 = call zeroext i8 @PxeBcFilterBySrcIp(ptr noundef %143, ptr noundef %144, ptr noundef %145, i16 noundef zeroext %146)
  %148 = load ptr, ptr %19, align 8, !tbaa !5
  store i8 %147, ptr %148, align 1, !tbaa !14
  br label %149

149:                                              ; preds = %142, %138
  %150 = load ptr, ptr %19, align 8, !tbaa !5
  %151 = load i8, ptr %150, align 1, !tbaa !14
  %152 = icmp ne i8 %151, 0
  br i1 %152, label %153, label %160

153:                                              ; preds = %149
  %154 = load ptr, ptr %15, align 8, !tbaa !5
  %155 = load ptr, ptr %25, align 8, !tbaa !5
  %156 = load ptr, ptr %23, align 8, !tbaa !5
  %157 = load i16, ptr %17, align 2, !tbaa !9
  %158 = call zeroext i8 @PxeBcFilterBySrcPort(ptr noundef %154, ptr noundef %155, ptr noundef %156, i16 noundef zeroext %157)
  %159 = load ptr, ptr %19, align 8, !tbaa !5
  store i8 %158, ptr %159, align 1, !tbaa !14
  br label %160

160:                                              ; preds = %153, %149
  %161 = load ptr, ptr %19, align 8, !tbaa !5
  %162 = load i8, ptr %161, align 1, !tbaa !14
  %163 = icmp ne i8 %162, 0
  br i1 %163, label %172, label %164

164:                                              ; preds = %160
  %165 = load ptr, ptr @gBS, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %165, i32 0, i32 11
  %167 = load ptr, ptr %166, align 8, !tbaa !25
  %168 = load ptr, ptr %24, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.EFI_UDP6_RECEIVE_DATA, ptr %168, i32 0, i32 1
  %170 = load ptr, ptr %169, align 8, !tbaa !26
  %171 = call i64 %167(ptr noundef %170)
  br label %172

172:                                              ; preds = %164, %160
  br label %173

173:                                              ; preds = %172, %102
  %174 = load i64, ptr %26, align 8, !tbaa !17
  store i64 %174, ptr %12, align 8
  store i32 1, ptr %27, align 4
  br label %175

175:                                              ; preds = %173, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #2
  %176 = load i64, ptr %12, align 8
  ret i64 %176
}

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 = { 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 = !{!"short", !7, i64 0}
!11 = !{!12, !13, i64 8}
!12 = !{!"", !6, i64 0, !13, i64 8, !7, i64 16}
!13 = !{!"long long", !7, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !6, i64 32}
!16 = !{!"_EFI_UDP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!17 = !{!13, !13, i64 0}
!18 = !{!19, !6, i64 120}
!19 = !{!"", !20, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368}
!20 = !{!"", !13, i64 0, !21, i64 8, !21, i64 12, !21, i64 16, !21, i64 20}
!21 = !{!"int", !7, i64 0}
!22 = !{!16, !6, i64 48}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!19, !6, i64 104}
!26 = !{!27, !6, i64 16}
!27 = !{!"", !28, i64 0, !6, i64 16, !29, i64 24, !21, i64 60, !21, i64 64, !7, i64 72}
!28 = !{!"", !10, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !21, i64 8, !10, i64 12, !7, i64 14, !7, i64 15}
!29 = !{!"", !30, i64 0, !10, i64 16, !30, i64 18, !10, i64 34}
!30 = !{!"", !7, i64 0}


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

@gBS = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @PxeBcCheckByIpFilter(ptr noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @PxeBcCheckByDestIp(ptr noundef, ptr noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @PxeBcCheckByDestPort(ptr noundef, ptr noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @PxeBcFilterBySrcIp(ptr noundef, ptr noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @PxeBcFilterBySrcPort(ptr noundef, ptr noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeBcUdp6Read(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i16 noundef zeroext %4, ptr nocapture noundef %5, ptr nocapture noundef writeonly %6, ptr noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10) local_unnamed_addr #0 {
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  store i64 -9223372036854775802, ptr %12, align 8, !tbaa !5
  store i8 0, ptr %5, align 1, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %0, i64 32
  %14 = load ptr, ptr %13, align 8, !tbaa !12
  %15 = tail call i64 %14(ptr noundef %0, ptr noundef %1) #1
  %16 = icmp slt i64 %15, 0
  br i1 %16, label %53, label %.preheader

.preheader:                                       ; preds = %11
  %17 = getelementptr inbounds i8, ptr %0, i64 48
  %.pre69.pre = load i64, ptr %12, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %.preheader, %27
  %.pre69 = phi i64 [ %.pre69.pre, %.preheader ], [ %30, %27 ]
  %19 = load i8, ptr %5, align 1, !tbaa !11
  %.not = icmp eq i8 %19, 0
  %20 = icmp eq i64 %.pre69, -9223372036854775802
  %or.cond = select i1 %.not, i1 %20, i1 false
  br i1 %or.cond, label %21, label %.critedge

21:                                               ; preds = %18
  %22 = load ptr, ptr @gBS, align 8, !tbaa !14
  %23 = getelementptr inbounds i8, ptr %22, i64 120
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %25 = tail call i64 %24(ptr noundef %3) #1
  %26 = icmp slt i64 %25, 0
  br i1 %26, label %27, label %..critedge_crit_edge

..critedge_crit_edge:                             ; preds = %21
  %.pre = load i64, ptr %12, align 8, !tbaa !5
  br label %.critedge

27:                                               ; preds = %21
  %28 = load ptr, ptr %17, align 8, !tbaa !19
  %29 = tail call i64 %28(ptr noundef nonnull %0) #1
  %30 = load i64, ptr %12, align 8, !tbaa !5
  switch i64 %30, label %18 [
    i64 -9223372036854775786, label %.critedge
    i64 -9223372036854775708, label %.critedge
    i64 -9223372036854775707, label %.critedge
    i64 -9223372036854775706, label %.critedge
    i64 -9223372036854775705, label %.critedge
  ]

.critedge:                                        ; preds = %27, %27, %27, %27, %27, %18, %..critedge_crit_edge
  %31 = phi i64 [ %.pre, %..critedge_crit_edge ], [ %30, %27 ], [ %30, %27 ], [ %30, %27 ], [ %30, %27 ], [ %30, %27 ], [ %.pre69, %18 ]
  %32 = icmp eq i64 %31, -9223372036854775802
  %spec.select = select i1 %32, i64 -9223372036854775790, i64 %31
  %33 = icmp slt i64 %spec.select, 0
  br i1 %33, label %53, label %34

34:                                               ; preds = %.critedge
  %35 = getelementptr inbounds i8, ptr %1, i64 16
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = getelementptr inbounds i8, ptr %36, i64 24
  %38 = tail call zeroext i8 @PxeBcCheckByIpFilter(ptr noundef %2, ptr noundef nonnull %37, i16 noundef zeroext %4)
  store i8 %38, ptr %6, align 1, !tbaa !11
  %.not56 = icmp eq i8 %38, 0
  br i1 %.not56, label %.thread67, label %39

39:                                               ; preds = %34
  %40 = tail call zeroext i8 @PxeBcCheckByDestIp(ptr noundef %2, ptr noundef nonnull %37, ptr noundef %7, i16 noundef zeroext %4)
  store i8 %40, ptr %6, align 1, !tbaa !11
  %.not57 = icmp eq i8 %40, 0
  br i1 %.not57, label %.thread67, label %41

41:                                               ; preds = %39
  %42 = tail call zeroext i8 @PxeBcCheckByDestPort(ptr noundef %2, ptr noundef nonnull %37, ptr noundef %8, i16 noundef zeroext %4)
  store i8 %42, ptr %6, align 1, !tbaa !11
  %.not58 = icmp eq i8 %42, 0
  br i1 %.not58, label %.thread67, label %.thread62

.thread62:                                        ; preds = %41
  %43 = tail call zeroext i8 @PxeBcFilterBySrcIp(ptr noundef %2, ptr noundef nonnull %37, ptr noundef %9, i16 noundef zeroext %4)
  store i8 %43, ptr %6, align 1, !tbaa !11
  %44 = icmp eq i8 %43, 0
  br i1 %44, label %.thread67, label %thread-pre-split

thread-pre-split:                                 ; preds = %.thread62
  %45 = tail call zeroext i8 @PxeBcFilterBySrcPort(ptr noundef %2, ptr noundef nonnull %37, ptr noundef %10, i16 noundef zeroext %4)
  store i8 %45, ptr %6, align 1, !tbaa !11
  %46 = icmp eq i8 %45, 0
  br i1 %46, label %.thread67, label %53

.thread67:                                        ; preds = %34, %39, %.thread62, %41, %thread-pre-split
  %47 = load ptr, ptr @gBS, align 8, !tbaa !14
  %48 = getelementptr inbounds i8, ptr %47, i64 104
  %49 = load ptr, ptr %48, align 8, !tbaa !20
  %50 = getelementptr inbounds i8, ptr %36, i64 16
  %51 = load ptr, ptr %50, align 8, !tbaa !21
  %52 = tail call i64 %49(ptr noundef %51) #1
  br label %53

53:                                               ; preds = %.critedge, %.thread67, %thread-pre-split, %11
  %.0 = phi i64 [ %15, %11 ], [ %31, %thread-pre-split ], [ %31, %.thread67 ], [ %spec.select, %.critedge ]
  ret i64 %.0
}

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 = { 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, !10, i64 8}
!6 = !{!"", !7, i64 0, !10, i64 8, !8, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long long", !8, i64 0}
!11 = !{!8, !8, i64 0}
!12 = !{!13, !7, i64 32}
!13 = !{!"_EFI_UDP6_PROTOCOL", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !7, i64 120}
!16 = !{!"", !17, i64 0, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !7, i64 352, !7, i64 360, !7, i64 368}
!17 = !{!"", !10, i64 0, !18, i64 8, !18, i64 12, !18, i64 16, !18, i64 20}
!18 = !{!"int", !8, i64 0}
!19 = !{!13, !7, i64 48}
!20 = !{!16, !7, i64 104}
!21 = !{!22, !7, i64 16}
!22 = !{!"", !23, i64 0, !7, i64 16, !25, i64 24, !18, i64 60, !18, i64 64, !8, i64 72}
!23 = !{!"", !24, i64 0, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !18, i64 8, !24, i64 12, !8, i64 14, !8, i64 15}
!24 = !{!"short", !8, i64 0}
!25 = !{!"", !26, i64 0, !24, i64 16, !26, i64 18, !24, i64 34}
!26 = !{!"", !8, i64 0}


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