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

; 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._LIST_ENTRY = type { ptr, ptr }
%struct._IP6_ADDRESS_INFO = type { i32, %struct._LIST_ENTRY, %struct.EFI_IPv6_ADDRESS, i8, i8, i32, i32 }
%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.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 }

@.str = external hidden unnamed_addr constant [131 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [107 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

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

declare void @FreePool(ptr noundef) #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip6RemoveAddr(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i8 noundef zeroext %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 i8, align 1
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %struct.EFI_IPv6_ADDRESS, align 1
  %17 = 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 i8 %4, ptr %11, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, 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 16, ptr %16) #3
  %18 = load ptr, ptr %8, align 8, !tbaa !5
  %19 = call zeroext i8 @IsListEmpty(ptr noundef %18)
  %20 = zext i8 %19 to i32
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %30, label %22

22:                                               ; preds = %5
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = load i32, ptr %23, align 4, !tbaa !10
  %25 = icmp ult i32 %24, 1
  br i1 %25, label %30, label %26

26:                                               ; preds = %22
  %27 = load i8, ptr %11, align 1, !tbaa !9
  %28 = zext i8 %27 to i32
  %29 = icmp sgt i32 %28, 129
  br i1 %29, label %30, label %31

30:                                               ; preds = %26, %22, %5
  store i64 -9223372036854775806, ptr %6, align 8
  store i32 1, ptr %17, align 4
  br label %133

31:                                               ; preds = %26
  store i64 -9223372036854775794, ptr %12, align 8, !tbaa !12
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._LIST_ENTRY, ptr %32, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !14
  store ptr %34, ptr %13, align 8, !tbaa !5
  %35 = load ptr, ptr %13, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._LIST_ENTRY, ptr %35, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !14
  store ptr %37, ptr %14, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %126, %31
  %39 = load ptr, ptr %13, align 8, !tbaa !5
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = icmp ne ptr %39, %40
  br i1 %41, label %42, label %131

42:                                               ; preds = %38
  %43 = call zeroext i8 @DebugAssertEnabled()
  %44 = zext i8 %43 to i32
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %56

46:                                               ; preds = %42
  %47 = load ptr, ptr %13, align 8, !tbaa !5
  %48 = ptrtoint ptr %47 to i64
  %49 = sub i64 %48, ptrtoint (ptr getelementptr inbounds (%struct._IP6_ADDRESS_INFO, ptr null, i32 0, i32 1) to i64)
  %50 = inttoptr i64 %49 to ptr
  %51 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %50, i32 0, i32 0
  %52 = load i32, ptr %51, align 8, !tbaa !16
  %53 = icmp ne i32 %52, 1229017161
  br i1 %53, label %54, label %56

54:                                               ; preds = %46
  call void @DebugAssert(ptr noundef @.str, i64 noundef 438, ptr noundef @.str.1)
  %55 = load ptr, ptr %13, align 8, !tbaa !5
  br label %61

56:                                               ; preds = %46, %42
  %57 = load ptr, ptr %13, align 8, !tbaa !5
  %58 = ptrtoint ptr %57 to i64
  %59 = sub i64 %58, ptrtoint (ptr getelementptr inbounds (%struct._IP6_ADDRESS_INFO, ptr null, i32 0, i32 1) to i64)
  %60 = inttoptr i64 %59 to ptr
  br label %61

61:                                               ; preds = %56, %54
  %62 = phi ptr [ %55, %54 ], [ %60, %56 ]
  store ptr %62, ptr %15, align 8, !tbaa !5
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = icmp eq ptr %63, null
  br i1 %64, label %91, label %65

65:                                               ; preds = %61
  %66 = load i8, ptr %11, align 1, !tbaa !9
  %67 = zext i8 %66 to i32
  %68 = icmp eq i32 %67, 128
  br i1 %68, label %69, label %75

69:                                               ; preds = %65
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = load ptr, ptr %15, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %71, i32 0, i32 2
  %73 = call i64 @CompareMem(ptr noundef %70, ptr noundef %72, i64 noundef 16)
  %74 = icmp eq i64 %73, 0
  br i1 %74, label %91, label %75

75:                                               ; preds = %69, %65
  %76 = load i8, ptr %11, align 1, !tbaa !9
  %77 = zext i8 %76 to i32
  %78 = load ptr, ptr %15, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %78, i32 0, i32 4
  %80 = load i8, ptr %79, align 1, !tbaa !19
  %81 = zext i8 %80 to i32
  %82 = icmp eq i32 %77, %81
  br i1 %82, label %83, label %125

83:                                               ; preds = %75
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  %85 = load ptr, ptr %15, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %85, i32 0, i32 2
  %87 = load i8, ptr %11, align 1, !tbaa !9
  %88 = call zeroext i8 @NetIp6IsNetEqual(ptr noundef %84, ptr noundef %86, i8 noundef zeroext %87)
  %89 = zext i8 %88 to i32
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %125

91:                                               ; preds = %83, %69, %61
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = icmp ne ptr %92, null
  br i1 %93, label %94, label %118

94:                                               ; preds = %91
  br label %95

95:                                               ; preds = %94
  %96 = call zeroext i8 @DebugAssertEnabled()
  %97 = icmp ne i8 %96, 0
  br i1 %97, label %98, label %108

98:                                               ; preds = %95
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = icmp ne ptr %99, null
  br i1 %100, label %101, label %106

101:                                              ; preds = %98
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._IP6_SERVICE, ptr %102, i32 0, i32 0
  %104 = load i32, ptr %103, align 8, !tbaa !20
  %105 = icmp eq i32 %104, 1396068425
  br i1 %105, label %107, label %106

106:                                              ; preds = %101, %98
  call void @DebugAssert(ptr noundef @.str, i64 noundef 445, ptr noundef @.str.3)
  br label %107

107:                                              ; preds = %106, %101
  br label %108

108:                                              ; preds = %107, %95
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  %111 = load ptr, ptr %15, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %111, i32 0, i32 2
  call void @Ip6CreateSNMulticastAddr(ptr noundef %112, ptr noundef %16)
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = call i64 @Ip6LeaveGroup(ptr noundef %113, ptr noundef %16)
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = load ptr, ptr %15, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._IP6_ADDRESS_INFO, ptr %116, i32 0, i32 2
  call void @Ip6DestroyInstanceByAddress(ptr noundef %115, ptr noundef %117)
  br label %118

118:                                              ; preds = %110, %91
  %119 = load ptr, ptr %13, align 8, !tbaa !5
  %120 = call ptr @RemoveEntryList(ptr noundef %119)
  %121 = load ptr, ptr %15, align 8, !tbaa !5
  call void @FreePool(ptr noundef %121)
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = load i32, ptr %122, align 4, !tbaa !10
  %124 = add i32 %123, -1
  store i32 %124, ptr %122, align 4, !tbaa !10
  store i64 0, ptr %12, align 8, !tbaa !12
  br label %125

125:                                              ; preds = %118, %83, %75
  br label %126

126:                                              ; preds = %125
  %127 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %127, ptr %13, align 8, !tbaa !5
  %128 = load ptr, ptr %13, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._LIST_ENTRY, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !14
  store ptr %130, ptr %14, align 8, !tbaa !5
  br label %38, !llvm.loop !37

131:                                              ; preds = %38
  %132 = load i64, ptr %12, align 8, !tbaa !12
  store i64 %132, ptr %6, align 8
  store i32 1, ptr %17, align 4
  br label %133

133:                                              ; preds = %131, %30
  call void @llvm.lifetime.end.p0(i64 16, 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 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %134 = load i64, ptr %6, align 8
  ret i64 %134
}

declare zeroext i8 @IsListEmpty(ptr noundef) #1

declare zeroext i8 @NetIp6IsNetEqual(ptr noundef, ptr noundef, i8 noundef zeroext) #1

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

declare ptr @RemoveEntryList(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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!16 = !{!17, !11, i64 0}
!17 = !{!"_IP6_ADDRESS_INFO", !11, i64 0, !15, i64 8, !18, i64 24, !7, i64 40, !7, i64 41, !11, i64 44, !11, i64 48}
!18 = !{!"", !7, i64 0}
!19 = !{!17, !7, i64 41}
!20 = !{!21, !11, i64 0}
!21 = !{!"_IP6_SERVICE", !11, i64 0, !22, i64 8, !13, i64 24, !13, i64 32, !15, i64 40, !15, i64 56, !6, i64 72, !6, i64 80, !23, i64 88, !18, i64 136, !25, i64 2168, !18, 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, !15, i64 2232, !15, i64 2248, !15, i64 2264, !15, 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, !26, i64 2352, !28, i64 2372, !6, i64 3032, !6, i64 3040, !29, i64 3048, !6, i64 4176, !11, i64 4184, !11, i64 4188}
!22 = !{!"_EFI_SERVICE_BINDING_PROTOCOL", !6, i64 0, !6, i64 8}
!23 = !{!"", !11, i64 0, !6, i64 8, !6, i64 16, !24, i64 24}
!24 = !{!"", !6, i64 0, !13, i64 8, !7, i64 16}
!25 = !{!"", !13, i64 0, !15, i64 8}
!26 = !{!"", !11, i64 0, !11, i64 4, !27, i64 8, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16}
!27 = !{!"short", !7, i64 0}
!28 = !{!"", !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, !18, i64 552, !18, i64 584, !18, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!29 = !{!"_IP6_CONFIG_INSTANCE", !11, i64 0, !7, i64 4, !15, i64 8, !27, i64 24, !30, i64 32, !18, i64 168, !11, 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, !11, i64 948, !6, i64 952, !11, i64 960, !6, i64 968, !11, i64 976, !34, i64 984, !36, i64 1040}
!30 = !{!"", !7, i64 0, !7, i64 64, !11, i64 68, !18, i64 72, !11, i64 104, !6, i64 112, !11, i64 120, !6, i64 128}
!31 = !{!"", !11, i64 0}
!32 = !{!"", !15, i64 0, !15, i64 16, !13, i64 32}
!33 = !{!"_EFI_IP6_CONFIG_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!34 = !{!"_IP6_FORM_CALLBACK_INFO", !11, 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 = !{!"", !11, i64 0, !31, i64 4, !18, i64 8, !15, i64 16, !11, i64 32, !15, i64 40, !11, i64 56, !15, i64 64, !11, i64 80}
!37 = distinct !{!37, !38}
!38 = !{!"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] }

@.str = external hidden unnamed_addr constant [131 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [107 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

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

declare void @FreePool(ptr noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775806, 1) i64 @Ip6RemoveAddr(ptr noundef %0, ptr noundef %1, ptr nocapture noundef %2, ptr noundef %3, i8 noundef zeroext %4) local_unnamed_addr #2 {
  %6 = alloca %struct.EFI_IPv6_ADDRESS, align 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %7 = tail call zeroext i8 @IsListEmpty(ptr noundef %1) #3
  %.not = icmp eq i8 %7, 0
  br i1 %.not, label %8, label %.loopexit

8:                                                ; preds = %5
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = icmp eq i32 %9, 0
  %11 = icmp ugt i8 %4, -127
  %or.cond = or i1 %11, %10
  br i1 %or.cond, label %.loopexit, label %12

12:                                               ; preds = %8
  %13 = load ptr, ptr %1, align 8, !tbaa !9
  %.03446 = load ptr, ptr %13, align 8, !tbaa !9
  %.not4047 = icmp eq ptr %13, %1
  br i1 %.not4047, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %12
  %14 = icmp eq ptr %3, null
  %15 = icmp eq i8 %4, -128
  %.not44 = icmp eq ptr %0, null
  br i1 %.not44, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph
  br i1 %14, label %.lr.ph.split.us.split.us, label %.lr.ph.split.us.split

.lr.ph.split.us.split.us:                         ; preds = %.lr.ph.split.us, %.lr.ph.split.us.split.us._crit_edge
  %.03451.us.us = phi ptr [ %.034.us.us, %.lr.ph.split.us.split.us._crit_edge ], [ %.03446, %.lr.ph.split.us ]
  %.03549.us.us = phi ptr [ %.03451.us.us, %.lr.ph.split.us.split.us._crit_edge ], [ %13, %.lr.ph.split.us ]
  %16 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not41.us.us = icmp eq i8 %16, 0
  %.pre = ptrtoint ptr %.03549.us.us to i64
  %.pre66 = add i64 %.pre, -8
  %.pre68 = inttoptr i64 %.pre66 to ptr
  br i1 %.not41.us.us, label %.lr.ph.split.us.split.us._crit_edge, label %17

17:                                               ; preds = %.lr.ph.split.us.split.us
  %18 = load i32, ptr %.pre68, align 8, !tbaa !12
  %.not42.us.us = icmp eq i32 %18, 1229017161
  br i1 %.not42.us.us, label %.lr.ph.split.us.split.us._crit_edge, label %19

19:                                               ; preds = %17
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 438, ptr noundef nonnull @.str.1) #3
  br label %.lr.ph.split.us.split.us._crit_edge

.lr.ph.split.us.split.us._crit_edge:              ; preds = %.lr.ph.split.us.split.us, %17, %19
  %20 = phi ptr [ %.03549.us.us, %19 ], [ %.pre68, %17 ], [ %.pre68, %.lr.ph.split.us.split.us ]
  %21 = tail call ptr @RemoveEntryList(ptr noundef nonnull %.03549.us.us) #3
  tail call void @FreePool(ptr noundef %20) #3
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = add i32 %22, -1
  store i32 %23, ptr %2, align 4, !tbaa !5
  %.034.us.us = load ptr, ptr %.03451.us.us, align 8, !tbaa !9
  %.not40.us.us = icmp eq ptr %.03451.us.us, %1
  br i1 %.not40.us.us, label %.loopexit, label %.lr.ph.split.us.split.us, !llvm.loop !15

.lr.ph.split.us.split:                            ; preds = %.lr.ph.split.us, %44
  %.03451.us = phi ptr [ %.034.us, %44 ], [ %.03446, %.lr.ph.split.us ]
  %.03549.us = phi ptr [ %.03451.us, %44 ], [ %13, %.lr.ph.split.us ]
  %.03648.us = phi i64 [ %.1.us, %44 ], [ -9223372036854775794, %.lr.ph.split.us ]
  %24 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not41.us = icmp eq i8 %24, 0
  %.pre70 = ptrtoint ptr %.03549.us to i64
  %.pre72 = add i64 %.pre70, -8
  %.pre74 = inttoptr i64 %.pre72 to ptr
  br i1 %.not41.us, label %.lr.ph.split.us.split._crit_edge, label %25

25:                                               ; preds = %.lr.ph.split.us.split
  %26 = load i32, ptr %.pre74, align 8, !tbaa !12
  %.not42.us = icmp eq i32 %26, 1229017161
  br i1 %.not42.us, label %.lr.ph.split.us.split._crit_edge, label %27

27:                                               ; preds = %25
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 438, ptr noundef nonnull @.str.1) #3
  br label %.lr.ph.split.us.split._crit_edge

.lr.ph.split.us.split._crit_edge:                 ; preds = %.lr.ph.split.us.split, %25, %27
  %28 = phi ptr [ %.03549.us, %27 ], [ %.pre74, %25 ], [ %.pre74, %.lr.ph.split.us.split ]
  br i1 %15, label %29, label %33

29:                                               ; preds = %.lr.ph.split.us.split._crit_edge
  %30 = getelementptr inbounds i8, ptr %28, i64 24
  %31 = tail call i64 @CompareMem(ptr noundef nonnull %3, ptr noundef nonnull %30, i64 noundef 16) #3
  %32 = icmp eq i64 %31, 0
  br i1 %32, label %40, label %33

33:                                               ; preds = %29, %.lr.ph.split.us.split._crit_edge
  %34 = getelementptr inbounds i8, ptr %28, i64 41
  %35 = load i8, ptr %34, align 1, !tbaa !17
  %36 = icmp eq i8 %35, %4
  br i1 %36, label %37, label %44

37:                                               ; preds = %33
  %38 = getelementptr inbounds i8, ptr %28, i64 24
  %39 = tail call zeroext i8 @NetIp6IsNetEqual(ptr noundef nonnull %3, ptr noundef nonnull %38, i8 noundef zeroext %4) #3
  %.not43.us = icmp eq i8 %39, 0
  br i1 %.not43.us, label %44, label %40

40:                                               ; preds = %37, %29
  %41 = tail call ptr @RemoveEntryList(ptr noundef nonnull %.03549.us) #3
  tail call void @FreePool(ptr noundef %28) #3
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = add i32 %42, -1
  store i32 %43, ptr %2, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %40, %37, %33
  %.1.us = phi i64 [ 0, %40 ], [ %.03648.us, %37 ], [ %.03648.us, %33 ]
  %.034.us = load ptr, ptr %.03451.us, align 8, !tbaa !9
  %.not40.us = icmp eq ptr %.03451.us, %1
  br i1 %.not40.us, label %.loopexit, label %.lr.ph.split.us.split, !llvm.loop !15

.lr.ph.split:                                     ; preds = %.lr.ph
  br i1 %14, label %.lr.ph.split.split.us, label %.lr.ph.split.split

.lr.ph.split.split.us:                            ; preds = %.lr.ph.split, %55
  %.03451.us52 = phi ptr [ %.034.us58, %55 ], [ %.03446, %.lr.ph.split ]
  %.03549.us53 = phi ptr [ %.03451.us52, %55 ], [ %13, %.lr.ph.split ]
  %45 = call zeroext i8 @DebugAssertEnabled() #3
  %.not41.us55 = icmp eq i8 %45, 0
  %.pre76 = ptrtoint ptr %.03549.us53 to i64
  %.pre78 = add i64 %.pre76, -8
  %.pre80 = inttoptr i64 %.pre78 to ptr
  br i1 %.not41.us55, label %.lr.ph.split.split.us._crit_edge, label %46

46:                                               ; preds = %.lr.ph.split.split.us
  %47 = load i32, ptr %.pre80, align 8, !tbaa !12
  %.not42.us56 = icmp eq i32 %47, 1229017161
  br i1 %.not42.us56, label %.lr.ph.split.split.us._crit_edge, label %48

48:                                               ; preds = %46
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 438, ptr noundef nonnull @.str.1) #3
  br label %.lr.ph.split.split.us._crit_edge

.lr.ph.split.split.us._crit_edge:                 ; preds = %.lr.ph.split.split.us, %46, %48
  %49 = phi ptr [ %.03549.us53, %48 ], [ %.pre80, %46 ], [ %.pre80, %.lr.ph.split.split.us ]
  %50 = call zeroext i8 @DebugAssertEnabled() #3
  %.not45.us = icmp eq i8 %50, 0
  br i1 %.not45.us, label %55, label %51

51:                                               ; preds = %.lr.ph.split.split.us._crit_edge
  %52 = load i32, ptr %0, align 8, !tbaa !18
  %53 = icmp eq i32 %52, 1396068425
  br i1 %53, label %55, label %54

54:                                               ; preds = %51
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 445, ptr noundef nonnull @.str.3) #3
  br label %55

55:                                               ; preds = %54, %51, %.lr.ph.split.split.us._crit_edge
  %56 = getelementptr inbounds i8, ptr %49, i64 24
  call void @Ip6CreateSNMulticastAddr(ptr noundef nonnull %56, ptr noundef nonnull %6)
  %57 = call i64 @Ip6LeaveGroup(ptr noundef nonnull %0, ptr noundef nonnull %6) #3
  call void @Ip6DestroyInstanceByAddress(ptr noundef nonnull %0, ptr noundef nonnull %56)
  %58 = call ptr @RemoveEntryList(ptr noundef nonnull %.03549.us53) #3
  call void @FreePool(ptr noundef %49) #3
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = add i32 %59, -1
  store i32 %60, ptr %2, align 4, !tbaa !5
  %.034.us58 = load ptr, ptr %.03451.us52, align 8, !tbaa !9
  %.not40.us59 = icmp eq ptr %.03451.us52, %1
  br i1 %.not40.us59, label %.loopexit, label %.lr.ph.split.split.us, !llvm.loop !15

.lr.ph.split.split:                               ; preds = %.lr.ph.split, %89
  %.03451 = phi ptr [ %.034, %89 ], [ %.03446, %.lr.ph.split ]
  %.03549 = phi ptr [ %.03451, %89 ], [ %13, %.lr.ph.split ]
  %.03648 = phi i64 [ %.1, %89 ], [ -9223372036854775794, %.lr.ph.split ]
  %61 = call zeroext i8 @DebugAssertEnabled() #3
  %.not41 = icmp eq i8 %61, 0
  %.pre82 = ptrtoint ptr %.03549 to i64
  %.pre84 = add i64 %.pre82, -8
  %.pre86 = inttoptr i64 %.pre84 to ptr
  br i1 %.not41, label %.lr.ph.split.split._crit_edge, label %62

62:                                               ; preds = %.lr.ph.split.split
  %63 = load i32, ptr %.pre86, align 8, !tbaa !12
  %.not42 = icmp eq i32 %63, 1229017161
  br i1 %.not42, label %.lr.ph.split.split._crit_edge, label %64

64:                                               ; preds = %62
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 438, ptr noundef nonnull @.str.1) #3
  br label %.lr.ph.split.split._crit_edge

.lr.ph.split.split._crit_edge:                    ; preds = %.lr.ph.split.split, %62, %64
  %65 = phi ptr [ %.03549, %64 ], [ %.pre86, %62 ], [ %.pre86, %.lr.ph.split.split ]
  br i1 %15, label %66, label %70

66:                                               ; preds = %.lr.ph.split.split._crit_edge
  %67 = getelementptr inbounds i8, ptr %65, i64 24
  %68 = call i64 @CompareMem(ptr noundef nonnull %3, ptr noundef nonnull %67, i64 noundef 16) #3
  %69 = icmp eq i64 %68, 0
  br i1 %69, label %77, label %70

70:                                               ; preds = %66, %.lr.ph.split.split._crit_edge
  %71 = getelementptr inbounds i8, ptr %65, i64 41
  %72 = load i8, ptr %71, align 1, !tbaa !17
  %73 = icmp eq i8 %72, %4
  br i1 %73, label %74, label %89

74:                                               ; preds = %70
  %75 = getelementptr inbounds i8, ptr %65, i64 24
  %76 = call zeroext i8 @NetIp6IsNetEqual(ptr noundef nonnull %3, ptr noundef nonnull %75, i8 noundef zeroext %4) #3
  %.not43 = icmp eq i8 %76, 0
  br i1 %.not43, label %89, label %77

77:                                               ; preds = %74, %66
  %78 = call zeroext i8 @DebugAssertEnabled() #3
  %.not45 = icmp eq i8 %78, 0
  br i1 %.not45, label %83, label %79

79:                                               ; preds = %77
  %80 = load i32, ptr %0, align 8, !tbaa !18
  %81 = icmp eq i32 %80, 1396068425
  br i1 %81, label %83, label %82

82:                                               ; preds = %79
  call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 445, ptr noundef nonnull @.str.3) #3
  br label %83

83:                                               ; preds = %79, %82, %77
  %84 = getelementptr inbounds i8, ptr %65, i64 24
  call void @Ip6CreateSNMulticastAddr(ptr noundef nonnull %84, ptr noundef nonnull %6)
  %85 = call i64 @Ip6LeaveGroup(ptr noundef nonnull %0, ptr noundef nonnull %6) #3
  call void @Ip6DestroyInstanceByAddress(ptr noundef nonnull %0, ptr noundef nonnull %84)
  %86 = call ptr @RemoveEntryList(ptr noundef nonnull %.03549) #3
  call void @FreePool(ptr noundef %65) #3
  %87 = load i32, ptr %2, align 4, !tbaa !5
  %88 = add i32 %87, -1
  store i32 %88, ptr %2, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %70, %74, %83
  %.1 = phi i64 [ 0, %83 ], [ %.03648, %74 ], [ %.03648, %70 ]
  %.034 = load ptr, ptr %.03451, align 8, !tbaa !9
  %.not40 = icmp eq ptr %.03451, %1
  br i1 %.not40, label %.loopexit, label %.lr.ph.split.split, !llvm.loop !15

.loopexit:                                        ; preds = %89, %55, %44, %.lr.ph.split.us.split.us._crit_edge, %12, %5, %8
  %.0 = phi i64 [ -9223372036854775806, %8 ], [ -9223372036854775806, %5 ], [ -9223372036854775794, %12 ], [ 0, %.lr.ph.split.us.split.us._crit_edge ], [ %.1.us, %44 ], [ 0, %55 ], [ %.1, %89 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  ret i64 %.0
}

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

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

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

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


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass