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

; Function Attrs: nounwind uwtable
declare dso_local void @Ip6OnArpResolved(ptr noundef) #2

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

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

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 @Ip6SendNeighborSolicit(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %struct._EFI_IP6_HEADER, align 1
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i8, align 1
  %18 = alloca i16, align 2
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 40, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  br label %21

21:                                               ; preds = %5
  %22 = call zeroext i8 @DebugAssertEnabled()
  %23 = icmp ne i8 %22, 0
  br i1 %23, label %24, label %34

24:                                               ; preds = %21
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %32

27:                                               ; preds = %24
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._IP6_SERVICE, ptr %28, i32 0, i32 0
  %30 = load i32, ptr %29, align 8, !tbaa !9
  %31 = icmp eq i32 %30, 1396068425
  br i1 %31, label %33, label %32

32:                                               ; preds = %27, %24
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1341, ptr noundef @.str.6)
  br label %33

33:                                               ; preds = %32, %27
  br label %34

34:                                               ; preds = %33, %21
  br label %35

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %35
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = icmp eq ptr %37, null
  br i1 %38, label %42, label %39

39:                                               ; preds = %36
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %43

42:                                               ; preds = %39, %36
  store i64 -9223372036854775806, ptr %6, align 8
  store i32 1, ptr %20, align 4
  br label %200

43:                                               ; preds = %39
  store i8 0, ptr %17, align 1, !tbaa !30
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = icmp eq ptr %44, null
  br i1 %45, label %54, label %46

46:                                               ; preds = %43
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %49, label %55

49:                                               ; preds = %46
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef %50)
  %52 = zext i8 %51 to i32
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %49, %43
  store i8 1, ptr %17, align 1, !tbaa !30
  br label %55

55:                                               ; preds = %54, %49, %46
  store i16 24, ptr %18, align 2, !tbaa !31
  %56 = load i8, ptr %17, align 1, !tbaa !30
  %57 = icmp ne i8 %56, 0
  br i1 %57, label %67, label %58

58:                                               ; preds = %55
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = icmp eq ptr %59, null
  br i1 %60, label %61, label %62

61:                                               ; preds = %58
  store i64 -9223372036854775806, ptr %6, align 8
  store i32 1, ptr %20, align 4
  br label %200

62:                                               ; preds = %58
  %63 = load i16, ptr %18, align 2, !tbaa !31
  %64 = zext i16 %63 to i64
  %65 = add i64 %64, 8
  %66 = trunc i64 %65 to i16
  store i16 %66, ptr %18, align 2, !tbaa !31
  br label %67

67:                                               ; preds = %62, %55
  %68 = load i16, ptr %18, align 2, !tbaa !31
  %69 = zext i16 %68 to i32
  %70 = zext i32 %69 to i64
  %71 = add i64 40, %70
  %72 = trunc i64 %71 to i32
  %73 = call ptr @NetbufAlloc(i32 noundef %72)
  store ptr %73, ptr %12, align 8, !tbaa !5
  %74 = load ptr, ptr %12, align 8, !tbaa !5
  %75 = icmp eq ptr %74, null
  br i1 %75, label %76, label %77

76:                                               ; preds = %67
  store i64 -9223372036854775799, ptr %6, align 8
  store i32 1, ptr %20, align 4
  br label %200

77:                                               ; preds = %67
  %78 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %13, i32 0, i32 1
  store i16 0, ptr %78, align 1, !tbaa !32
  %79 = load i16, ptr %13, align 1
  %80 = and i16 %79, -3841
  %81 = or i16 %80, 0
  store i16 %81, ptr %13, align 1
  %82 = load i16, ptr %18, align 2, !tbaa !31
  %83 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %82)
  %84 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %13, i32 0, i32 2
  store i16 %83, ptr %84, align 1, !tbaa !34
  %85 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %13, i32 0, i32 3
  store i8 58, ptr %85, align 1, !tbaa !35
  %86 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %13, i32 0, i32 4
  store i8 -1, ptr %86, align 1, !tbaa !36
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = icmp ne ptr %87, null
  br i1 %88, label %89, label %93

89:                                               ; preds = %77
  %90 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %13, i32 0, i32 5
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = call ptr @CopyMem(ptr noundef %90, ptr noundef %91, i64 noundef 16)
  br label %96

93:                                               ; preds = %77
  %94 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %13, i32 0, i32 5
  %95 = call ptr @ZeroMem(ptr noundef %94, i64 noundef 16)
  br label %96

96:                                               ; preds = %93, %89
  %97 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %13, i32 0, i32 6
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = call ptr @CopyMem(ptr noundef %97, ptr noundef %98, i64 noundef 16)
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  call void @NetbufReserve(ptr noundef %100, i32 noundef 40)
  %101 = load ptr, ptr %12, align 8, !tbaa !5
  %102 = call ptr @NetbufAllocSpace(ptr noundef %101, i32 noundef 8, i8 noundef zeroext 0)
  store ptr %102, ptr %14, align 8, !tbaa !5
  br label %103

103:                                              ; preds = %96
  %104 = call zeroext i8 @DebugAssertEnabled()
  %105 = icmp ne i8 %104, 0
  br i1 %105, label %106, label %111

106:                                              ; preds = %103
  %107 = load ptr, ptr %14, align 8, !tbaa !5
  %108 = icmp ne ptr %107, null
  br i1 %108, label %110, label %109

109:                                              ; preds = %106
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1399, ptr noundef @.str.14)
  br label %110

110:                                              ; preds = %109, %106
  br label %111

111:                                              ; preds = %110, %103
  br label %112

112:                                              ; preds = %111
  br label %113

113:                                              ; preds = %112
  %114 = load ptr, ptr %14, align 8, !tbaa !5
  %115 = call ptr @ZeroMem(ptr noundef %114, i64 noundef 8)
  %116 = load ptr, ptr %14, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %116, i32 0, i32 0
  %118 = getelementptr inbounds %struct.IP6_ICMP_HEAD, ptr %117, i32 0, i32 0
  store i8 -121, ptr %118, align 1, !tbaa !37
  %119 = load ptr, ptr %14, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %119, i32 0, i32 0
  %121 = getelementptr inbounds %struct.IP6_ICMP_HEAD, ptr %120, i32 0, i32 1
  store i8 0, ptr %121, align 1, !tbaa !40
  %122 = load ptr, ptr %12, align 8, !tbaa !5
  %123 = call ptr @NetbufAllocSpace(ptr noundef %122, i32 noundef 16, i8 noundef zeroext 0)
  store ptr %123, ptr %16, align 8, !tbaa !5
  br label %124

124:                                              ; preds = %113
  %125 = call zeroext i8 @DebugAssertEnabled()
  %126 = icmp ne i8 %125, 0
  br i1 %126, label %127, label %132

127:                                              ; preds = %124
  %128 = load ptr, ptr %16, align 8, !tbaa !5
  %129 = icmp ne ptr %128, null
  br i1 %129, label %131, label %130

130:                                              ; preds = %127
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1405, ptr noundef @.str.17)
  br label %131

131:                                              ; preds = %130, %127
  br label %132

132:                                              ; preds = %131, %124
  br label %133

133:                                              ; preds = %132
  br label %134

134:                                              ; preds = %133
  %135 = load ptr, ptr %16, align 8, !tbaa !5
  %136 = load ptr, ptr %10, align 8, !tbaa !5
  %137 = call ptr @CopyMem(ptr noundef %135, ptr noundef %136, i64 noundef 16)
  store ptr null, ptr %15, align 8, !tbaa !5
  %138 = load i8, ptr %17, align 1, !tbaa !30
  %139 = icmp ne i8 %138, 0
  br i1 %139, label %163, label %140

140:                                              ; preds = %134
  %141 = load ptr, ptr %12, align 8, !tbaa !5
  %142 = call ptr @NetbufAllocSpace(ptr noundef %141, i32 noundef 8, i8 noundef zeroext 0)
  store ptr %142, ptr %15, align 8, !tbaa !5
  br label %143

143:                                              ; preds = %140
  %144 = call zeroext i8 @DebugAssertEnabled()
  %145 = icmp ne i8 %144, 0
  br i1 %145, label %146, label %151

146:                                              ; preds = %143
  %147 = load ptr, ptr %15, align 8, !tbaa !5
  %148 = icmp ne ptr %147, null
  br i1 %148, label %150, label %149

149:                                              ; preds = %146
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1419, ptr noundef @.str.15)
  br label %150

150:                                              ; preds = %149, %146
  br label %151

151:                                              ; preds = %150, %143
  br label %152

152:                                              ; preds = %151
  br label %153

153:                                              ; preds = %152
  %154 = load ptr, ptr %15, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %154, i32 0, i32 0
  store i8 1, ptr %155, align 1, !tbaa !41
  %156 = load ptr, ptr %15, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %156, i32 0, i32 1
  store i8 1, ptr %157, align 1, !tbaa !43
  %158 = load ptr, ptr %15, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %158, i32 0, i32 2
  %160 = getelementptr inbounds [6 x i8], ptr %159, i64 0, i64 0
  %161 = load ptr, ptr %11, align 8, !tbaa !5
  %162 = call ptr @CopyMem(ptr noundef %160, ptr noundef %161, i64 noundef 6)
  br label %163

163:                                              ; preds = %153, %134
  %164 = load i8, ptr %17, align 1, !tbaa !30
  %165 = icmp ne i8 %164, 0
  br i1 %165, label %193, label %166

166:                                              ; preds = %163
  %167 = load ptr, ptr %9, align 8, !tbaa !5
  %168 = call zeroext i8 @Ip6IsSNMulticastAddr(ptr noundef %167)
  %169 = zext i8 %168 to i32
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %193

171:                                              ; preds = %166
  %172 = load ptr, ptr %7, align 8, !tbaa !5
  %173 = load ptr, ptr %10, align 8, !tbaa !5
  %174 = call ptr @Ip6FindNeighborEntry(ptr noundef %172, ptr noundef %173)
  store ptr %174, ptr %19, align 8, !tbaa !5
  %175 = load ptr, ptr %19, align 8, !tbaa !5
  %176 = icmp eq ptr %175, null
  br i1 %176, label %177, label %192

177:                                              ; preds = %171
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  %179 = load ptr, ptr %10, align 8, !tbaa !5
  %180 = call ptr @Ip6CreateNeighborEntry(ptr noundef %178, ptr noundef @Ip6OnArpResolved, ptr noundef %179, ptr noundef null)
  store ptr %180, ptr %19, align 8, !tbaa !5
  br label %181

181:                                              ; preds = %177
  %182 = call zeroext i8 @DebugAssertEnabled()
  %183 = icmp ne i8 %182, 0
  br i1 %183, label %184, label %189

184:                                              ; preds = %181
  %185 = load ptr, ptr %19, align 8, !tbaa !5
  %186 = icmp ne ptr %185, null
  br i1 %186, label %188, label %187

187:                                              ; preds = %184
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1433, ptr noundef @.str.18)
  br label %188

188:                                              ; preds = %187, %184
  br label %189

189:                                              ; preds = %188, %181
  br label %190

190:                                              ; preds = %189
  br label %191

191:                                              ; preds = %190
  br label %192

192:                                              ; preds = %191, %171
  br label %193

193:                                              ; preds = %192, %166, %163
  %194 = load ptr, ptr %7, align 8, !tbaa !5
  %195 = load ptr, ptr %7, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct._IP6_SERVICE, ptr %195, i32 0, i32 6
  %197 = load ptr, ptr %196, align 8, !tbaa !44
  %198 = load ptr, ptr %12, align 8, !tbaa !5
  %199 = call i64 @Ip6Output(ptr noundef %194, ptr noundef %197, ptr noundef null, ptr noundef %198, ptr noundef %13, ptr noundef null, i32 noundef 0, ptr noundef @Ip6SysPacketSent, ptr noundef null)
  store i64 %199, ptr %6, align 8
  store i32 1, ptr %20, align 4
  br label %200

200:                                              ; preds = %193, %76, %61, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %201 = load i64, ptr %6, align 8
  ret i64 %201
}

declare zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef) #1

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


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

; Function Attrs: nounwind uwtable
declare dso_local void @Ip6OnArpResolved(ptr noundef) #2

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

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

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 @Ip6SendNeighborSolicit(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #2 {
  %6 = alloca %struct._EFI_IP6_HEADER, align 2
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #3
  %7 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %7, 0
  br i1 %.not, label %13, label %8

8:                                                ; preds = %5
  %.not60 = icmp eq ptr %0, null
  br i1 %.not60, label %12, label %9

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

12:                                               ; preds = %9, %8
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1341, ptr noundef nonnull @.str.6) #3
  br label %13

13:                                               ; preds = %9, %12, %5
  %14 = icmp eq ptr %2, null
  %15 = icmp eq ptr %3, null
  %or.cond = or i1 %14, %15
  br i1 %or.cond, label %78, label %16

16:                                               ; preds = %13
  %17 = icmp eq ptr %1, null
  br i1 %17, label %22, label %18

18:                                               ; preds = %16
  %19 = tail call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef nonnull %1) #3
  %.not61 = icmp eq i8 %19, 0
  br i1 %.not61, label %20, label %22

20:                                               ; preds = %18
  %21 = icmp eq ptr %4, null
  br i1 %21, label %78, label %22

22:                                               ; preds = %18, %16, %20
  %.not6266 = phi i1 [ true, %20 ], [ false, %16 ], [ false, %18 ]
  %.0 = phi i16 [ 32, %20 ], [ 24, %16 ], [ 24, %18 ]
  %narrow = add nuw nsw i16 %.0, 40
  %23 = zext nneg i16 %narrow to i32
  %24 = tail call ptr @NetbufAlloc(i32 noundef %23) #3
  %25 = icmp eq ptr %24, null
  br i1 %25, label %78, label %26

26:                                               ; preds = %22
  %27 = getelementptr inbounds i8, ptr %6, i64 2
  store i16 0, ptr %27, align 2, !tbaa !29
  store i16 0, ptr %6, align 2
  %28 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %.0) #3
  %29 = getelementptr inbounds i8, ptr %6, i64 4
  store i16 %28, ptr %29, align 2, !tbaa !31
  %30 = getelementptr inbounds i8, ptr %6, i64 6
  store i8 58, ptr %30, align 2, !tbaa !32
  %31 = getelementptr inbounds i8, ptr %6, i64 7
  store i8 -1, ptr %31, align 1, !tbaa !33
  %32 = getelementptr inbounds i8, ptr %6, i64 8
  br i1 %17, label %35, label %33

33:                                               ; preds = %26
  %34 = call ptr @CopyMem(ptr noundef nonnull %32, ptr noundef nonnull %1, i64 noundef 16) #3
  br label %37

35:                                               ; preds = %26
  %36 = call ptr @ZeroMem(ptr noundef nonnull %32, i64 noundef 16) #3
  br label %37

37:                                               ; preds = %35, %33
  %38 = getelementptr inbounds i8, ptr %6, i64 24
  %39 = call ptr @CopyMem(ptr noundef nonnull %38, ptr noundef nonnull %2, i64 noundef 16) #3
  call void @NetbufReserve(ptr noundef nonnull %24, i32 noundef 40) #3
  %40 = call ptr @NetbufAllocSpace(ptr noundef nonnull %24, i32 noundef 8, i8 noundef zeroext 0) #3
  %41 = call zeroext i8 @DebugAssertEnabled() #3
  %42 = icmp eq i8 %41, 0
  %43 = icmp ne ptr %40, null
  %or.cond3 = select i1 %42, i1 true, i1 %43
  br i1 %or.cond3, label %45, label %44

44:                                               ; preds = %37
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1399, ptr noundef nonnull @.str.14) #3
  br label %45

45:                                               ; preds = %44, %37
  %46 = call ptr @ZeroMem(ptr noundef %40, i64 noundef 8) #3
  store i8 -121, ptr %40, align 1, !tbaa !34
  %47 = getelementptr inbounds i8, ptr %40, i64 1
  store i8 0, ptr %47, align 1, !tbaa !37
  %48 = call ptr @NetbufAllocSpace(ptr noundef nonnull %24, i32 noundef 16, i8 noundef zeroext 0) #3
  %49 = call zeroext i8 @DebugAssertEnabled() #3
  %50 = icmp eq i8 %49, 0
  %51 = icmp ne ptr %48, null
  %or.cond5 = select i1 %50, i1 true, i1 %51
  br i1 %or.cond5, label %53, label %52

52:                                               ; preds = %45
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1405, ptr noundef nonnull @.str.17) #3
  br label %53

53:                                               ; preds = %52, %45
  %54 = call ptr @CopyMem(ptr noundef %48, ptr noundef nonnull %3, i64 noundef 16) #3
  br i1 %.not6266, label %55, label %.critedge

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

60:                                               ; preds = %55
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1419, ptr noundef nonnull @.str.15) #3
  br label %61

61:                                               ; preds = %55, %60
  store i8 1, ptr %56, align 1, !tbaa !38
  %62 = getelementptr inbounds i8, ptr %56, i64 1
  store i8 1, ptr %62, align 1, !tbaa !40
  %63 = getelementptr inbounds i8, ptr %56, i64 2
  %64 = call ptr @CopyMem(ptr noundef nonnull %63, ptr noundef %4, i64 noundef 6) #3
  %65 = call zeroext i8 @Ip6IsSNMulticastAddr(ptr noundef nonnull %2) #3
  %.not64 = icmp eq i8 %65, 0
  br i1 %.not64, label %.critedge, label %66

66:                                               ; preds = %61
  %67 = call ptr @Ip6FindNeighborEntry(ptr noundef %0, ptr noundef nonnull %3)
  %68 = icmp eq ptr %67, null
  br i1 %68, label %69, label %.critedge

69:                                               ; preds = %66
  %70 = call ptr @Ip6CreateNeighborEntry(ptr noundef %0, ptr noundef nonnull @Ip6OnArpResolved, ptr noundef nonnull %3, ptr noundef null)
  %71 = call zeroext i8 @DebugAssertEnabled() #3
  %72 = icmp eq i8 %71, 0
  %73 = icmp ne ptr %70, null
  %or.cond9 = select i1 %72, i1 true, i1 %73
  br i1 %or.cond9, label %.critedge, label %74

74:                                               ; preds = %69
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1433, ptr noundef nonnull @.str.18) #3
  br label %.critedge

.critedge:                                        ; preds = %53, %66, %74, %69, %61
  %75 = getelementptr inbounds i8, ptr %0, i64 72
  %76 = load ptr, ptr %75, align 8, !tbaa !41
  %77 = call i64 @Ip6Output(ptr noundef %0, ptr noundef %76, ptr noundef null, ptr noundef nonnull %24, ptr noundef nonnull %6, ptr noundef null, i32 noundef 0, ptr noundef nonnull @Ip6SysPacketSent, ptr noundef null) #3
  br label %78

78:                                               ; preds = %22, %20, %13, %.critedge
  %.054 = phi i64 [ %77, %.critedge ], [ -9223372036854775806, %13 ], [ -9223372036854775806, %20 ], [ -9223372036854775799, %22 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #3
  ret i64 %.054
}

declare zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef) local_unnamed_addr #1

declare zeroext i8 @Ip6IsSNMulticastAddr(ptr noundef) local_unnamed_addr #1

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 = !{!39, !8, i64 0}
!39 = !{!"_IP6_ETHE_ADDR_OPTION", !8, i64 0, !8, i64 1, !8, i64 2}
!40 = !{!39, !8, i64 1}
!41 = !{!6, !11, i64 72}


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