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

; 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_MAC_ADDRESS = type { [32 x i8] }
%struct._IP6_NEIGHBOR_ENTRY = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64, i8, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_MAC_ADDRESS, i32, i32, i32, %struct._LIST_ENTRY, ptr, ptr }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct._IP6_INTERFACE = type { i32, %struct._LIST_ENTRY, i64, %struct._LIST_ENTRY, i32, i8, ptr, ptr, ptr, %struct._LIST_ENTRY, %struct._LIST_ENTRY, i32, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct._LIST_ENTRY, 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._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.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%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.IP6_LINK_TX_TOKEN = type { i32, %struct._LIST_ENTRY, ptr, ptr, ptr, ptr, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_MANAGED_NETWORK_COMPLETION_TOKEN, %struct.EFI_MANAGED_NETWORK_TRANSMIT_DATA }
%struct.EFI_MANAGED_NETWORK_TRANSMIT_DATA = type { ptr, ptr, i16, i32, i16, i16, [1 x %struct.EFI_MANAGED_NETWORK_FRAGMENT_DATA] }
%struct.EFI_MANAGED_NETWORK_FRAGMENT_DATA = type { i32, ptr }
%struct._EFI_MANAGED_NETWORK_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@mZeroMacAddress = external dso_local global %struct.EFI_MAC_ADDRESS, 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 ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) #1

declare ptr @RemoveEntryList(ptr noundef) #1

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

14:                                               ; preds = %1
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %15, i32 0, i32 12
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %20

19:                                               ; preds = %14, %1
  store i32 1, ptr %10, align 4
  br label %133

20:                                               ; preds = %14
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %21, i32 0, i32 12
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %23, i32 0, i32 6
  %25 = load ptr, ptr %24, align 8, !tbaa !15
  store ptr %25, ptr %6, align 8, !tbaa !5
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %33, label %28

28:                                               ; preds = %20
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._IP6_SERVICE, ptr %29, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !17
  %32 = icmp ne i32 %31, 1396068425
  br i1 %32, label %33, label %34

33:                                               ; preds = %28, %20
  store i32 1, ptr %10, align 4
  br label %133

34:                                               ; preds = %28
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %35, i32 0, i32 7
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._IP6_SERVICE, ptr %37, i32 0, i32 36
  %39 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %38, i32 0, i32 1
  %40 = load i32, ptr %39, align 4, !tbaa !34
  %41 = zext i32 %40 to i64
  %42 = call i64 @CompareMem(ptr noundef %36, ptr noundef @mZeroMacAddress, i64 noundef %41)
  %43 = icmp eq i64 %42, 0
  br i1 %43, label %44, label %48

44:                                               ; preds = %34
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = call i64 @Ip6FreeNeighborEntry(ptr noundef %45, ptr noundef %46, i8 noundef zeroext 0, i8 noundef zeroext 1, i64 noundef -9223372036854775791, ptr noundef null, ptr noundef null)
  store i32 1, ptr %10, align 4
  br label %133

48:                                               ; preds = %34
  store i8 0, ptr %9, align 1, !tbaa !35
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %49, i32 0, i32 11
  %51 = getelementptr inbounds %struct._LIST_ENTRY, ptr %50, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !36
  store ptr %52, ptr %3, align 8, !tbaa !5
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._LIST_ENTRY, ptr %53, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !37
  store ptr %55, ptr %4, align 8, !tbaa !5
  br label %56

56:                                               ; preds = %110, %48
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %58, i32 0, i32 11
  %60 = icmp ne ptr %57, %59
  br i1 %60, label %61, label %115

61:                                               ; preds = %56
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = call ptr @RemoveEntryList(ptr noundef %62)
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = ptrtoint ptr %64 to i64
  %66 = sub i64 %65, ptrtoint (ptr getelementptr inbounds (%struct.IP6_LINK_TX_TOKEN, ptr null, i32 0, i32 1) to i64)
  %67 = inttoptr i64 %66 to ptr
  store ptr %67, ptr %7, align 8, !tbaa !5
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.IP6_LINK_TX_TOKEN, ptr %68, i32 0, i32 6
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %70, i32 0, i32 7
  %72 = call ptr @CopyMem(ptr noundef %69, ptr noundef %71, i64 noundef 32)
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %73, i32 0, i32 12
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %75, i32 0, i32 10
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.IP6_LINK_TX_TOKEN, ptr %77, i32 0, i32 1
  %79 = call ptr @InsertTailList(ptr noundef %76, ptr noundef %78)
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._IP6_SERVICE, ptr %80, i32 0, i32 34
  %82 = load ptr, ptr %81, align 8, !tbaa !38
  %83 = getelementptr inbounds %struct._EFI_MANAGED_NETWORK_PROTOCOL, ptr %82, i32 0, i32 4
  %84 = load ptr, ptr %83, align 8, !tbaa !39
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._IP6_SERVICE, ptr %85, i32 0, i32 34
  %87 = load ptr, ptr %86, align 8, !tbaa !38
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.IP6_LINK_TX_TOKEN, ptr %88, i32 0, i32 8
  %90 = call i64 %84(ptr noundef %87, ptr noundef %89)
  store i64 %90, ptr %8, align 8, !tbaa !41
  %91 = load i64, ptr %8, align 8, !tbaa !41
  %92 = icmp slt i64 %91, 0
  br i1 %92, label %93, label %108

93:                                               ; preds = %61
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.IP6_LINK_TX_TOKEN, ptr %94, i32 0, i32 1
  %96 = call ptr @RemoveEntryList(ptr noundef %95)
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.IP6_LINK_TX_TOKEN, ptr %97, i32 0, i32 3
  %99 = load ptr, ptr %98, align 8, !tbaa !42
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.IP6_LINK_TX_TOKEN, ptr %100, i32 0, i32 4
  %102 = load ptr, ptr %101, align 8, !tbaa !45
  %103 = load i64, ptr %8, align 8, !tbaa !41
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.IP6_LINK_TX_TOKEN, ptr %104, i32 0, i32 5
  %106 = load ptr, ptr %105, align 8, !tbaa !46
  call void %99(ptr noundef %102, i64 noundef %103, i32 noundef 0, ptr noundef %106)
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  call void @Ip6FreeLinkTxToken(ptr noundef %107)
  br label %110

108:                                              ; preds = %61
  store i8 1, ptr %9, align 1, !tbaa !35
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109, %93
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %111, ptr %3, align 8, !tbaa !5
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._LIST_ENTRY, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !37
  store ptr %114, ptr %4, align 8, !tbaa !5
  br label %56, !llvm.loop !47

115:                                              ; preds = %56
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = call i64 @Ip6FreeNeighborEntry(ptr noundef %116, ptr noundef %117, i8 noundef zeroext 0, i8 noundef zeroext 0, i64 noundef 0, ptr noundef null, ptr noundef null)
  %119 = load i8, ptr %9, align 1, !tbaa !35
  %120 = zext i8 %119 to i32
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %132

122:                                              ; preds = %115
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %123, i32 0, i32 8
  %125 = load i32, ptr %124, align 4, !tbaa !49
  %126 = icmp eq i32 %125, 2
  br i1 %126, label %127, label %132

127:                                              ; preds = %122
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %128, i32 0, i32 8
  store i32 3, ptr %129, align 4, !tbaa !49
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct._IP6_NEIGHBOR_ENTRY, ptr %130, i32 0, i32 10
  store i32 50, ptr %131, align 4, !tbaa !50
  br label %132

132:                                              ; preds = %127, %122, %115
  store i32 0, ptr %10, align 4
  br label %133

133:                                              ; preds = %132, %44, %33, %19
  call void @llvm.lifetime.end.p0(i64 1, 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
  %134 = load i32, ptr %10, align 4
  switch i32 %134, label %136 [
    i32 0, label %135
    i32 1, label %135
  ]

135:                                              ; preds = %133, %133
  ret void

136:                                              ; preds = %133
  unreachable
}

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

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

declare ptr @InsertTailList(ptr noundef, ptr noundef) #1

declare void @Ip6FreeLinkTxToken(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, !6, i64 120}
!10 = !{!"_IP6_NEIGHBOR_ENTRY", !11, i64 0, !11, i64 16, !12, i64 32, !7, i64 40, !7, i64 41, !7, i64 42, !13, i64 43, !13, i64 59, !14, i64 92, !14, i64 96, !14, i64 100, !11, i64 104, !6, i64 120, !6, i64 128}
!11 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !6, i64 56}
!16 = !{!"_IP6_INTERFACE", !14, i64 0, !11, i64 8, !12, i64 24, !11, i64 32, !14, i64 48, !7, i64 52, !6, i64 56, !6, i64 64, !6, i64 72, !11, i64 80, !11, i64 96, !14, i64 112, !11, i64 120, !11, i64 136, !11, i64 152, !7, i64 168}
!17 = !{!18, !14, i64 0}
!18 = !{!"_IP6_SERVICE", !14, i64 0, !19, i64 8, !12, i64 24, !12, i64 32, !11, i64 40, !11, i64 56, !6, i64 72, !6, i64 80, !20, i64 88, !13, i64 136, !22, i64 2168, !13, 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, !11, i64 2232, !11, i64 2248, !11, i64 2264, !11, 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, !23, i64 2352, !25, i64 2372, !6, i64 3032, !6, i64 3040, !26, i64 3048, !6, i64 4176, !14, i64 4184, !14, i64 4188}
!19 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!20 = !{!"", !14, i64 0, !6, i64 8, !6, i64 16, !21, i64 24}
!21 = !{!"", !6, i64 0, !12, i64 8, !7, i64 16}
!22 = !{!"", !12, i64 0, !11, i64 8}
!23 = !{!"", !14, i64 0, !14, i64 4, !24, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!24 = !{!"short", !7, i64 0}
!25 = !{!"", !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, !13, i64 552, !13, i64 584, !13, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!26 = !{!"_IP6_CONFIG_INSTANCE", !14, i64 0, !7, i64 4, !11, i64 8, !24, i64 24, !27, i64 32, !13, i64 168, !14, i64 176, !28, i64 180, !7, i64 184, !29, i64 800, !29, i64 840, !30, 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, !31, i64 984, !33, i64 1040}
!27 = !{!"", !7, i64 0, !7, i64 64, !14, i64 68, !13, i64 72, !14, i64 104, !6, i64 112, !14, i64 120, !6, i64 128}
!28 = !{!"", !14, i64 0}
!29 = !{!"", !11, i64 0, !11, i64 16, !12, i64 32}
!30 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!31 = !{!"_IP6_FORM_CALLBACK_INFO", !14, i64 0, !6, i64 8, !32, i64 16, !6, i64 40, !6, i64 48}
!32 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!"", !14, i64 0, !28, i64 4, !13, i64 8, !11, i64 16, !14, i64 32, !11, i64 40, !14, i64 56, !11, i64 64, !14, i64 80}
!34 = !{!18, !14, i64 2376}
!35 = !{!7, !7, i64 0}
!36 = !{!10, !6, i64 104}
!37 = !{!11, !6, i64 0}
!38 = !{!18, !6, i64 2344}
!39 = !{!40, !6, i64 32}
!40 = !{!"_EFI_MANAGED_NETWORK_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}
!41 = !{!12, !12, i64 0}
!42 = !{!43, !6, i64 32}
!43 = !{!"", !14, i64 0, !11, i64 8, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !13, i64 56, !13, i64 88, !21, i64 120, !44, i64 144}
!44 = !{!"", !6, i64 0, !6, i64 8, !24, i64 16, !14, i64 20, !24, i64 24, !24, i64 26, !7, i64 32}
!45 = !{!43, !6, i64 40}
!46 = !{!43, !6, i64 48}
!47 = distinct !{!47, !48}
!48 = !{!"llvm.loop.mustprogress"}
!49 = !{!10, !14, i64 92}
!50 = !{!10, !14, i64 100}


; 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.EFI_MAC_ADDRESS = type { [32 x i8] }

@mZeroMacAddress = external dso_local global %struct.EFI_MAC_ADDRESS, align 1

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

declare ptr @RemoveEntryList(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @Ip6OnArpResolved(ptr noundef %0) local_unnamed_addr #1 {
  %2 = icmp eq ptr %0, null
  br i1 %2, label %61, label %3

3:                                                ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 120
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = icmp eq ptr %5, null
  br i1 %6, label %61, label %7

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %5, i64 56
  %9 = load ptr, ptr %8, align 8, !tbaa !14
  %10 = icmp eq ptr %9, null
  br i1 %10, label %61, label %11

11:                                               ; preds = %7
  %12 = load i32, ptr %9, align 8, !tbaa !16
  %.not = icmp eq i32 %12, 1396068425
  br i1 %.not, label %13, label %61

13:                                               ; preds = %11
  %14 = getelementptr inbounds i8, ptr %0, i64 59
  %15 = getelementptr inbounds i8, ptr %9, i64 2376
  %16 = load i32, ptr %15, align 4, !tbaa !33
  %17 = zext i32 %16 to i64
  %18 = tail call i64 @CompareMem(ptr noundef nonnull %14, ptr noundef nonnull @mZeroMacAddress, i64 noundef %17) #2
  %19 = icmp eq i64 %18, 0
  br i1 %19, label %20, label %22

20:                                               ; preds = %13
  %21 = tail call i64 @Ip6FreeNeighborEntry(ptr noundef nonnull %9, ptr noundef nonnull %0, i8 noundef zeroext 0, i8 noundef zeroext 1, i64 noundef -9223372036854775791, ptr noundef null, ptr noundef null)
  br label %61

22:                                               ; preds = %13
  %23 = getelementptr inbounds i8, ptr %0, i64 104
  %24 = load ptr, ptr %23, align 8, !tbaa !34
  %.not4346 = icmp eq ptr %24, %23
  br i1 %.not4346, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %22
  %25 = tail call i64 @Ip6FreeNeighborEntry(ptr noundef nonnull %9, ptr noundef nonnull %0, i8 noundef zeroext 0, i8 noundef zeroext 0, i64 noundef 0, ptr noundef null, ptr noundef null)
  br label %61

.lr.ph:                                           ; preds = %22
  %26 = getelementptr inbounds i8, ptr %9, i64 2344
  br label %.outer

.outer:                                           ; preds = %.thread, %.lr.ph
  %27 = phi i1 [ false, %.thread ], [ true, %.lr.ph ]
  %.03747.ph = phi ptr [ %.03849, %.thread ], [ %24, %.lr.ph ]
  br label %28

28:                                               ; preds = %.outer, %45
  %.03747 = phi ptr [ %.03849, %45 ], [ %.03747.ph, %.outer ]
  %.03849 = load ptr, ptr %.03747, align 8, !tbaa !35
  %29 = tail call ptr @RemoveEntryList(ptr noundef nonnull %.03747) #2
  %30 = ptrtoint ptr %.03747 to i64
  %31 = add i64 %30, -8
  %32 = inttoptr i64 %31 to ptr
  %33 = getelementptr inbounds i8, ptr %32, i64 56
  %34 = tail call ptr @CopyMem(ptr noundef nonnull %33, ptr noundef nonnull %14, i64 noundef 32) #2
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %35, i64 96
  %37 = getelementptr inbounds i8, ptr %32, i64 8
  %38 = tail call ptr @InsertTailList(ptr noundef nonnull %36, ptr noundef nonnull %37) #2
  %39 = load ptr, ptr %26, align 8, !tbaa !36
  %40 = getelementptr inbounds i8, ptr %39, i64 32
  %41 = load ptr, ptr %40, align 8, !tbaa !37
  %42 = getelementptr inbounds i8, ptr %32, i64 120
  %43 = tail call i64 %41(ptr noundef %39, ptr noundef nonnull %42) #2
  %44 = icmp slt i64 %43, 0
  br i1 %44, label %45, label %.thread

45:                                               ; preds = %28
  %46 = tail call ptr @RemoveEntryList(ptr noundef nonnull %37) #2
  %47 = getelementptr inbounds i8, ptr %32, i64 32
  %48 = load ptr, ptr %47, align 8, !tbaa !39
  %49 = getelementptr inbounds i8, ptr %32, i64 40
  %50 = load ptr, ptr %49, align 8, !tbaa !42
  %51 = getelementptr inbounds i8, ptr %32, i64 48
  %52 = load ptr, ptr %51, align 8, !tbaa !43
  tail call void %48(ptr noundef %50, i64 noundef %43, i32 noundef 0, ptr noundef %52) #2
  tail call void @Ip6FreeLinkTxToken(ptr noundef %32) #2
  %.not43 = icmp eq ptr %.03849, %23
  br i1 %.not43, label %._crit_edge, label %28, !llvm.loop !44

.thread:                                          ; preds = %28
  %.not4352 = icmp eq ptr %.03849, %23
  br i1 %.not4352, label %._crit_edge.thread54, label %.outer, !llvm.loop !44

._crit_edge.thread54:                             ; preds = %.thread
  %53 = tail call i64 @Ip6FreeNeighborEntry(ptr noundef nonnull %9, ptr noundef nonnull %0, i8 noundef zeroext 0, i8 noundef zeroext 0, i64 noundef 0, ptr noundef null, ptr noundef null)
  br label %55

._crit_edge:                                      ; preds = %45
  %54 = tail call i64 @Ip6FreeNeighborEntry(ptr noundef nonnull %9, ptr noundef nonnull %0, i8 noundef zeroext 0, i8 noundef zeroext 0, i64 noundef 0, ptr noundef null, ptr noundef null)
  br i1 %27, label %61, label %55

55:                                               ; preds = %._crit_edge.thread54, %._crit_edge
  %56 = getelementptr inbounds i8, ptr %0, i64 92
  %57 = load i32, ptr %56, align 4, !tbaa !46
  %58 = icmp eq i32 %57, 2
  br i1 %58, label %59, label %61

59:                                               ; preds = %55
  store i32 3, ptr %56, align 4, !tbaa !46
  %60 = getelementptr inbounds i8, ptr %0, i64 100
  store i32 50, ptr %60, align 4, !tbaa !47
  br label %61

61:                                               ; preds = %._crit_edge.thread, %._crit_edge, %55, %59, %7, %11, %1, %3, %20
  ret void
}

declare i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

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

declare ptr @InsertTailList(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @Ip6FreeLinkTxToken(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, !8, i64 120}
!6 = !{!"_IP6_NEIGHBOR_ENTRY", !7, i64 0, !7, i64 16, !11, i64 32, !9, i64 40, !9, i64 41, !9, i64 42, !12, i64 43, !12, i64 59, !13, i64 92, !13, i64 96, !13, i64 100, !7, i64 104, !8, i64 120, !8, i64 128}
!7 = !{!"_LIST_ENTRY", !8, i64 0, !8, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"long long", !9, i64 0}
!12 = !{!"", !9, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = !{!15, !8, i64 56}
!15 = !{!"_IP6_INTERFACE", !13, i64 0, !7, i64 8, !11, i64 24, !7, i64 32, !13, i64 48, !9, i64 52, !8, i64 56, !8, i64 64, !8, i64 72, !7, i64 80, !7, i64 96, !13, i64 112, !7, i64 120, !7, i64 136, !7, i64 152, !9, i64 168}
!16 = !{!17, !13, i64 0}
!17 = !{!"_IP6_SERVICE", !13, i64 0, !18, i64 8, !11, i64 24, !11, i64 32, !7, i64 40, !7, i64 56, !8, i64 72, !8, i64 80, !19, i64 88, !12, i64 136, !21, i64 2168, !12, i64 2192, !9, i64 2208, !9, i64 2209, !9, i64 2210, !9, i64 2211, !9, i64 2212, !13, i64 2216, !13, i64 2220, !13, i64 2224, !13, i64 2228, !7, i64 2232, !7, i64 2248, !7, i64 2264, !7, i64 2280, !13, i64 2296, !9, i64 2300, !8, i64 2304, !9, i64 2312, !9, i64 2313, !13, i64 2316, !8, i64 2320, !8, i64 2328, !8, i64 2336, !8, i64 2344, !22, i64 2352, !24, i64 2372, !8, i64 3032, !8, i64 3040, !25, i64 3048, !8, i64 4176, !13, i64 4184, !13, i64 4188}
!18 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !8, i64 0, !8, i64 8}
!19 = !{!"", !13, i64 0, !8, i64 8, !8, i64 16, !20, i64 24}
!20 = !{!"", !8, i64 0, !11, i64 8, !9, i64 16}
!21 = !{!"", !11, i64 0, !7, i64 8}
!22 = !{!"", !13, i64 0, !13, i64 4, !23, i64 8, !9, i64 10, !9, i64 11, !9, i64 12, !9, i64 13, !9, i64 14, !9, i64 15, !9, i64 16}
!23 = !{!"short", !9, i64 0}
!24 = !{!"", !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, !9, i64 40, !12, i64 552, !12, i64 584, !12, i64 616, !9, i64 648, !9, i64 649, !9, i64 650, !9, i64 651, !9, i64 652}
!25 = !{!"_IP6_CONFIG_INSTANCE", !13, i64 0, !9, i64 4, !7, i64 8, !23, i64 24, !26, i64 32, !12, i64 168, !13, i64 176, !27, i64 180, !9, i64 184, !28, i64 800, !28, i64 840, !29, i64 880, !8, i64 912, !8, i64 920, !8, i64 928, !8, i64 936, !9, i64 944, !13, i64 948, !8, i64 952, !13, i64 960, !8, i64 968, !13, i64 976, !30, i64 984, !32, i64 1040}
!26 = !{!"", !9, i64 0, !9, i64 64, !13, i64 68, !12, i64 72, !13, i64 104, !8, i64 112, !13, i64 120, !8, i64 128}
!27 = !{!"", !13, i64 0}
!28 = !{!"", !7, i64 0, !7, i64 16, !11, i64 32}
!29 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24}
!30 = !{!"_IP6_FORM_CALLBACK_INFO", !13, i64 0, !8, i64 8, !31, i64 16, !8, i64 40, !8, i64 48}
!31 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !8, i64 0, !8, i64 8, !8, i64 16}
!32 = !{!"", !13, i64 0, !27, i64 4, !12, i64 8, !7, i64 16, !13, i64 32, !7, i64 40, !13, i64 56, !7, i64 64, !13, i64 80}
!33 = !{!17, !13, i64 2376}
!34 = !{!6, !8, i64 104}
!35 = !{!7, !8, i64 0}
!36 = !{!17, !8, i64 2344}
!37 = !{!38, !8, i64 32}
!38 = !{!"_EFI_MANAGED_NETWORK_PROTOCOL", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48, !8, i64 56}
!39 = !{!40, !8, i64 32}
!40 = !{!"", !13, i64 0, !7, i64 8, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48, !12, i64 56, !12, i64 88, !20, i64 120, !41, i64 144}
!41 = !{!"", !8, i64 0, !8, i64 8, !23, i64 16, !13, i64 20, !23, i64 24, !23, i64 26, !9, i64 32}
!42 = !{!40, !8, i64 40}
!43 = !{!40, !8, i64 48}
!44 = distinct !{!44, !45}
!45 = !{!"llvm.loop.mustprogress"}
!46 = !{!6, !13, i64 92}
!47 = !{!6, !13, i64 100}


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