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

; 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_IPv6_ADDRESS = type { [16 x i8] }
%struct.IP6_MLD_HEAD = type { %struct.IP6_ICMP_HEAD, i16, i16, %struct.EFI_IPv6_ADDRESS }
%struct.IP6_ICMP_HEAD = type { i8, i8, i16 }
%struct._EFI_IP6_HEADER = type { i16, i16, i16, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS }
%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_GROUP = type { %struct._LIST_ENTRY, i64, %struct.EFI_IPv6_ADDRESS, i32, i8, %struct.EFI_MAC_ADDRESS }

; 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

; Function Attrs: nounwind uwtable
declare dso_local ptr @Ip6FindMldEntry(ptr noundef, ptr noundef) #1

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

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

declare void @NetbufFree(ptr noundef) #2

declare i64 @Ip6SetToAllNodeMulticast(i8 noundef zeroext, i8 noundef zeroext, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @Ip6UpdateDelayTimer(ptr noundef, i16 noundef zeroext, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip6ProcessMldQuery(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.EFI_IPv6_ADDRESS, align 1
  %8 = alloca ptr, align 8
  %9 = alloca %struct.IP6_MLD_HEAD, align 1
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 24, 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
  store i64 -9223372036854775806, ptr %11, align 8, !tbaa !9
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %12, i32 0, i32 5
  %14 = call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef %13)
  %15 = icmp ne i8 %14, 0
  br i1 %15, label %22, label %16

16:                                               ; preds = %3
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %17, i32 0, i32 5
  %19 = call zeroext i8 @NetIp6IsLinkLocalAddr(ptr noundef %18)
  %20 = icmp ne i8 %19, 0
  br i1 %20, label %22, label %21

21:                                               ; preds = %16
  br label %103

22:                                               ; preds = %16, %3
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %23, i32 0, i32 4
  %25 = load i8, ptr %24, align 1, !tbaa !11
  %26 = zext i8 %25 to i32
  %27 = icmp ne i32 %26, 1
  br i1 %27, label %36, label %28

28:                                               ; preds = %22
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %29, i32 0, i32 6
  %31 = getelementptr inbounds %struct.EFI_IPv6_ADDRESS, ptr %30, i32 0, i32 0
  %32 = getelementptr inbounds [16 x i8], ptr %31, i64 0, i64 0
  %33 = load i8, ptr %32, align 1, !tbaa !15
  %34 = zext i8 %33 to i32
  %35 = icmp eq i32 %34, 255
  br i1 %35, label %37, label %36

36:                                               ; preds = %28, %22
  br label %103

37:                                               ; preds = %28
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = call i32 @NetbufCopy(ptr noundef %38, i32 noundef 0, i32 noundef 24, ptr noundef %9)
  %40 = getelementptr inbounds %struct.IP6_MLD_HEAD, ptr %9, i32 0, i32 1
  %41 = load i16, ptr %40, align 1, !tbaa !16
  %42 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %41)
  %43 = getelementptr inbounds %struct.IP6_MLD_HEAD, ptr %9, i32 0, i32 1
  store i16 %42, ptr %43, align 1, !tbaa !16
  %44 = call i64 @Ip6SetToAllNodeMulticast(i8 noundef zeroext 0, i8 noundef zeroext 2, ptr noundef %7)
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %45, i32 0, i32 6
  %47 = call i64 @CompareMem(ptr noundef %46, ptr noundef %7, i64 noundef 16)
  %48 = icmp eq i64 %47, 0
  br i1 %48, label %70, label %49

49:                                               ; preds = %37
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._EFI_IP6_HEADER, ptr %50, i32 0, i32 6
  %52 = getelementptr inbounds %struct.IP6_MLD_HEAD, ptr %9, i32 0, i32 3
  %53 = call i64 @CompareMem(ptr noundef %51, ptr noundef %52, i64 noundef 16)
  %54 = icmp eq i64 %53, 0
  br i1 %54, label %56, label %55

55:                                               ; preds = %49
  br label %103

56:                                               ; preds = %49
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.IP6_MLD_HEAD, ptr %9, i32 0, i32 3
  %59 = call ptr @Ip6FindMldEntry(ptr noundef %57, ptr noundef %58)
  store ptr %59, ptr %8, align 8, !tbaa !5
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = icmp eq ptr %60, null
  br i1 %61, label %62, label %63

62:                                               ; preds = %56
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %103

63:                                               ; preds = %56
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.IP6_MLD_HEAD, ptr %9, i32 0, i32 1
  %66 = load i16, ptr %65, align 1, !tbaa !16
  %67 = getelementptr inbounds %struct.IP6_MLD_HEAD, ptr %9, i32 0, i32 3
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = call i64 @Ip6UpdateDelayTimer(ptr noundef %64, i16 noundef zeroext %66, ptr noundef %67, ptr noundef %68)
  store i64 %69, ptr %11, align 8, !tbaa !9
  br label %103

70:                                               ; preds = %37
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._IP6_SERVICE, ptr %71, i32 0, i32 10
  %73 = getelementptr inbounds %struct.IP6_MLD_SERVICE_DATA, ptr %72, i32 0, i32 1
  %74 = getelementptr inbounds %struct._LIST_ENTRY, ptr %73, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !19
  store ptr %75, ptr %10, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %98, %70
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._IP6_SERVICE, ptr %78, i32 0, i32 10
  %80 = getelementptr inbounds %struct.IP6_MLD_SERVICE_DATA, ptr %79, i32 0, i32 1
  %81 = icmp ne ptr %77, %80
  br i1 %81, label %82, label %102

82:                                               ; preds = %76
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = ptrtoint ptr %83 to i64
  %85 = sub i64 %84, 0
  %86 = inttoptr i64 %85 to ptr
  store ptr %86, ptr %8, align 8, !tbaa !5
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.IP6_MLD_HEAD, ptr %9, i32 0, i32 1
  %89 = load i16, ptr %88, align 1, !tbaa !16
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.IP6_MLD_GROUP, ptr %90, i32 0, i32 2
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = call i64 @Ip6UpdateDelayTimer(ptr noundef %87, i16 noundef zeroext %89, ptr noundef %91, ptr noundef %92)
  store i64 %93, ptr %11, align 8, !tbaa !9
  %94 = load i64, ptr %11, align 8, !tbaa !9
  %95 = icmp slt i64 %94, 0
  br i1 %95, label %96, label %97

96:                                               ; preds = %82
  br label %103

97:                                               ; preds = %82
  br label %98

98:                                               ; preds = %97
  %99 = load ptr, ptr %10, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._LIST_ENTRY, ptr %99, i32 0, i32 0
  %101 = load ptr, ptr %100, align 8, !tbaa !37
  store ptr %101, ptr %10, align 8, !tbaa !5
  br label %76, !llvm.loop !38

102:                                              ; preds = %76
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %103

103:                                              ; preds = %102, %96, %63, %62, %55, %36, %21
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  call void @NetbufFree(ptr noundef %104)
  %105 = load i64, ptr %11, align 8, !tbaa !9
  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 24, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #3
  ret i64 %105
}

declare zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef) #2

declare zeroext i8 @NetIp6IsLinkLocalAddr(ptr noundef) #2

declare i32 @NetbufCopy(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !7, i64 7}
!12 = !{!"_EFI_IP6_HEADER", !7, i64 0, !7, i64 0, !7, i64 1, !7, i64 1, !13, i64 2, !13, i64 4, !7, i64 6, !7, i64 7, !14, i64 8, !14, i64 24}
!13 = !{!"short", !7, i64 0}
!14 = !{!"", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !13, i64 4}
!17 = !{!"", !18, i64 0, !13, i64 4, !13, i64 6, !14, i64 8}
!18 = !{!"", !7, i64 0, !7, i64 1, !13, i64 2}
!19 = !{!20, !6, i64 2176}
!20 = !{!"_IP6_SERVICE", !21, i64 0, !22, i64 8, !10, i64 24, !10, i64 32, !23, i64 40, !23, i64 56, !6, i64 72, !6, i64 80, !24, i64 88, !14, i64 136, !26, i64 2168, !14, i64 2192, !7, i64 2208, !7, i64 2209, !7, i64 2210, !7, i64 2211, !7, i64 2212, !21, i64 2216, !21, i64 2220, !21, i64 2224, !21, i64 2228, !23, i64 2232, !23, i64 2248, !23, i64 2264, !23, i64 2280, !21, i64 2296, !7, i64 2300, !6, i64 2304, !7, i64 2312, !7, i64 2313, !21, i64 2316, !6, i64 2320, !6, i64 2328, !6, i64 2336, !6, i64 2344, !27, i64 2352, !28, i64 2372, !6, i64 3032, !6, i64 3040, !29, i64 3048, !6, i64 4176, !21, i64 4184, !21, i64 4188}
!21 = !{!"int", !7, i64 0}
!22 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!23 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!24 = !{!"", !21, i64 0, !6, i64 8, !6, i64 16, !25, i64 24}
!25 = !{!"", !6, i64 0, !10, i64 8, !7, i64 16}
!26 = !{!"", !10, i64 0, !23, i64 8}
!27 = !{!"", !21, i64 0, !21, i64 4, !13, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!28 = !{!"", !21, i64 0, !21, i64 4, !21, i64 8, !21, i64 12, !21, i64 16, !21, i64 20, !21, i64 24, !21, i64 28, !21, i64 32, !21, i64 36, !7, i64 40, !14, i64 552, !14, i64 584, !14, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!29 = !{!"_IP6_CONFIG_INSTANCE", !21, i64 0, !7, i64 4, !23, i64 8, !13, i64 24, !30, i64 32, !14, i64 168, !21, i64 176, !31, i64 180, !7, i64 184, !32, i64 800, !32, i64 840, !33, i64 880, !6, i64 912, !6, i64 920, !6, i64 928, !6, i64 936, !7, i64 944, !21, i64 948, !6, i64 952, !21, i64 960, !6, i64 968, !21, i64 976, !34, i64 984, !36, i64 1040}
!30 = !{!"", !7, i64 0, !7, i64 64, !21, i64 68, !14, i64 72, !21, i64 104, !6, i64 112, !21, i64 120, !6, i64 128}
!31 = !{!"", !21, i64 0}
!32 = !{!"", !23, i64 0, !23, i64 16, !10, i64 32}
!33 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!34 = !{!"_IP6_FORM_CALLBACK_INFO", !21, i64 0, !6, i64 8, !35, i64 16, !6, i64 40, !6, i64 48}
!35 = !{!"_EFI_HII_CONFIG_ACCESS_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16}
!36 = !{!"", !21, i64 0, !31, i64 4, !14, i64 8, !23, i64 16, !21, i64 32, !23, i64 40, !21, i64 56, !23, i64 64, !21, i64 80}
!37 = !{!23, !6, i64 0}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}


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

; 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

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

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

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

declare void @NetbufFree(ptr noundef) local_unnamed_addr #2

declare i64 @Ip6SetToAllNodeMulticast(i8 noundef zeroext, i8 noundef zeroext, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip6ProcessMldQuery(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = alloca %struct.EFI_IPv6_ADDRESS, align 1
  %5 = alloca %struct.IP6_MLD_HEAD, align 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #3
  %6 = getelementptr inbounds i8, ptr %1, i64 8
  %7 = tail call zeroext i8 @NetIp6IsUnspecifiedAddr(ptr noundef nonnull %6) #3
  %.not = icmp eq i8 %7, 0
  br i1 %.not, label %8, label %10

8:                                                ; preds = %3
  %9 = tail call zeroext i8 @NetIp6IsLinkLocalAddr(ptr noundef nonnull %6) #3
  %.not24 = icmp eq i8 %9, 0
  br i1 %.not24, label %.loopexit, label %10

10:                                               ; preds = %8, %3
  %11 = getelementptr inbounds i8, ptr %1, i64 7
  %12 = load i8, ptr %11, align 1, !tbaa !5
  %.not25 = icmp eq i8 %12, 1
  br i1 %.not25, label %13, label %.loopexit

13:                                               ; preds = %10
  %14 = getelementptr inbounds i8, ptr %1, i64 24
  %15 = load i8, ptr %14, align 1, !tbaa !11
  %16 = icmp eq i8 %15, -1
  br i1 %16, label %17, label %.loopexit

17:                                               ; preds = %13
  %18 = call i32 @NetbufCopy(ptr noundef %2, i32 noundef 0, i32 noundef 24, ptr noundef nonnull %5) #3
  %19 = getelementptr inbounds i8, ptr %5, i64 4
  %20 = load i16, ptr %19, align 1, !tbaa !12
  %21 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %20) #3
  store i16 %21, ptr %19, align 1, !tbaa !12
  %22 = call i64 @Ip6SetToAllNodeMulticast(i8 noundef zeroext 0, i8 noundef zeroext 2, ptr noundef nonnull %4) #3
  %23 = call i64 @CompareMem(ptr noundef nonnull %14, ptr noundef nonnull %4, i64 noundef 16) #3
  %24 = icmp eq i64 %23, 0
  br i1 %24, label %35, label %25

25:                                               ; preds = %17
  %26 = getelementptr inbounds i8, ptr %5, i64 8
  %27 = call i64 @CompareMem(ptr noundef nonnull %14, ptr noundef nonnull %26, i64 noundef 16) #3
  %28 = icmp eq i64 %27, 0
  br i1 %28, label %29, label %.loopexit

29:                                               ; preds = %25
  %30 = call ptr @Ip6FindMldEntry(ptr noundef %0, ptr noundef nonnull %26)
  %31 = icmp eq ptr %30, null
  br i1 %31, label %.loopexit, label %32

32:                                               ; preds = %29
  %33 = load i16, ptr %19, align 1, !tbaa !12
  %34 = call i64 @Ip6UpdateDelayTimer(ptr noundef %0, i16 noundef zeroext %33, ptr noundef nonnull %26, ptr noundef nonnull %30)
  br label %.loopexit

35:                                               ; preds = %17
  %36 = getelementptr inbounds i8, ptr %0, i64 2176
  br label %37

37:                                               ; preds = %38, %35
  %.021.in = phi ptr [ %36, %35 ], [ %.021, %38 ]
  %.021 = load ptr, ptr %.021.in, align 8, !tbaa !15
  %.not26 = icmp eq ptr %.021, %36
  br i1 %.not26, label %.loopexit, label %38

38:                                               ; preds = %37
  %39 = load i16, ptr %19, align 1, !tbaa !12
  %40 = getelementptr inbounds i8, ptr %.021, i64 24
  %41 = call i64 @Ip6UpdateDelayTimer(ptr noundef %0, i16 noundef zeroext %39, ptr noundef nonnull %40, ptr noundef %.021)
  %42 = icmp slt i64 %41, 0
  br i1 %42, label %.loopexit, label %37, !llvm.loop !18

.loopexit:                                        ; preds = %37, %38, %29, %25, %10, %13, %8, %32
  %.0 = phi i64 [ -9223372036854775806, %10 ], [ %34, %32 ], [ -9223372036854775806, %25 ], [ -9223372036854775806, %13 ], [ -9223372036854775806, %8 ], [ 0, %29 ], [ 0, %37 ], [ %41, %38 ]
  call void @NetbufFree(ptr noundef %2) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  ret i64 %.0
}

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

declare zeroext i8 @NetIp6IsLinkLocalAddr(ptr noundef) local_unnamed_addr #2

declare i32 @NetbufCopy(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 7}
!6 = !{!"_EFI_IP6_HEADER", !7, i64 0, !7, i64 0, !7, i64 1, !7, i64 1, !9, i64 2, !9, i64 4, !7, i64 6, !7, i64 7, !10, i64 8, !10, i64 24}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"short", !7, i64 0}
!10 = !{!"", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !9, i64 4}
!13 = !{!"", !14, i64 0, !9, i64 4, !9, i64 6, !10, i64 8}
!14 = !{!"", !7, i64 0, !7, i64 1, !9, i64 2}
!15 = !{!16, !17, i64 0}
!16 = !{!"_LIST_ENTRY", !17, i64 0, !17, i64 8}
!17 = !{!"any pointer", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass