; 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_IP6_HEADER = type { i16, i16, i16, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS }
%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._LIST_ENTRY = type { ptr, ptr }
%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.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_ICMP_INFORMATION_HEAD = type { %struct.IP6_ICMP_HEAD, i32 }
%struct.IP6_ICMP_HEAD = type { i8, i8, i16 }
%struct._IP6_ETHE_ADDR_OPTION = type { i8, i8, [6 x i8] }

@.str = external hidden unnamed_addr constant [127 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [23 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 ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) #1

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) #1

declare ptr @NetbufAlloc(i32 noundef) #1

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

declare void @NetbufReserve(ptr noundef, i32 noundef) #1

declare ptr @NetbufAllocSpace(ptr noundef, i32 noundef, i8 noundef zeroext) #1

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

declare void @Ip6SysPacketSent(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip6SendNeighborAdvertise(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i8 noundef zeroext %5, i8 noundef zeroext %6, i8 noundef zeroext %7) #2 {
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i8, align 1
  %16 = alloca i8, align 1
  %17 = alloca i8, align 1
  %18 = alloca ptr, align 8
  %19 = alloca %struct._EFI_IP6_HEADER, align 1
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i16, align 2
  %24 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %2, ptr %12, align 8, !tbaa !5
  store ptr %3, ptr %13, align 8, !tbaa !5
  store ptr %4, ptr %14, align 8, !tbaa !5
  store i8 %5, ptr %15, align 1, !tbaa !9
  store i8 %6, ptr %16, align 1, !tbaa !9
  store i8 %7, ptr %17, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 40, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %23) #3
  br label %25

25:                                               ; preds = %8
  %26 = call zeroext i8 @DebugAssertEnabled()
  %27 = icmp ne i8 %26, 0
  br i1 %27, label %28, label %38

28:                                               ; preds = %25
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %36

31:                                               ; preds = %28
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._IP6_SERVICE, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !10
  %35 = icmp eq i32 %34, 1396068425
  br i1 %35, label %37, label %36

36:                                               ; preds = %31, %28
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1224, ptr noundef @.str.6)
  br label %37

37:                                               ; preds = %36, %31
  br label %38

38:                                               ; preds = %37, %25
  br label %39

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  %42 = call zeroext i8 @DebugAssertEnabled()
  %43 = icmp ne i8 %42, 0
  br i1 %43, label %44, label %55

44:                                               ; preds = %41
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %47, label %53

47:                                               ; preds = %44
  %48 = load ptr, ptr %13, align 8, !tbaa !5
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %53

50:                                               ; preds = %47
  %51 = load ptr, ptr %14, align 8, !tbaa !5
  %52 = icmp ne ptr %51, null
  br i1 %52, label %54, label %53

53:                                               ; preds = %50, %47, %44
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1232, ptr noundef @.str.16)
  br label %54

54:                                               ; preds = %53, %50
  br label %55

55:                                               ; preds = %54, %41
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56
  store i16 32, ptr %23, align 2, !tbaa !31
  %58 = load i16, ptr %23, align 2, !tbaa !31
  %59 = zext i16 %58 to i32
  %60 = zext i32 %59 to i64
  %61 = add i64 40, %60
  %62 = trunc i64 %61 to i32
  %63 = call ptr @NetbufAlloc(i32 noundef %62)
  store ptr %63, ptr %18, align 8, !tbaa !5
  %64 = load ptr, ptr %18, align 8, !tbaa !5
  %65 = icmp eq ptr %64, null
  br i1 %65, label %66, label %67

66:                                               ; preds = %57
  store i64 -9223372036854775799, ptr %9, align 8
  store i32 1, ptr %24, align 4
  br label %170

67:                                               ; preds = %57
  %68 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %19, i32 0, i32 1
  store i16 0, ptr %68, align 1, !tbaa !32
  %69 = load i16, ptr %19, align 1
  %70 = and i16 %69, -3841
  %71 = or i16 %70, 0
  store i16 %71, ptr %19, align 1
  %72 = load i16, ptr %23, align 2, !tbaa !31
  %73 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %72)
  %74 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %19, i32 0, i32 2
  store i16 %73, ptr %74, align 1, !tbaa !34
  %75 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %19, i32 0, i32 3
  store i8 58, ptr %75, align 1, !tbaa !35
  %76 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %19, i32 0, i32 4
  store i8 -1, ptr %76, align 1, !tbaa !36
  %77 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %19, i32 0, i32 5
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = call ptr @CopyMem(ptr noundef %77, ptr noundef %78, i64 noundef 16)
  %80 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %19, i32 0, i32 6
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = call ptr @CopyMem(ptr noundef %80, ptr noundef %81, i64 noundef 16)
  %83 = load ptr, ptr %18, align 8, !tbaa !5
  call void @NetbufReserve(ptr noundef %83, i32 noundef 40)
  %84 = load ptr, ptr %18, align 8, !tbaa !5
  %85 = call ptr @NetbufAllocSpace(ptr noundef %84, i32 noundef 8, i8 noundef zeroext 0)
  store ptr %85, ptr %20, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %67
  %87 = call zeroext i8 @DebugAssertEnabled()
  %88 = icmp ne i8 %87, 0
  br i1 %88, label %89, label %94

89:                                               ; preds = %86
  %90 = load ptr, ptr %20, align 8, !tbaa !5
  %91 = icmp ne ptr %90, null
  br i1 %91, label %93, label %92

92:                                               ; preds = %89
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1265, ptr noundef @.str.14)
  br label %93

93:                                               ; preds = %92, %89
  br label %94

94:                                               ; preds = %93, %86
  br label %95

95:                                               ; preds = %94
  br label %96

96:                                               ; preds = %95
  %97 = load ptr, ptr %20, align 8, !tbaa !5
  %98 = call ptr @ZeroMem(ptr noundef %97, i64 noundef 8)
  %99 = load ptr, ptr %20, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %99, i32 0, i32 0
  %101 = getelementptr inbounds %struct.IP6_ICMP_HEAD, ptr %100, i32 0, i32 0
  store i8 -120, ptr %101, align 1, !tbaa !37
  %102 = load ptr, ptr %20, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %102, i32 0, i32 0
  %104 = getelementptr inbounds %struct.IP6_ICMP_HEAD, ptr %103, i32 0, i32 1
  store i8 0, ptr %104, align 1, !tbaa !40
  %105 = load i8, ptr %15, align 1, !tbaa !9
  %106 = icmp ne i8 %105, 0
  br i1 %106, label %107, label %112

107:                                              ; preds = %96
  %108 = load ptr, ptr %20, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %108, i32 0, i32 1
  %110 = load i32, ptr %109, align 1, !tbaa !41
  %111 = or i32 %110, 128
  store i32 %111, ptr %109, align 1, !tbaa !41
  br label %112

112:                                              ; preds = %107, %96
  %113 = load i8, ptr %17, align 1, !tbaa !9
  %114 = icmp ne i8 %113, 0
  br i1 %114, label %115, label %120

115:                                              ; preds = %112
  %116 = load ptr, ptr %20, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %116, i32 0, i32 1
  %118 = load i32, ptr %117, align 1, !tbaa !41
  %119 = or i32 %118, 64
  store i32 %119, ptr %117, align 1, !tbaa !41
  br label %120

120:                                              ; preds = %115, %112
  %121 = load i8, ptr %16, align 1, !tbaa !9
  %122 = icmp ne i8 %121, 0
  br i1 %122, label %123, label %128

123:                                              ; preds = %120
  %124 = load ptr, ptr %20, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %124, i32 0, i32 1
  %126 = load i32, ptr %125, align 1, !tbaa !41
  %127 = or i32 %126, 32
  store i32 %127, ptr %125, align 1, !tbaa !41
  br label %128

128:                                              ; preds = %123, %120
  %129 = load ptr, ptr %18, align 8, !tbaa !5
  %130 = call ptr @NetbufAllocSpace(ptr noundef %129, i32 noundef 16, i8 noundef zeroext 0)
  store ptr %130, ptr %22, align 8, !tbaa !5
  br label %131

131:                                              ; preds = %128
  %132 = call zeroext i8 @DebugAssertEnabled()
  %133 = icmp ne i8 %132, 0
  br i1 %133, label %134, label %139

134:                                              ; preds = %131
  %135 = load ptr, ptr %22, align 8, !tbaa !5
  %136 = icmp ne ptr %135, null
  br i1 %136, label %138, label %137

137:                                              ; preds = %134
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1283, ptr noundef @.str.17)
  br label %138

138:                                              ; preds = %137, %134
  br label %139

139:                                              ; preds = %138, %131
  br label %140

140:                                              ; preds = %139
  br label %141

141:                                              ; preds = %140
  %142 = load ptr, ptr %22, align 8, !tbaa !5
  %143 = load ptr, ptr %13, align 8, !tbaa !5
  %144 = call ptr @CopyMem(ptr noundef %142, ptr noundef %143, i64 noundef 16)
  %145 = load ptr, ptr %18, align 8, !tbaa !5
  %146 = call ptr @NetbufAllocSpace(ptr noundef %145, i32 noundef 8, i8 noundef zeroext 0)
  store ptr %146, ptr %21, align 8, !tbaa !5
  br label %147

147:                                              ; preds = %141
  %148 = call zeroext i8 @DebugAssertEnabled()
  %149 = icmp ne i8 %148, 0
  br i1 %149, label %150, label %155

150:                                              ; preds = %147
  %151 = load ptr, ptr %21, align 8, !tbaa !5
  %152 = icmp ne ptr %151, null
  br i1 %152, label %154, label %153

153:                                              ; preds = %150
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1291, ptr noundef @.str.15)
  br label %154

154:                                              ; preds = %153, %150
  br label %155

155:                                              ; preds = %154, %147
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  %158 = load ptr, ptr %21, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %158, i32 0, i32 0
  store i8 2, ptr %159, align 1, !tbaa !42
  %160 = load ptr, ptr %21, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %160, i32 0, i32 1
  store i8 1, ptr %161, align 1, !tbaa !44
  %162 = load ptr, ptr %21, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %162, i32 0, i32 2
  %164 = getelementptr inbounds [6 x i8], ptr %163, i64 0, i64 0
  %165 = load ptr, ptr %14, align 8, !tbaa !5
  %166 = call ptr @CopyMem(ptr noundef %164, ptr noundef %165, i64 noundef 6)
  %167 = load ptr, ptr %10, align 8, !tbaa !5
  %168 = load ptr, ptr %18, align 8, !tbaa !5
  %169 = call i64 @Ip6Output(ptr noundef %167, ptr noundef null, ptr noundef null, ptr noundef %168, ptr noundef %19, ptr noundef null, i32 noundef 0, ptr noundef @Ip6SysPacketSent, ptr noundef null)
  store i64 %169, ptr %9, align 8
  store i32 1, ptr %24, align 4
  br label %170

170:                                              ; preds = %157, %66
  call void @llvm.lifetime.end.p0(i64 2, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  %171 = load i64, ptr %9, align 8
  ret i64 %171
}

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


; 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_IP6_HEADER = type { i16, i16, i16, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }

@.str = external hidden unnamed_addr constant [127 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [23 x i8], align 1

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

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

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

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) local_unnamed_addr #1

declare ptr @NetbufAlloc(i32 noundef) local_unnamed_addr #1

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

declare void @NetbufReserve(ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @NetbufAllocSpace(ptr noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #1

declare i64 @Ip6Output(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @Ip6SysPacketSent(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip6SendNeighborAdvertise(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i8 noundef zeroext %5, i8 noundef zeroext %6, i8 noundef zeroext %7) local_unnamed_addr #2 {
  %9 = alloca %struct._EFI_IP6_HEADER, align 2
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #3
  %10 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %10, 0
  br i1 %.not, label %16, label %11

11:                                               ; preds = %8
  %.not45 = icmp eq ptr %0, null
  br i1 %.not45, label %15, label %12

12:                                               ; preds = %11
  %13 = load i32, ptr %0, align 8, !tbaa !5
  %14 = icmp eq i32 %13, 1396068425
  br i1 %14, label %16, label %15

15:                                               ; preds = %12, %11
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1224, ptr noundef nonnull @.str.6) #3
  br label %16

16:                                               ; preds = %8, %15, %12
  %17 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not46 = icmp eq i8 %17, 0
  br i1 %.not46, label %23, label %18

18:                                               ; preds = %16
  %19 = icmp ne ptr %2, null
  %20 = icmp ne ptr %3, null
  %or.cond = and i1 %19, %20
  %21 = icmp ne ptr %4, null
  %or.cond3 = and i1 %or.cond, %21
  br i1 %or.cond3, label %23, label %22

22:                                               ; preds = %18
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1232, ptr noundef nonnull @.str.16) #3
  br label %23

23:                                               ; preds = %22, %18, %16
  %24 = tail call ptr @NetbufAlloc(i32 noundef 72) #3
  %25 = icmp eq ptr %24, null
  br i1 %25, label %76, label %26

26:                                               ; preds = %23
  %27 = getelementptr inbounds i8, ptr %9, i64 2
  store i16 0, ptr %27, align 2, !tbaa !29
  store i16 0, ptr %9, align 2
  %28 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext 32) #3
  %29 = getelementptr inbounds i8, ptr %9, i64 4
  store i16 %28, ptr %29, align 2, !tbaa !31
  %30 = getelementptr inbounds i8, ptr %9, i64 6
  store i8 58, ptr %30, align 2, !tbaa !32
  %31 = getelementptr inbounds i8, ptr %9, i64 7
  store i8 -1, ptr %31, align 1, !tbaa !33
  %32 = getelementptr inbounds i8, ptr %9, i64 8
  %33 = call ptr @CopyMem(ptr noundef nonnull %32, ptr noundef %1, i64 noundef 16) #3
  %34 = getelementptr inbounds i8, ptr %9, i64 24
  %35 = call ptr @CopyMem(ptr noundef nonnull %34, ptr noundef %2, i64 noundef 16) #3
  call void @NetbufReserve(ptr noundef nonnull %24, i32 noundef 40) #3
  %36 = call ptr @NetbufAllocSpace(ptr noundef nonnull %24, i32 noundef 8, i8 noundef zeroext 0) #3
  %37 = call zeroext i8 @DebugAssertEnabled() #3
  %38 = icmp eq i8 %37, 0
  %39 = icmp ne ptr %36, null
  %or.cond5 = select i1 %38, i1 true, i1 %39
  br i1 %or.cond5, label %41, label %40

40:                                               ; preds = %26
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1265, ptr noundef nonnull @.str.14) #3
  br label %41

41:                                               ; preds = %40, %26
  %42 = call ptr @ZeroMem(ptr noundef %36, i64 noundef 8) #3
  store i8 -120, ptr %36, align 1, !tbaa !34
  %43 = getelementptr inbounds i8, ptr %36, i64 1
  store i8 0, ptr %43, align 1, !tbaa !37
  %.not47 = icmp eq i8 %5, 0
  br i1 %.not47, label %48, label %44

44:                                               ; preds = %41
  %45 = getelementptr inbounds i8, ptr %36, i64 4
  %46 = load i32, ptr %45, align 1, !tbaa !38
  %47 = or i32 %46, 128
  store i32 %47, ptr %45, align 1, !tbaa !38
  br label %48

48:                                               ; preds = %44, %41
  %.not48 = icmp eq i8 %7, 0
  br i1 %.not48, label %53, label %49

49:                                               ; preds = %48
  %50 = getelementptr inbounds i8, ptr %36, i64 4
  %51 = load i32, ptr %50, align 1, !tbaa !38
  %52 = or i32 %51, 64
  store i32 %52, ptr %50, align 1, !tbaa !38
  br label %53

53:                                               ; preds = %49, %48
  %.not49 = icmp eq i8 %6, 0
  br i1 %.not49, label %58, label %54

54:                                               ; preds = %53
  %55 = getelementptr inbounds i8, ptr %36, i64 4
  %56 = load i32, ptr %55, align 1, !tbaa !38
  %57 = or i32 %56, 32
  store i32 %57, ptr %55, align 1, !tbaa !38
  br label %58

58:                                               ; preds = %54, %53
  %59 = call ptr @NetbufAllocSpace(ptr noundef nonnull %24, i32 noundef 16, i8 noundef zeroext 0) #3
  %60 = call zeroext i8 @DebugAssertEnabled() #3
  %61 = icmp eq i8 %60, 0
  %62 = icmp ne ptr %59, null
  %or.cond7 = select i1 %61, i1 true, i1 %62
  br i1 %or.cond7, label %64, label %63

63:                                               ; preds = %58
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1283, ptr noundef nonnull @.str.17) #3
  br label %64

64:                                               ; preds = %63, %58
  %65 = call ptr @CopyMem(ptr noundef %59, ptr noundef %3, i64 noundef 16) #3
  %66 = call ptr @NetbufAllocSpace(ptr noundef nonnull %24, i32 noundef 8, i8 noundef zeroext 0) #3
  %67 = call zeroext i8 @DebugAssertEnabled() #3
  %68 = icmp eq i8 %67, 0
  %69 = icmp ne ptr %66, null
  %or.cond9 = select i1 %68, i1 true, i1 %69
  br i1 %or.cond9, label %71, label %70

70:                                               ; preds = %64
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1291, ptr noundef nonnull @.str.15) #3
  br label %71

71:                                               ; preds = %70, %64
  store i8 2, ptr %66, align 1, !tbaa !39
  %72 = getelementptr inbounds i8, ptr %66, i64 1
  store i8 1, ptr %72, align 1, !tbaa !41
  %73 = getelementptr inbounds i8, ptr %66, i64 2
  %74 = call ptr @CopyMem(ptr noundef nonnull %73, ptr noundef %4, i64 noundef 6) #3
  %75 = call i64 @Ip6Output(ptr noundef %0, ptr noundef null, ptr noundef null, ptr noundef nonnull %24, ptr noundef nonnull %9, ptr noundef null, i32 noundef 0, ptr noundef nonnull @Ip6SysPacketSent, ptr noundef null) #3
  br label %76

76:                                               ; preds = %23, %71
  %.0 = phi i64 [ %75, %71 ], [ -9223372036854775799, %23 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #3
  ret i64 %.0
}

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass