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

; 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_IP6_COMPLETION_TOKEN = type { ptr, i64, %union.anon.0 }
%union.anon.0 = type { ptr }
%struct._IP6_PROTOCOL = type { i32, %struct._EFI_IP6_PROTOCOL, ptr, i64, ptr, %struct._LIST_ENTRY, i8, %struct.NET_MAP, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct.EFI_LOCK, ptr, %struct._LIST_ENTRY, ptr, i32, %struct.EFI_IP6_CONFIG_DATA, i8 }
%struct._EFI_IP6_PROTOCOL = type { ptr, 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._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_IP6_CONFIG_DATA = type { i8, i8, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS, i8, i8, i32, i32, i32 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct._IP6_SERVICE = type { i32, %struct._EFI_SERVICE_BINDING_PROTOCOL, i64, i64, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, ptr, %struct.IP6_LINK_RX_TOKEN, %struct.IP6_ASSEMBLE_TABLE, %struct.IP6_MLD_SERVICE_DATA, %struct.EFI_IPv6_ADDRESS, i8, i8, i8, i8, i8, i32, i32, i32, i32, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i32, i8, ptr, i8, i8, i32, ptr, ptr, ptr, ptr, %struct.EFI_MANAGED_NETWORK_CONFIG_DATA, %struct.EFI_SIMPLE_NETWORK_MODE, ptr, ptr, %struct._IP6_CONFIG_INSTANCE, ptr, i32, i32 }
%struct._EFI_SERVICE_BINDING_PROTOCOL = type { ptr, ptr }
%struct.IP6_LINK_RX_TOKEN = type { i32, ptr, ptr, %struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN }
%struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN = type { ptr, i64, %union.anon }
%union.anon = type { ptr }
%struct.IP6_ASSEMBLE_TABLE = type { [127 x %struct._LIST_ENTRY] }
%struct.IP6_MLD_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._IP6_CONFIG_INSTANCE = type { i32, i8, %struct._LIST_ENTRY, i16, %struct.EFI_IP6_CONFIG_INTERFACE_INFO, %struct.EFI_IP6_CONFIG_INTERFACE_ID, i32, %struct.EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS, [7 x %struct.IP6_CONFIG_DATA_ITEM], %struct.NET_MAP, %struct.NET_MAP, %struct._EFI_IP6_CONFIG_PROTOCOL, ptr, ptr, ptr, ptr, i8, i32, ptr, i32, ptr, i32, %struct._IP6_FORM_CALLBACK_INFO, %struct.IP6_CONFIG_NVDATA }
%struct.EFI_IP6_CONFIG_INTERFACE_INFO = type { [32 x i16], i8, i32, %struct.EFI_MAC_ADDRESS, i32, ptr, i32, ptr }
%struct.EFI_IP6_CONFIG_INTERFACE_ID = type { [8 x i8] }
%struct.EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS = type { i32 }
%struct.IP6_CONFIG_DATA_ITEM = type { ptr, ptr, i64, i8, %struct.NET_MAP, %union.IP6_CONFIG_DATA, i64 }
%union.IP6_CONFIG_DATA = type { ptr }
%struct._EFI_IP6_CONFIG_PROTOCOL = type { ptr, ptr, ptr, ptr }
%struct._IP6_FORM_CALLBACK_INFO = type { i32, ptr, %struct._EFI_HII_CONFIG_ACCESS_PROTOCOL, ptr, ptr }
%struct._EFI_HII_CONFIG_ACCESS_PROTOCOL = type { ptr, ptr, ptr }
%struct.IP6_CONFIG_NVDATA = type { i32, %struct.EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS, %struct.EFI_IP6_CONFIG_INTERFACE_ID, %struct._LIST_ENTRY, i32, %struct._LIST_ENTRY, i32, %struct._LIST_ENTRY, i32 }
%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 }

@gBS = external global ptr, align 8
@.str = external hidden unnamed_addr constant [129 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @EfiIp6Receive(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  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
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = icmp eq ptr %11, null
  br i1 %12, label %21, label %13

13:                                               ; preds = %2
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %21, label %16

16:                                               ; preds = %13
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.EFI_IP6_COMPLETION_TOKEN, ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %16, %13, %2
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %87

22:                                               ; preds = %16
  %23 = call zeroext i8 @DebugAssertEnabled()
  %24 = zext i8 %23 to i32
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %36

26:                                               ; preds = %22
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = ptrtoint ptr %27 to i64
  %29 = sub i64 %28, ptrtoint (ptr getelementptr inbounds (%struct._IP6_PROTOCOL, ptr null, i32 0, i32 1) to i64)
  %30 = inttoptr i64 %29 to ptr
  %31 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %30, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !12
  %33 = icmp ne i32 %32, 1345736777
  br i1 %33, label %34, label %36

34:                                               ; preds = %26
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1502, ptr noundef @.str.1)
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  br label %41

36:                                               ; preds = %26, %22
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = ptrtoint ptr %37 to i64
  %39 = sub i64 %38, ptrtoint (ptr getelementptr inbounds (%struct._IP6_PROTOCOL, ptr null, i32 0, i32 1) to i64)
  %40 = inttoptr i64 %39 to ptr
  br label %41

41:                                               ; preds = %36, %34
  %42 = phi ptr [ %35, %34 ], [ %40, %36 ]
  store ptr %42, ptr %6, align 8, !tbaa !5
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %43, i32 0, i32 4
  %45 = load ptr, ptr %44, align 8, !tbaa !21
  store ptr %45, ptr %9, align 8, !tbaa !5
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct._IP6_SERVICE, ptr %46, i32 0, i32 13
  %48 = load i8, ptr %47, align 1, !tbaa !22
  %49 = icmp ne i8 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %41
  store i64 -9223372036854775801, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %87

51:                                               ; preds = %41
  %52 = load ptr, ptr @gBS, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !37
  %55 = call i64 %54(i64 noundef 8)
  store i64 %55, ptr %8, align 8, !tbaa !40
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %56, i32 0, i32 3
  %58 = load i64, ptr %57, align 8, !tbaa !41
  %59 = icmp ne i64 %58, 1
  br i1 %59, label %60, label %61

60:                                               ; preds = %51
  store i64 -9223372036854775789, ptr %7, align 8, !tbaa !40
  br label %81

61:                                               ; preds = %51
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %62, i32 0, i32 7
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = call i64 @NetMapIterate(ptr noundef %63, ptr noundef @Ip6TokenExist, ptr noundef %64)
  store i64 %65, ptr %7, align 8, !tbaa !40
  %66 = load i64, ptr %7, align 8, !tbaa !40
  %67 = icmp slt i64 %66, 0
  br i1 %67, label %68, label %69

68:                                               ; preds = %61
  store i64 -9223372036854775793, ptr %7, align 8, !tbaa !40
  br label %81

69:                                               ; preds = %61
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %70, i32 0, i32 7
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = call i64 @NetMapInsertTail(ptr noundef %71, ptr noundef %72, ptr noundef null)
  store i64 %73, ptr %7, align 8, !tbaa !40
  %74 = load i64, ptr %7, align 8, !tbaa !40
  %75 = icmp slt i64 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %69
  br label %81

77:                                               ; preds = %69
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = call i64 @Ip6InstanceDeliverPacket(ptr noundef %78)
  store i64 %79, ptr %7, align 8, !tbaa !40
  %80 = call i64 @DispatchDpc()
  br label %81

81:                                               ; preds = %77, %76, %68, %60
  %82 = load ptr, ptr @gBS, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.EFI_BOOT_SERVICES, ptr %82, i32 0, i32 2
  %84 = load ptr, ptr %83, align 8, !tbaa !42
  %85 = load i64, ptr %8, align 8, !tbaa !40
  call void %84(i64 noundef %85)
  %86 = load i64, ptr %7, align 8, !tbaa !40
  store i64 %86, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %87

87:                                               ; preds = %81, %50, %21
  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
  %88 = load i64, ptr %3, align 8
  ret i64 %88
}

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

declare zeroext i8 @DebugAssertEnabled() #2

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

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

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

declare i64 @DispatchDpc() #2

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

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

declare i64 @Ip6InstanceDeliverPacket(ptr noundef) #2

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!10 = !{!"", !6, i64 0, !11, i64 8, !7, i64 16}
!11 = !{!"long long", !7, i64 0}
!12 = !{!13, !14, i64 0}
!13 = !{!"_IP6_PROTOCOL", !14, i64 0, !15, i64 8, !6, i64 80, !11, i64 88, !6, i64 96, !16, i64 104, !7, i64 120, !17, i64 128, !17, i64 168, !16, i64 208, !16, i64 224, !18, i64 240, !6, i64 264, !16, i64 272, !6, i64 288, !14, i64 296, !19, i64 300, !7, i64 352}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_EFI_IP6_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, !6, i64 64}
!16 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!17 = !{!"", !16, i64 0, !16, i64 16, !11, i64 32}
!18 = !{!"", !11, i64 0, !11, i64 8, !14, i64 16}
!19 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !20, i64 4, !20, i64 20, !7, i64 36, !7, i64 37, !14, i64 40, !14, i64 44, !14, i64 48}
!20 = !{!"", !7, i64 0}
!21 = !{!13, !6, i64 96}
!22 = !{!23, !7, i64 2209}
!23 = !{!"_IP6_SERVICE", !14, i64 0, !24, i64 8, !11, i64 24, !11, i64 32, !16, i64 40, !16, i64 56, !6, i64 72, !6, i64 80, !25, i64 88, !20, i64 136, !26, i64 2168, !20, i64 2192, !7, i64 2208, !7, i64 2209, !7, i64 2210, !7, i64 2211, !7, i64 2212, !14, i64 2216, !14, i64 2220, !14, i64 2224, !14, i64 2228, !16, i64 2232, !16, i64 2248, !16, i64 2264, !16, i64 2280, !14, i64 2296, !7, i64 2300, !6, i64 2304, !7, i64 2312, !7, i64 2313, !14, i64 2316, !6, i64 2320, !6, i64 2328, !6, i64 2336, !6, i64 2344, !27, i64 2352, !29, i64 2372, !6, i64 3032, !6, i64 3040, !30, i64 3048, !6, i64 4176, !14, i64 4184, !14, i64 4188}
!24 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!25 = !{!"", !14, i64 0, !6, i64 8, !6, i64 16, !10, i64 24}
!26 = !{!"", !11, i64 0, !16, i64 8}
!27 = !{!"", !14, i64 0, !14, i64 4, !28, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!28 = !{!"short", !7, i64 0}
!29 = !{!"", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !7, i64 40, !20, i64 552, !20, i64 584, !20, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!30 = !{!"_IP6_CONFIG_INSTANCE", !14, i64 0, !7, i64 4, !16, i64 8, !28, i64 24, !31, i64 32, !20, i64 168, !14, i64 176, !32, i64 180, !7, i64 184, !17, i64 800, !17, i64 840, !33, i64 880, !6, i64 912, !6, i64 920, !6, i64 928, !6, i64 936, !7, i64 944, !14, i64 948, !6, i64 952, !14, i64 960, !6, i64 968, !14, i64 976, !34, i64 984, !36, i64 1040}
!31 = !{!"", !7, i64 0, !7, i64 64, !14, i64 68, !20, i64 72, !14, i64 104, !6, i64 112, !14, i64 120, !6, i64 128}
!32 = !{!"", !14, i64 0}
!33 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!34 = !{!"_IP6_FORM_CALLBACK_INFO", !14, i64 0, !6, i64 8, !35, i64 16, !6, i64 40, !6, i64 48}
!35 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!36 = !{!"", !14, i64 0, !32, i64 4, !20, i64 8, !16, i64 16, !14, i64 32, !16, i64 40, !14, i64 56, !16, i64 64, !14, i64 80}
!37 = !{!38, !6, i64 24}
!38 = !{!"", !39, 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}
!39 = !{!"", !11, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!40 = !{!11, !11, i64 0}
!41 = !{!13, !11, i64 88}
!42 = !{!38, !6, i64 32}


; 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
@.str = external hidden unnamed_addr constant [129 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @EfiIp6Receive(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = icmp eq ptr %0, null
  %4 = icmp eq ptr %1, null
  %or.cond = or i1 %3, %4
  br i1 %or.cond, label %39, label %5

5:                                                ; preds = %2
  %6 = load ptr, ptr %1, align 8, !tbaa !5
  %7 = icmp eq ptr %6, null
  br i1 %7, label %39, label %8

8:                                                ; preds = %5
  %9 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not = icmp eq i8 %9, 0
  %.pre = ptrtoint ptr %0 to i64
  %.pre26 = add i64 %.pre, -8
  %.pre28 = inttoptr i64 %.pre26 to ptr
  br i1 %.not, label %._crit_edge, label %10

10:                                               ; preds = %8
  %11 = load i32, ptr %.pre28, align 8, !tbaa !11
  %.not23 = icmp eq i32 %11, 1345736777
  br i1 %.not23, label %._crit_edge, label %12

12:                                               ; preds = %10
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1502, ptr noundef nonnull @.str.1) #2
  br label %._crit_edge

._crit_edge:                                      ; preds = %8, %10, %12
  %13 = phi ptr [ %0, %12 ], [ %.pre28, %10 ], [ %.pre28, %8 ]
  %14 = getelementptr inbounds i8, ptr %13, i64 96
  %15 = load ptr, ptr %14, align 8, !tbaa !20
  %16 = getelementptr inbounds i8, ptr %15, i64 2209
  %17 = load i8, ptr %16, align 1, !tbaa !21
  %.not24 = icmp eq i8 %17, 0
  br i1 %.not24, label %18, label %39

18:                                               ; preds = %._crit_edge
  %19 = load ptr, ptr @gBS, align 8, !tbaa !36
  %20 = getelementptr inbounds i8, ptr %19, i64 24
  %21 = load ptr, ptr %20, align 8, !tbaa !37
  %22 = tail call i64 %21(i64 noundef 8) #2
  %23 = getelementptr inbounds i8, ptr %13, i64 88
  %24 = load i64, ptr %23, align 8, !tbaa !40
  %.not25 = icmp eq i64 %24, 1
  br i1 %.not25, label %25, label %35

25:                                               ; preds = %18
  %26 = getelementptr inbounds i8, ptr %13, i64 128
  %27 = tail call i64 @NetMapIterate(ptr noundef nonnull %26, ptr noundef nonnull @Ip6TokenExist, ptr noundef nonnull %1) #2
  %28 = icmp slt i64 %27, 0
  br i1 %28, label %35, label %29

29:                                               ; preds = %25
  %30 = tail call i64 @NetMapInsertTail(ptr noundef nonnull %26, ptr noundef nonnull %1, ptr noundef null) #2
  %31 = icmp slt i64 %30, 0
  br i1 %31, label %35, label %32

32:                                               ; preds = %29
  %33 = tail call i64 @Ip6InstanceDeliverPacket(ptr noundef nonnull %13) #2
  %34 = tail call i64 @DispatchDpc() #2
  br label %35

35:                                               ; preds = %25, %18, %29, %32
  %.019 = phi i64 [ %30, %29 ], [ %33, %32 ], [ -9223372036854775789, %18 ], [ -9223372036854775793, %25 ]
  %36 = load ptr, ptr @gBS, align 8, !tbaa !36
  %37 = getelementptr inbounds i8, ptr %36, i64 32
  %38 = load ptr, ptr %37, align 8, !tbaa !41
  tail call void %38(i64 noundef %22) #2
  br label %39

39:                                               ; preds = %._crit_edge, %2, %5, %35
  %.0 = phi i64 [ %.019, %35 ], [ -9223372036854775806, %5 ], [ -9223372036854775806, %2 ], [ -9223372036854775801, %._crit_edge ]
  ret i64 %.0
}

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

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

declare i64 @DispatchDpc() local_unnamed_addr #1

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

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

declare i64 @Ip6InstanceDeliverPacket(ptr noundef) local_unnamed_addr #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 = !{!"", !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 = !{!12, !13, i64 0}
!12 = !{!"_IP6_PROTOCOL", !13, i64 0, !14, i64 8, !7, i64 80, !10, i64 88, !7, i64 96, !15, i64 104, !8, i64 120, !16, i64 128, !16, i64 168, !15, i64 208, !15, i64 224, !17, i64 240, !7, i64 264, !15, i64 272, !7, i64 288, !13, i64 296, !18, i64 300, !8, i64 352}
!13 = !{!"int", !8, i64 0}
!14 = !{!"_EFI_IP6_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, !7, i64 64}
!15 = !{!"_LIST_ENTRY", !7, i64 0, !7, i64 8}
!16 = !{!"", !15, i64 0, !15, i64 16, !10, i64 32}
!17 = !{!"", !10, i64 0, !10, i64 8, !13, i64 16}
!18 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !19, i64 4, !19, i64 20, !8, i64 36, !8, i64 37, !13, i64 40, !13, i64 44, !13, i64 48}
!19 = !{!"", !8, i64 0}
!20 = !{!12, !7, i64 96}
!21 = !{!22, !8, i64 2209}
!22 = !{!"_IP6_SERVICE", !13, i64 0, !23, i64 8, !10, i64 24, !10, i64 32, !15, i64 40, !15, i64 56, !7, i64 72, !7, i64 80, !24, i64 88, !19, i64 136, !25, i64 2168, !19, i64 2192, !8, i64 2208, !8, i64 2209, !8, i64 2210, !8, i64 2211, !8, i64 2212, !13, i64 2216, !13, i64 2220, !13, i64 2224, !13, i64 2228, !15, i64 2232, !15, i64 2248, !15, i64 2264, !15, i64 2280, !13, i64 2296, !8, i64 2300, !7, i64 2304, !8, i64 2312, !8, i64 2313, !13, i64 2316, !7, i64 2320, !7, i64 2328, !7, i64 2336, !7, i64 2344, !26, i64 2352, !28, i64 2372, !7, i64 3032, !7, i64 3040, !29, i64 3048, !7, i64 4176, !13, i64 4184, !13, i64 4188}
!23 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !7, i64 0, !7, i64 8}
!24 = !{!"", !13, i64 0, !7, i64 8, !7, i64 16, !6, i64 24}
!25 = !{!"", !10, i64 0, !15, i64 8}
!26 = !{!"", !13, i64 0, !13, i64 4, !27, i64 8, !8, i64 10, !8, i64 11, !8, i64 12, !8, i64 13, !8, i64 14, !8, i64 15, !8, i64 16}
!27 = !{!"short", !8, i64 0}
!28 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !8, i64 40, !19, i64 552, !19, i64 584, !19, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!29 = !{!"_IP6_CONFIG_INSTANCE", !13, i64 0, !8, i64 4, !15, i64 8, !27, i64 24, !30, i64 32, !19, i64 168, !13, i64 176, !31, i64 180, !8, i64 184, !16, i64 800, !16, i64 840, !32, i64 880, !7, i64 912, !7, i64 920, !7, i64 928, !7, i64 936, !8, i64 944, !13, i64 948, !7, i64 952, !13, i64 960, !7, i64 968, !13, i64 976, !33, i64 984, !35, i64 1040}
!30 = !{!"", !8, i64 0, !8, i64 64, !13, i64 68, !19, i64 72, !13, i64 104, !7, i64 112, !13, i64 120, !7, i64 128}
!31 = !{!"", !13, i64 0}
!32 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!33 = !{!"_IP6_FORM_CALLBACK_INFO", !13, i64 0, !7, i64 8, !34, i64 16, !7, i64 40, !7, i64 48}
!34 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !7, i64 0, !7, i64 8, !7, i64 16}
!35 = !{!"", !13, i64 0, !31, i64 4, !19, i64 8, !15, i64 16, !13, i64 32, !15, i64 40, !13, i64 56, !15, i64 64, !13, i64 80}
!36 = !{!7, !7, i64 0}
!37 = !{!38, !7, i64 24}
!38 = !{!"", !39, 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}
!39 = !{!"", !10, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!40 = !{!12, !10, i64 88}
!41 = !{!38, !7, i64 32}


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