; 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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip6SendRouterSolicit(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 i16, align 2
  %17 = alloca ptr, align 8
  %18 = 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 2, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  br label %19

19:                                               ; preds = %5
  %20 = call zeroext i8 @DebugAssertEnabled()
  %21 = icmp ne i8 %20, 0
  br i1 %21, label %22, label %32

22:                                               ; preds = %19
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %30

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

30:                                               ; preds = %25, %22
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1109, ptr noundef @.str.6)
  br label %31

31:                                               ; preds = %30, %25
  br label %32

32:                                               ; preds = %31, %19
  br label %33

33:                                               ; preds = %32
  br label %34

34:                                               ; preds = %33
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %35, ptr %17, align 8, !tbaa !5
  %36 = load ptr, ptr %17, align 8, !tbaa !5
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %47

38:                                               ; preds = %34
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._IP6_SERVICE, ptr %39, i32 0, i32 6
  %41 = load ptr, ptr %40, align 8, !tbaa !30
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %47

43:                                               ; preds = %38
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._IP6_SERVICE, ptr %44, i32 0, i32 6
  %46 = load ptr, ptr %45, align 8, !tbaa !30
  store ptr %46, ptr %17, align 8, !tbaa !5
  br label %47

47:                                               ; preds = %43, %38, %34
  store i16 8, ptr %16, align 2, !tbaa !31
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %55

50:                                               ; preds = %47
  %51 = load i16, ptr %16, align 2, !tbaa !31
  %52 = zext i16 %51 to i64
  %53 = add i64 %52, 8
  %54 = trunc i64 %53 to i16
  store i16 %54, ptr %16, align 2, !tbaa !31
  br label %55

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

64:                                               ; preds = %55
  store i64 -9223372036854775799, ptr %6, align 8
  store i32 1, ptr %18, align 4
  br label %147

65:                                               ; preds = %55
  %66 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %13, i32 0, i32 1
  store i16 0, ptr %66, align 1, !tbaa !32
  %67 = load i16, ptr %13, align 1
  %68 = and i16 %67, -3841
  %69 = or i16 %68, 0
  store i16 %69, ptr %13, align 1
  %70 = load i16, ptr %16, align 2, !tbaa !31
  %71 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %70)
  %72 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %13, i32 0, i32 2
  store i16 %71, ptr %72, align 1, !tbaa !34
  %73 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %13, i32 0, i32 3
  store i8 58, ptr %73, align 1, !tbaa !35
  %74 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %13, i32 0, i32 4
  store i8 -1, ptr %74, align 1, !tbaa !36
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = icmp ne ptr %75, null
  br i1 %76, label %77, label %81

77:                                               ; preds = %65
  %78 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %13, i32 0, i32 5
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = call ptr @CopyMem(ptr noundef %78, ptr noundef %79, i64 noundef 16)
  br label %84

81:                                               ; preds = %65
  %82 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %13, i32 0, i32 5
  %83 = call ptr @ZeroMem(ptr noundef %82, i64 noundef 16)
  br label %84

84:                                               ; preds = %81, %77
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %91

87:                                               ; preds = %84
  %88 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %13, i32 0, i32 6
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = call ptr @CopyMem(ptr noundef %88, ptr noundef %89, i64 noundef 16)
  br label %94

91:                                               ; preds = %84
  %92 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %13, i32 0, i32 6
  %93 = call i64 @Ip6SetToAllNodeMulticast(i8 noundef zeroext 1, i8 noundef zeroext 2, ptr noundef %92)
  br label %94

94:                                               ; preds = %91, %87
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  call void @NetbufReserve(ptr noundef %95, i32 noundef 40)
  %96 = load ptr, ptr %12, align 8, !tbaa !5
  %97 = call ptr @NetbufAllocSpace(ptr noundef %96, i32 noundef 8, i8 noundef zeroext 0)
  store ptr %97, ptr %14, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %94
  %99 = call zeroext i8 @DebugAssertEnabled()
  %100 = icmp ne i8 %99, 0
  br i1 %100, label %101, label %106

101:                                              ; preds = %98
  %102 = load ptr, ptr %14, align 8, !tbaa !5
  %103 = icmp ne ptr %102, null
  br i1 %103, label %105, label %104

104:                                              ; preds = %101
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1159, ptr noundef @.str.14)
  br label %105

105:                                              ; preds = %104, %101
  br label %106

106:                                              ; preds = %105, %98
  br label %107

107:                                              ; preds = %106
  br label %108

108:                                              ; preds = %107
  %109 = load ptr, ptr %14, align 8, !tbaa !5
  %110 = call ptr @ZeroMem(ptr noundef %109, i64 noundef 8)
  %111 = load ptr, ptr %14, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %111, i32 0, i32 0
  %113 = getelementptr inbounds %struct.IP6_ICMP_HEAD, ptr %112, i32 0, i32 0
  store i8 -123, ptr %113, align 1, !tbaa !37
  %114 = load ptr, ptr %14, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.IP6_ICMP_INFORMATION_HEAD, ptr %114, i32 0, i32 0
  %116 = getelementptr inbounds %struct.IP6_ICMP_HEAD, ptr %115, i32 0, i32 1
  store i8 0, ptr %116, align 1, !tbaa !40
  store ptr null, ptr %15, align 8, !tbaa !5
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = icmp ne ptr %117, null
  br i1 %118, label %119, label %142

119:                                              ; preds = %108
  %120 = load ptr, ptr %12, align 8, !tbaa !5
  %121 = call ptr @NetbufAllocSpace(ptr noundef %120, i32 noundef 8, i8 noundef zeroext 0)
  store ptr %121, ptr %15, align 8, !tbaa !5
  br label %122

122:                                              ; preds = %119
  %123 = call zeroext i8 @DebugAssertEnabled()
  %124 = icmp ne i8 %123, 0
  br i1 %124, label %125, label %130

125:                                              ; preds = %122
  %126 = load ptr, ptr %15, align 8, !tbaa !5
  %127 = icmp ne ptr %126, null
  br i1 %127, label %129, label %128

128:                                              ; preds = %125
  call void @DebugAssert(ptr noundef @.str, i64 noundef 1171, ptr noundef @.str.15)
  br label %129

129:                                              ; preds = %128, %125
  br label %130

130:                                              ; preds = %129, %122
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  %133 = load ptr, ptr %15, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %133, i32 0, i32 0
  store i8 1, ptr %134, align 1, !tbaa !41
  %135 = load ptr, ptr %15, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %135, i32 0, i32 1
  store i8 8, ptr %136, align 1, !tbaa !43
  %137 = load ptr, ptr %15, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._IP6_ETHE_ADDR_OPTION, ptr %137, i32 0, i32 2
  %139 = getelementptr inbounds [6 x i8], ptr %138, i64 0, i64 0
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = call ptr @CopyMem(ptr noundef %139, ptr noundef %140, i64 noundef 6)
  br label %142

142:                                              ; preds = %132, %108
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = load ptr, ptr %17, align 8, !tbaa !5
  %145 = load ptr, ptr %12, align 8, !tbaa !5
  %146 = call i64 @Ip6Output(ptr noundef %143, ptr noundef %144, ptr noundef null, ptr noundef %145, ptr noundef %13, ptr noundef null, i32 noundef 0, ptr noundef @Ip6SysPacketSent, ptr noundef null)
  store i64 %146, ptr %6, align 8
  store i32 1, ptr %18, align 4
  br label %147

147:                                              ; preds = %142, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 2, 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
  %148 = load i64, ptr %6, align 8
  ret i64 %148
}

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

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 = !{!10, !6, i64 72}
!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}


; 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

; 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 i64 @Ip6SetToAllNodeMulticast(i8 noundef zeroext, i8 noundef zeroext, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip6SendRouterSolicit(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
  %.not43 = icmp eq ptr %0, null
  br i1 %.not43, 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 1109, ptr noundef nonnull @.str.6) #3
  br label %13

13:                                               ; preds = %9, %12, %5
  %14 = icmp eq ptr %1, null
  br i1 %14, label %15, label %18

15:                                               ; preds = %13
  %16 = getelementptr inbounds i8, ptr %0, i64 72
  %17 = load ptr, ptr %16, align 8, !tbaa !29
  br label %18

18:                                               ; preds = %15, %13
  %.0 = phi ptr [ %1, %13 ], [ %17, %15 ]
  %.not45 = icmp eq ptr %4, null
  %spec.select48 = select i1 %.not45, i16 8, i16 16
  %narrow = add nuw nsw i16 %spec.select48, 40
  %19 = zext nneg i16 %narrow to i32
  %20 = tail call ptr @NetbufAlloc(i32 noundef %19) #3
  %21 = icmp eq ptr %20, null
  br i1 %21, label %60, label %22

22:                                               ; preds = %18
  %23 = getelementptr inbounds i8, ptr %6, i64 2
  store i16 0, ptr %23, align 2, !tbaa !30
  store i16 0, ptr %6, align 2
  %24 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %spec.select48) #3
  %25 = getelementptr inbounds i8, ptr %6, i64 4
  store i16 %24, ptr %25, align 2, !tbaa !32
  %26 = getelementptr inbounds i8, ptr %6, i64 6
  store i8 58, ptr %26, align 2, !tbaa !33
  %27 = getelementptr inbounds i8, ptr %6, i64 7
  store i8 -1, ptr %27, align 1, !tbaa !34
  %.not46 = icmp eq ptr %2, null
  %28 = getelementptr inbounds i8, ptr %6, i64 8
  br i1 %.not46, label %31, label %29

29:                                               ; preds = %22
  %30 = call ptr @CopyMem(ptr noundef nonnull %28, ptr noundef nonnull %2, i64 noundef 16) #3
  br label %33

31:                                               ; preds = %22
  %32 = call ptr @ZeroMem(ptr noundef nonnull %28, i64 noundef 16) #3
  br label %33

33:                                               ; preds = %31, %29
  %.not47 = icmp eq ptr %3, null
  %34 = getelementptr inbounds i8, ptr %6, i64 24
  br i1 %.not47, label %37, label %35

35:                                               ; preds = %33
  %36 = call ptr @CopyMem(ptr noundef nonnull %34, ptr noundef nonnull %3, i64 noundef 16) #3
  br label %39

37:                                               ; preds = %33
  %38 = call i64 @Ip6SetToAllNodeMulticast(i8 noundef zeroext 1, i8 noundef zeroext 2, ptr noundef nonnull %34) #3
  br label %39

39:                                               ; preds = %37, %35
  call void @NetbufReserve(ptr noundef nonnull %20, i32 noundef 40) #3
  %40 = call ptr @NetbufAllocSpace(ptr noundef nonnull %20, 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.cond = select i1 %42, i1 true, i1 %43
  br i1 %or.cond, label %45, label %44

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

45:                                               ; preds = %44, %39
  %46 = call ptr @ZeroMem(ptr noundef %40, i64 noundef 8) #3
  store i8 -123, ptr %40, align 1, !tbaa !35
  %47 = getelementptr inbounds i8, ptr %40, i64 1
  store i8 0, ptr %47, align 1, !tbaa !38
  br i1 %.not45, label %58, label %48

48:                                               ; preds = %45
  %49 = call ptr @NetbufAllocSpace(ptr noundef nonnull %20, i32 noundef 8, i8 noundef zeroext 0) #3
  %50 = call zeroext i8 @DebugAssertEnabled() #3
  %51 = icmp eq i8 %50, 0
  %52 = icmp ne ptr %49, null
  %or.cond3 = select i1 %51, i1 true, i1 %52
  br i1 %or.cond3, label %54, label %53

53:                                               ; preds = %48
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 1171, ptr noundef nonnull @.str.15) #3
  br label %54

54:                                               ; preds = %53, %48
  store i8 1, ptr %49, align 1, !tbaa !39
  %55 = getelementptr inbounds i8, ptr %49, i64 1
  store i8 8, ptr %55, align 1, !tbaa !41
  %56 = getelementptr inbounds i8, ptr %49, i64 2
  %57 = call ptr @CopyMem(ptr noundef nonnull %56, ptr noundef nonnull %4, i64 noundef 6) #3
  br label %58

58:                                               ; preds = %54, %45
  %59 = call i64 @Ip6Output(ptr noundef %0, ptr noundef %.0, ptr noundef null, ptr noundef nonnull %20, ptr noundef nonnull %6, ptr noundef null, i32 noundef 0, ptr noundef nonnull @Ip6SysPacketSent, ptr noundef null) #3
  br label %60

60:                                               ; preds = %18, %58
  %.035 = phi i64 [ %59, %58 ], [ -9223372036854775799, %18 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #3
  ret i64 %.035
}

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

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 = !{!6, !11, i64 72}
!30 = !{!31, !19, i64 2}
!31 = !{!"_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}
!32 = !{!31, !19, i64 4}
!33 = !{!31, !8, i64 6}
!34 = !{!31, !8, i64 7}
!35 = !{!36, !8, i64 0}
!36 = !{!"", !37, i64 0, !7, i64 4}
!37 = !{!"", !8, i64 0, !8, i64 1, !19, i64 2}
!38 = !{!36, !8, i64 1}
!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,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass