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

@.str = external hidden unnamed_addr constant [127 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [21 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 void @FreePool(ptr noundef) #1

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

15:                                               ; preds = %4
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %16, i32 0, i32 1
  %18 = load i64, ptr %17, align 8, !tbaa !10
  %19 = icmp sgt i64 %18, 0
  br i1 %19, label %20, label %27

20:                                               ; preds = %15
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %21, i32 0, i32 1
  %23 = load i64, ptr %22, align 8, !tbaa !10
  %24 = add nsw i64 %23, -1
  store i64 %24, ptr %22, align 8, !tbaa !10
  %25 = icmp sgt i64 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %20
  store i32 1, ptr %12, align 4
  br label %97

27:                                               ; preds = %20, %15, %4
  %28 = load i8, ptr %7, align 1, !tbaa !9
  %29 = icmp ne i8 %28, 0
  br i1 %29, label %30, label %45

30:                                               ; preds = %27
  br label %31

31:                                               ; preds = %41, %30
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._IP6_SERVICE, ptr %32, i32 0, i32 7
  %34 = load ptr, ptr %33, align 8, !tbaa !16
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %35, i32 0, i32 5
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %37, i32 0, i32 4
  %39 = load i8, ptr %38, align 8, !tbaa !33
  %40 = call i64 @Ip6DelRoute(ptr noundef %34, ptr noundef %36, i8 noundef zeroext %39, ptr noundef null)
  store i64 %40, ptr %11, align 8, !tbaa !34
  br label %41

41:                                               ; preds = %31
  %42 = load i64, ptr %11, align 8, !tbaa !34
  %43 = icmp ne i64 %42, -9223372036854775794
  br i1 %43, label %31, label %44, !llvm.loop !35

44:                                               ; preds = %41
  br label %92

45:                                               ; preds = %27
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct._IP6_SERVICE, ptr %46, i32 0, i32 5
  %48 = getelementptr inbounds %struct._LIST_ENTRY, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !37
  store ptr %49, ptr %9, align 8, !tbaa !5
  br label %50

50:                                               ; preds = %87, %45
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._IP6_SERVICE, ptr %52, i32 0, i32 5
  %54 = icmp ne ptr %51, %53
  br i1 %54, label %55, label %91

55:                                               ; preds = %50
  %56 = call zeroext i8 @DebugAssertEnabled()
  %57 = zext i8 %56 to i32
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %69

59:                                               ; preds = %55
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = ptrtoint ptr %60 to i64
  %62 = sub i64 %61, ptrtoint (ptr getelementptr inbounds (%struct._IP6_INTERFACE, ptr null, i32 0, i32 1) to i64)
  %63 = inttoptr i64 %62 to ptr
  %64 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 8, !tbaa !38
  %66 = icmp ne i32 %65, 1228296265
  br i1 %66, label %67, label %69

67:                                               ; preds = %59
  call void @DebugAssert(ptr noundef @.str, i64 noundef 308, ptr noundef @.str.7)
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  br label %74

69:                                               ; preds = %59, %55
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = ptrtoint ptr %70 to i64
  %72 = sub i64 %71, ptrtoint (ptr getelementptr inbounds (%struct._IP6_INTERFACE, ptr null, i32 0, i32 1) to i64)
  %73 = inttoptr i64 %72 to ptr
  br label %74

74:                                               ; preds = %69, %67
  %75 = phi ptr [ %68, %67 ], [ %73, %69 ]
  store ptr %75, ptr %10, align 8, !tbaa !5
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %77, i32 0, i32 3
  %79 = load ptr, ptr %10, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._IP6_INTERFACE, ptr %79, i32 0, i32 4
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %81, i32 0, i32 5
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %83, i32 0, i32 4
  %85 = load i8, ptr %84, align 8, !tbaa !33
  %86 = call i64 @Ip6RemoveAddr(ptr noundef %76, ptr noundef %78, ptr noundef %80, ptr noundef %82, i8 noundef zeroext %85)
  br label %87

87:                                               ; preds = %74
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct._LIST_ENTRY, ptr %88, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !40
  store ptr %90, ptr %9, align 8, !tbaa !5
  br label %50, !llvm.loop !41

91:                                               ; preds = %50
  br label %92

92:                                               ; preds = %91, %44
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._IP6_PREFIX_LIST_ENTRY, ptr %93, i32 0, i32 0
  %95 = call ptr @RemoveEntryList(ptr noundef %94)
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  call void @FreePool(ptr noundef %96)
  store i32 0, ptr %12, align 4
  br label %97

97:                                               ; preds = %92, %26
  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 8, ptr %9) #3
  %98 = load i32, ptr %12, align 4
  switch i32 %98, label %100 [
    i32 0, label %99
    i32 1, label %99
  ]

99:                                               ; preds = %97, %97
  ret void

100:                                              ; preds = %97
  unreachable
}

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

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


; 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"

@.str = external hidden unnamed_addr constant [127 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [21 x i8], align 1

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

declare void @FreePool(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @Ip6DestroyPrefixListEntry(ptr noundef %0, ptr noundef %1, i8 noundef zeroext %2, i8 noundef zeroext %3) local_unnamed_addr #1 {
  %.not = icmp eq i8 %3, 0
  br i1 %.not, label %5, label %11

5:                                                ; preds = %4
  %6 = getelementptr inbounds i8, ptr %1, i64 16
  %7 = load i64, ptr %6, align 8, !tbaa !5
  %8 = icmp sgt i64 %7, 0
  br i1 %8, label %9, label %11

9:                                                ; preds = %5
  %10 = add nsw i64 %7, -1
  store i64 %10, ptr %6, align 8, !tbaa !5
  %.not22 = icmp eq i64 %7, 1
  br i1 %.not22, label %11, label %34

11:                                               ; preds = %9, %5, %4
  %.not23 = icmp eq i8 %2, 0
  br i1 %.not23, label %19, label %.preheader

.preheader:                                       ; preds = %11
  %12 = getelementptr inbounds i8, ptr %0, i64 80
  %13 = getelementptr inbounds i8, ptr %1, i64 33
  %14 = getelementptr inbounds i8, ptr %1, i64 32
  br label %15

15:                                               ; preds = %.preheader, %15
  %16 = load ptr, ptr %12, align 8, !tbaa !14
  %17 = load i8, ptr %14, align 8, !tbaa !31
  %18 = tail call i64 @Ip6DelRoute(ptr noundef %16, ptr noundef nonnull %13, i8 noundef zeroext %17, ptr noundef null) #2
  %.not27 = icmp eq i64 %18, -9223372036854775794
  br i1 %.not27, label %.loopexit, label %15, !llvm.loop !32

19:                                               ; preds = %11
  %20 = getelementptr inbounds i8, ptr %0, i64 56
  %.029 = load ptr, ptr %20, align 8, !tbaa !34
  %.not2430 = icmp eq ptr %.029, %20
  br i1 %.not2430, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %19
  %21 = getelementptr inbounds i8, ptr %1, i64 33
  %22 = getelementptr inbounds i8, ptr %1, i64 32
  br label %23

23:                                               ; preds = %.lr.ph, %._crit_edge
  %.031 = phi ptr [ %.029, %.lr.ph ], [ %.0, %._crit_edge ]
  %24 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not25 = icmp eq i8 %24, 0
  %.pre = ptrtoint ptr %.031 to i64
  %.pre33 = add i64 %.pre, -8
  %.pre35 = inttoptr i64 %.pre33 to ptr
  br i1 %.not25, label %._crit_edge, label %25

25:                                               ; preds = %23
  %26 = load i32, ptr %.pre35, align 8, !tbaa !35
  %.not26 = icmp eq i32 %26, 1228296265
  br i1 %.not26, label %._crit_edge, label %27

27:                                               ; preds = %25
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 308, ptr noundef nonnull @.str.7) #2
  br label %._crit_edge

._crit_edge:                                      ; preds = %23, %25, %27
  %28 = phi ptr [ %.031, %27 ], [ %.pre35, %25 ], [ %.pre35, %23 ]
  %29 = getelementptr inbounds i8, ptr %28, i64 32
  %30 = getelementptr inbounds i8, ptr %28, i64 48
  %31 = load i8, ptr %22, align 8, !tbaa !31
  %32 = tail call i64 @Ip6RemoveAddr(ptr noundef %0, ptr noundef nonnull %29, ptr noundef nonnull %30, ptr noundef nonnull %21, i8 noundef zeroext %31) #2
  %.0 = load ptr, ptr %.031, align 8, !tbaa !34
  %.not24 = icmp eq ptr %.0, %20
  br i1 %.not24, label %.loopexit, label %23, !llvm.loop !37

.loopexit:                                        ; preds = %15, %._crit_edge, %19
  %33 = tail call ptr @RemoveEntryList(ptr noundef %1) #2
  tail call void @FreePool(ptr noundef %1) #2
  br label %34

34:                                               ; preds = %9, %.loopexit
  ret void
}

declare i64 @Ip6DelRoute(ptr noundef, ptr noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #0

declare i64 @Ip6RemoveAddr(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext) local_unnamed_addr #0

declare ptr @RemoveEntryList(ptr noundef) local_unnamed_addr #0

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


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