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

; 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_MLD_HEAD = type { %struct.IP6_ICMP_HEAD, i16, i16, %struct.EFI_IPv6_ADDRESS }
%struct.IP6_ICMP_HEAD = type { i8, i8, i16 }

@.str = external hidden unnamed_addr constant [128 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [24 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

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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare i64 @Ip6FillHopByHop(ptr noundef, ptr noundef, i8 noundef zeroext) #1

declare ptr @NetbufAlloc(i32 noundef) #1

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

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

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

declare void @NetbufFree(ptr noundef) #1

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

declare zeroext i16 @NetblockChecksum(ptr noundef, i32 noundef) #1

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

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

17:                                               ; preds = %2
  %18 = call zeroext i8 @DebugAssertEnabled()
  %19 = icmp ne i8 %18, 0
  br i1 %19, label %20, label %30

20:                                               ; preds = %17
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %28

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

28:                                               ; preds = %23, %20
  call void @DebugAssert(ptr noundef @.str, i64 noundef 253, ptr noundef @.str.1)
  br label %29

29:                                               ; preds = %28, %23
  br label %30

30:                                               ; preds = %29, %17
  br label %31

31:                                               ; preds = %30
  br label %32

32:                                               ; preds = %31
  br label %33

33:                                               ; preds = %32
  %34 = call zeroext i8 @DebugAssertEnabled()
  %35 = icmp ne i8 %34, 0
  br i1 %35, label %36, label %48

36:                                               ; preds = %33
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %46

39:                                               ; preds = %36
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.EFI_IPv6_ADDRESS, ptr %40, i32 0, i32 0
  %42 = getelementptr inbounds [16 x i8], ptr %41, i64 0, i64 0
  %43 = load i8, ptr %42, align 1, !tbaa !30
  %44 = zext i8 %43 to i32
  %45 = icmp eq i32 %44, 255
  br i1 %45, label %47, label %46

46:                                               ; preds = %39, %36
  call void @DebugAssert(ptr noundef @.str, i64 noundef 254, ptr noundef @.str.2)
  br label %47

47:                                               ; preds = %46, %39
  br label %48

48:                                               ; preds = %47, %33
  br label %49

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %49
  store i64 0, ptr %10, align 8, !tbaa !31
  %51 = call i64 @Ip6FillHopByHop(ptr noundef null, ptr noundef %10, i8 noundef zeroext 58)
  store i64 %51, ptr %12, align 8, !tbaa !31
  br label %52

52:                                               ; preds = %50
  %53 = call zeroext i8 @DebugAssertEnabled()
  %54 = icmp ne i8 %53, 0
  br i1 %54, label %55, label %60

55:                                               ; preds = %52
  %56 = load i64, ptr %12, align 8, !tbaa !31
  %57 = icmp eq i64 %56, -9223372036854775803
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  call void @DebugAssert(ptr noundef @.str, i64 noundef 263, ptr noundef @.str.3)
  br label %59

59:                                               ; preds = %58, %55
  br label %60

60:                                               ; preds = %59, %52
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  %63 = load i64, ptr %10, align 8, !tbaa !31
  %64 = add i64 %63, 24
  %65 = trunc i64 %64 to i16
  store i16 %65, ptr %9, align 2, !tbaa !32
  %66 = load i16, ptr %9, align 2, !tbaa !32
  %67 = zext i16 %66 to i32
  %68 = zext i32 %67 to i64
  %69 = add i64 40, %68
  %70 = trunc i64 %69 to i32
  %71 = call ptr @NetbufAlloc(i32 noundef %70)
  store ptr %71, ptr %7, align 8, !tbaa !5
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = icmp eq ptr %72, null
  br i1 %73, label %74, label %75

74:                                               ; preds = %62
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %158

75:                                               ; preds = %62
  %76 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %8, i32 0, i32 1
  store i16 0, ptr %76, align 1, !tbaa !33
  %77 = load i16, ptr %8, align 1
  %78 = and i16 %77, -3841
  %79 = or i16 %78, 0
  store i16 %79, ptr %8, align 1
  %80 = load i16, ptr %9, align 2, !tbaa !32
  %81 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %80)
  %82 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %8, i32 0, i32 2
  store i16 %81, ptr %82, align 1, !tbaa !35
  %83 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %8, i32 0, i32 3
  store i8 0, ptr %83, align 1, !tbaa !36
  %84 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %8, i32 0, i32 4
  store i8 1, ptr %84, align 1, !tbaa !37
  %85 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %8, i32 0, i32 5
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._IP6_SERVICE, ptr %86, i32 0, i32 11
  %88 = call ptr @CopyMem(ptr noundef %85, ptr noundef %87, i64 noundef 16)
  %89 = call i64 @Ip6SetToAllNodeMulticast(i8 noundef zeroext 1, i8 noundef zeroext 2, ptr noundef %13)
  %90 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %8, i32 0, i32 6
  %91 = call ptr @CopyMem(ptr noundef %90, ptr noundef %13, i64 noundef 16)
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  call void @NetbufReserve(ptr noundef %92, i32 noundef 40)
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = load i64, ptr %10, align 8, !tbaa !31
  %95 = trunc i64 %94 to i32
  %96 = call ptr @NetbufAllocSpace(ptr noundef %93, i32 noundef %95, i8 noundef zeroext 0)
  store ptr %96, ptr %11, align 8, !tbaa !5
  br label %97

97:                                               ; preds = %75
  %98 = call zeroext i8 @DebugAssertEnabled()
  %99 = icmp ne i8 %98, 0
  br i1 %99, label %100, label %105

100:                                              ; preds = %97
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = icmp ne ptr %101, null
  br i1 %102, label %104, label %103

103:                                              ; preds = %100
  call void @DebugAssert(ptr noundef @.str, i64 noundef 294, ptr noundef @.str.4)
  br label %104

104:                                              ; preds = %103, %100
  br label %105

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

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  %109 = call i64 @Ip6FillHopByHop(ptr noundef %108, ptr noundef %10, i8 noundef zeroext 58)
  store i64 %109, ptr %12, align 8, !tbaa !31
  %110 = load i64, ptr %12, align 8, !tbaa !31
  %111 = icmp slt i64 %110, 0
  br i1 %111, label %112, label %115

112:                                              ; preds = %107
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  call void @NetbufFree(ptr noundef %113)
  store ptr null, ptr %7, align 8, !tbaa !5
  %114 = load i64, ptr %12, align 8, !tbaa !31
  store i64 %114, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %158

115:                                              ; preds = %107
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = call ptr @NetbufAllocSpace(ptr noundef %116, i32 noundef 24, i8 noundef zeroext 0)
  store ptr %117, ptr %6, align 8, !tbaa !5
  br label %118

118:                                              ; preds = %115
  %119 = call zeroext i8 @DebugAssertEnabled()
  %120 = icmp ne i8 %119, 0
  br i1 %120, label %121, label %126

121:                                              ; preds = %118
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %125, label %124

124:                                              ; preds = %121
  call void @DebugAssert(ptr noundef @.str, i64 noundef 306, ptr noundef @.str.5)
  br label %125

125:                                              ; preds = %124, %121
  br label %126

126:                                              ; preds = %125, %118
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = call ptr @ZeroMem(ptr noundef %129, i64 noundef 24)
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.IP6_MLD_HEAD, ptr %131, i32 0, i32 0
  %133 = getelementptr inbounds %struct.IP6_ICMP_HEAD, ptr %132, i32 0, i32 0
  store i8 -124, ptr %133, align 1, !tbaa !38
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.IP6_MLD_HEAD, ptr %134, i32 0, i32 0
  %136 = getelementptr inbounds %struct.IP6_ICMP_HEAD, ptr %135, i32 0, i32 1
  store i8 0, ptr %136, align 1, !tbaa !41
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.IP6_MLD_HEAD, ptr %137, i32 0, i32 3
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  %140 = call ptr @CopyMem(ptr noundef %138, ptr noundef %139, i64 noundef 16)
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = call zeroext i16 @NetblockChecksum(ptr noundef %141, i32 noundef 24)
  store i16 %142, ptr %14, align 2, !tbaa !32
  %143 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %8, i32 0, i32 5
  %144 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %8, i32 0, i32 6
  %145 = call zeroext i16 @NetIp6PseudoHeadChecksum(ptr noundef %143, ptr noundef %144, i8 noundef zeroext 58, i32 noundef 24)
  store i16 %145, ptr %15, align 2, !tbaa !32
  %146 = load i16, ptr %14, align 2, !tbaa !32
  %147 = load i16, ptr %15, align 2, !tbaa !32
  %148 = call zeroext i16 @NetAddChecksum(i16 noundef zeroext %146, i16 noundef zeroext %147)
  %149 = zext i16 %148 to i32
  %150 = xor i32 %149, -1
  %151 = trunc i32 %150 to i16
  %152 = load ptr, ptr %6, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.IP6_MLD_HEAD, ptr %152, i32 0, i32 0
  %154 = getelementptr inbounds %struct.IP6_ICMP_HEAD, ptr %153, i32 0, i32 2
  store i16 %151, ptr %154, align 1, !tbaa !42
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = call i64 @Ip6Output(ptr noundef %155, ptr noundef null, ptr noundef null, ptr noundef %156, ptr noundef %8, ptr noundef null, i32 noundef 0, ptr noundef @Ip6SysPacketSent, ptr noundef null)
  store i64 %157, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %158

158:                                              ; preds = %128, %112, %74
  call void @llvm.lifetime.end.p0(i64 2, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %159 = load i64, ptr %3, align 8
  ret i64 %159
}

declare i64 @Ip6SetToAllNodeMulticast(i8 noundef zeroext, i8 noundef zeroext, 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 = !{!13, !13, i64 0}
!32 = !{!20, !20, i64 0}
!33 = !{!34, !20, i64 2}
!34 = !{!"_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}
!35 = !{!34, !20, i64 4}
!36 = !{!34, !7, i64 6}
!37 = !{!34, !7, i64 7}
!38 = !{!39, !7, i64 0}
!39 = !{!"", !40, i64 0, !20, i64 4, !20, i64 6, !17, i64 8}
!40 = !{!"", !7, i64 0, !7, i64 1, !20, i64 2}
!41 = !{!39, !7, i64 1}
!42 = !{!39, !20, i64 2}


; 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 [128 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [24 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

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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare i64 @Ip6FillHopByHop(ptr noundef, ptr noundef, i8 noundef zeroext) local_unnamed_addr #1

declare ptr @NetbufAlloc(i32 noundef) local_unnamed_addr #1

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) 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 void @NetbufFree(ptr noundef) local_unnamed_addr #1

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

declare zeroext i16 @NetblockChecksum(ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

7:                                                ; preds = %2
  %.not38 = icmp eq ptr %0, null
  br i1 %.not38, label %11, label %8

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

11:                                               ; preds = %8, %7
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 253, ptr noundef nonnull @.str.1) #3
  br label %12

12:                                               ; preds = %2, %11, %8
  %13 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not39 = icmp eq i8 %13, 0
  br i1 %.not39, label %19, label %14

14:                                               ; preds = %12
  %.not40 = icmp eq ptr %1, null
  br i1 %.not40, label %18, label %15

15:                                               ; preds = %14
  %16 = load i8, ptr %1, align 1, !tbaa !29
  %17 = icmp eq i8 %16, -1
  br i1 %17, label %19, label %18

18:                                               ; preds = %15, %14
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 254, ptr noundef nonnull @.str.2) #3
  br label %19

19:                                               ; preds = %15, %18, %12
  store i64 0, ptr %4, align 8, !tbaa !30
  %20 = call i64 @Ip6FillHopByHop(ptr noundef null, ptr noundef nonnull %4, i8 noundef zeroext 58) #3
  %21 = call zeroext i8 @DebugAssertEnabled() #3
  %22 = icmp eq i8 %21, 0
  %23 = icmp eq i64 %20, -9223372036854775803
  %or.cond = select i1 %22, i1 true, i1 %23
  br i1 %or.cond, label %25, label %24

24:                                               ; preds = %19
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 263, ptr noundef nonnull @.str.3) #3
  br label %25

25:                                               ; preds = %24, %19
  %26 = load i64, ptr %4, align 8, !tbaa !30
  %27 = trunc i64 %26 to i16
  %28 = add i16 %27, 24
  %29 = zext i16 %28 to i32
  %30 = add nuw nsw i32 %29, 40
  %31 = call ptr @NetbufAlloc(i32 noundef %30) #3
  %32 = icmp eq ptr %31, null
  br i1 %32, label %73, label %33

33:                                               ; preds = %25
  %34 = getelementptr inbounds i8, ptr %3, i64 2
  store i16 0, ptr %34, align 2, !tbaa !31
  store i16 0, ptr %3, align 2
  %35 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %28) #3
  %36 = getelementptr inbounds i8, ptr %3, i64 4
  store i16 %35, ptr %36, align 2, !tbaa !33
  %37 = getelementptr inbounds i8, ptr %3, i64 6
  store i8 0, ptr %37, align 2, !tbaa !34
  %38 = getelementptr inbounds i8, ptr %3, i64 7
  store i8 1, ptr %38, align 1, !tbaa !35
  %39 = getelementptr inbounds i8, ptr %3, i64 8
  %40 = getelementptr inbounds i8, ptr %0, i64 2192
  %41 = call ptr @CopyMem(ptr noundef nonnull %39, ptr noundef nonnull %40, i64 noundef 16) #3
  %42 = call i64 @Ip6SetToAllNodeMulticast(i8 noundef zeroext 1, i8 noundef zeroext 2, ptr noundef nonnull %5) #3
  %43 = getelementptr inbounds i8, ptr %3, i64 24
  %44 = call ptr @CopyMem(ptr noundef nonnull %43, ptr noundef nonnull %5, i64 noundef 16) #3
  call void @NetbufReserve(ptr noundef nonnull %31, i32 noundef 40) #3
  %45 = load i64, ptr %4, align 8, !tbaa !30
  %46 = trunc i64 %45 to i32
  %47 = call ptr @NetbufAllocSpace(ptr noundef nonnull %31, i32 noundef %46, i8 noundef zeroext 0) #3
  %48 = call zeroext i8 @DebugAssertEnabled() #3
  %49 = icmp eq i8 %48, 0
  %50 = icmp ne ptr %47, null
  %or.cond3 = select i1 %49, i1 true, i1 %50
  br i1 %or.cond3, label %52, label %51

51:                                               ; preds = %33
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 294, ptr noundef nonnull @.str.4) #3
  br label %52

52:                                               ; preds = %51, %33
  %53 = call i64 @Ip6FillHopByHop(ptr noundef %47, ptr noundef nonnull %4, i8 noundef zeroext 58) #3
  %54 = icmp slt i64 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %52
  call void @NetbufFree(ptr noundef nonnull %31) #3
  br label %73

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

61:                                               ; preds = %56
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 306, ptr noundef nonnull @.str.5) #3
  br label %62

62:                                               ; preds = %61, %56
  %63 = call ptr @ZeroMem(ptr noundef %57, i64 noundef 24) #3
  store i8 -124, ptr %57, align 1, !tbaa !36
  %64 = getelementptr inbounds i8, ptr %57, i64 1
  store i8 0, ptr %64, align 1, !tbaa !39
  %65 = getelementptr inbounds i8, ptr %57, i64 8
  %66 = call ptr @CopyMem(ptr noundef nonnull %65, ptr noundef %1, i64 noundef 16) #3
  %67 = call zeroext i16 @NetblockChecksum(ptr noundef nonnull %57, i32 noundef 24) #3
  %68 = call zeroext i16 @NetIp6PseudoHeadChecksum(ptr noundef nonnull %39, ptr noundef nonnull %43, i8 noundef zeroext 58, i32 noundef 24) #3
  %69 = call zeroext i16 @NetAddChecksum(i16 noundef zeroext %67, i16 noundef zeroext %68) #3
  %70 = xor i16 %69, -1
  %71 = getelementptr inbounds i8, ptr %57, i64 2
  store i16 %70, ptr %71, align 1, !tbaa !40
  %72 = call i64 @Ip6Output(ptr noundef %0, ptr noundef null, ptr noundef null, ptr noundef nonnull %31, ptr noundef nonnull %3, ptr noundef null, i32 noundef 0, ptr noundef nonnull @Ip6SysPacketSent, ptr noundef null) #3
  br label %73

73:                                               ; preds = %25, %62, %55
  %.0 = phi i64 [ %53, %55 ], [ %72, %62 ], [ -9223372036854775799, %25 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #3
  ret i64 %.0
}

declare i64 @Ip6SetToAllNodeMulticast(i8 noundef zeroext, i8 noundef zeroext, 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 = !{!8, !8, i64 0}
!30 = !{!12, !12, i64 0}
!31 = !{!32, !19, i64 2}
!32 = !{!"_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}
!33 = !{!32, !19, i64 4}
!34 = !{!32, !8, i64 6}
!35 = !{!32, !8, i64 7}
!36 = !{!37, !8, i64 0}
!37 = !{!"", !38, i64 0, !19, i64 4, !19, i64 6, !16, i64 8}
!38 = !{!"", !8, i64 0, !8, i64 1, !19, i64 2}
!39 = !{!37, !8, i64 1}
!40 = !{!37, !19, i64 2}


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