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

; 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_PROTOCOL = type { i32, %struct._EFI_IP6_PROTOCOL, ptr, i64, ptr, %struct._LIST_ENTRY, i8, %struct.NET_MAP, %struct.NET_MAP, %struct._LIST_ENTRY, %struct._LIST_ENTRY, %struct.EFI_LOCK, ptr, %struct._LIST_ENTRY, ptr, i32, %struct.EFI_IP6_CONFIG_DATA, i8 }
%struct._EFI_IP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NET_MAP = type { %struct._LIST_ENTRY, %struct._LIST_ENTRY, i64 }
%struct.EFI_LOCK = type { i64, i64, i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_IP6_CONFIG_DATA = type { i8, i8, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS, i8, i8, i32, i32, i32 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }

@.str = external hidden unnamed_addr constant [128 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 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 i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) #1

declare void @FreePool(ptr noundef) #1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip6Groups(ptr noundef %0, i8 noundef zeroext %1, ptr noundef %2) #2 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i8 %1, ptr %6, align 1, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %13, i32 0, i32 4
  %15 = load ptr, ptr %14, align 8, !tbaa !10
  store ptr %15, ptr %9, align 8, !tbaa !5
  %16 = load i8, ptr %6, align 1, !tbaa !9
  %17 = icmp ne i8 %16, 0
  br i1 %17, label %18, label %66

18:                                               ; preds = %3
  br label %19

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

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

25:                                               ; preds = %22
  call void @DebugAssert(ptr noundef @.str, i64 noundef 633, ptr noundef @.str.10)
  br label %26

26:                                               ; preds = %25, %22
  br label %27

27:                                               ; preds = %26, %19
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  store i32 0, ptr %10, align 4, !tbaa !20
  br label %30

30:                                               ; preds = %48, %29
  %31 = load i32, ptr %10, align 4, !tbaa !20
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %32, i32 0, i32 15
  %34 = load i32, ptr %33, align 8, !tbaa !21
  %35 = icmp ult i32 %31, %34
  br i1 %35, label %36, label %51

36:                                               ; preds = %30
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %37, i32 0, i32 14
  %39 = load ptr, ptr %38, align 8, !tbaa !22
  %40 = load i32, ptr %10, align 4, !tbaa !20
  %41 = zext i32 %40 to i64
  %42 = getelementptr inbounds %struct.EFI_IPv6_ADDRESS, ptr %39, i64 %41
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = call i64 @CompareMem(ptr noundef %42, ptr noundef %43, i64 noundef 16)
  %45 = icmp eq i64 %44, 0
  br i1 %45, label %46, label %47

46:                                               ; preds = %36
  store i64 -9223372036854775788, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %137

47:                                               ; preds = %36
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %10, align 4, !tbaa !20
  %50 = add i32 %49, 1
  store i32 %50, ptr %10, align 4, !tbaa !20
  br label %30, !llvm.loop !23

51:                                               ; preds = %30
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %53, i32 0, i32 12
  %55 = load ptr, ptr %54, align 8, !tbaa !25
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = call i64 @Ip6JoinGroup(ptr noundef %52, ptr noundef %55, ptr noundef %56)
  store i64 %57, ptr %8, align 8, !tbaa !26
  %58 = load i64, ptr %8, align 8, !tbaa !26
  %59 = icmp slt i64 %58, 0
  br i1 %59, label %64, label %60

60:                                               ; preds = %51
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = call i64 @Ip6CombineGroups(ptr noundef %61, ptr noundef %62)
  store i64 %63, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %137

64:                                               ; preds = %51
  %65 = load i64, ptr %8, align 8, !tbaa !26
  store i64 %65, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %137

66:                                               ; preds = %3
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %67, i32 0, i32 15
  %69 = load i32, ptr %68, align 8, !tbaa !21
  store i32 %69, ptr %10, align 4, !tbaa !20
  br label %70

70:                                               ; preds = %129, %66
  %71 = load i32, ptr %10, align 4, !tbaa !20
  %72 = icmp ugt i32 %71, 0
  br i1 %72, label %73, label %132

73:                                               ; preds = %70
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %74, i32 0, i32 14
  %76 = load ptr, ptr %75, align 8, !tbaa !22
  %77 = load i32, ptr %10, align 4, !tbaa !20
  %78 = sub i32 %77, 1
  %79 = zext i32 %78 to i64
  %80 = getelementptr inbounds %struct.EFI_IPv6_ADDRESS, ptr %76, i64 %79
  store ptr %80, ptr %11, align 8, !tbaa !5
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = icmp eq ptr %81, null
  br i1 %82, label %88, label %83

83:                                               ; preds = %73
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = call i64 @CompareMem(ptr noundef %84, ptr noundef %85, i64 noundef 16)
  %87 = icmp eq i64 %86, 0
  br i1 %87, label %88, label %128

88:                                               ; preds = %83, %73
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %89, i32 0, i32 4
  %91 = load ptr, ptr %90, align 8, !tbaa !10
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = call i64 @Ip6LeaveGroup(ptr noundef %91, ptr noundef %92)
  store i64 %93, ptr %8, align 8, !tbaa !26
  %94 = load i64, ptr %8, align 8, !tbaa !26
  %95 = icmp slt i64 %94, 0
  br i1 %95, label %96, label %98

96:                                               ; preds = %88
  %97 = load i64, ptr %8, align 8, !tbaa !26
  store i64 %97, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %137

98:                                               ; preds = %88
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = call i64 @Ip6RemoveGroup(ptr noundef %99, ptr noundef %100)
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %102, i32 0, i32 15
  %104 = load i32, ptr %103, align 8, !tbaa !21
  %105 = icmp eq i32 %104, 0
  br i1 %105, label %106, label %123

106:                                              ; preds = %98
  br label %107

107:                                              ; preds = %106
  %108 = call zeroext i8 @DebugAssertEnabled()
  %109 = icmp ne i8 %108, 0
  br i1 %109, label %110, label %115

110:                                              ; preds = %107
  %111 = load i32, ptr %10, align 4, !tbaa !20
  %112 = icmp eq i32 %111, 1
  br i1 %112, label %114, label %113

113:                                              ; preds = %110
  call void @DebugAssert(ptr noundef @.str, i64 noundef 664, ptr noundef @.str.11)
  br label %114

114:                                              ; preds = %113, %110
  br label %115

115:                                              ; preds = %114, %107
  br label %116

116:                                              ; preds = %115
  br label %117

117:                                              ; preds = %116
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %118, i32 0, i32 14
  %120 = load ptr, ptr %119, align 8, !tbaa !22
  call void @FreePool(ptr noundef %120)
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct._IP6_PROTOCOL, ptr %121, i32 0, i32 14
  store ptr null, ptr %122, align 8, !tbaa !22
  br label %123

123:                                              ; preds = %117, %98
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = icmp ne ptr %124, null
  br i1 %125, label %126, label %127

126:                                              ; preds = %123
  store i64 0, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %137

127:                                              ; preds = %123
  br label %128

128:                                              ; preds = %127, %83
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %10, align 4, !tbaa !20
  %131 = add i32 %130, -1
  store i32 %131, ptr %10, align 4, !tbaa !20
  br label %70, !llvm.loop !27

132:                                              ; preds = %70
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = icmp ne ptr %133, null
  %135 = zext i1 %134 to i64
  %136 = select i1 %134, i64 -9223372036854775794, i64 0
  store i64 %136, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %137

137:                                              ; preds = %132, %126, %96, %64, %60, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %138 = load i64, ptr %4, align 8
  ret i64 %138
}

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, !6, i64 96}
!11 = !{!"_IP6_PROTOCOL", !12, i64 0, !13, i64 8, !6, i64 80, !14, i64 88, !6, i64 96, !15, i64 104, !7, i64 120, !16, i64 128, !16, i64 168, !15, i64 208, !15, i64 224, !17, i64 240, !6, i64 264, !15, i64 272, !6, i64 288, !12, i64 296, !18, i64 300, !7, i64 352}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_EFI_IP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!14 = !{!"long long", !7, i64 0}
!15 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!16 = !{!"", !15, i64 0, !15, i64 16, !14, i64 32}
!17 = !{!"", !14, i64 0, !14, i64 8, !12, i64 16}
!18 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !19, i64 4, !19, i64 20, !7, i64 36, !7, i64 37, !12, i64 40, !12, i64 44, !12, i64 48}
!19 = !{!"", !7, i64 0}
!20 = !{!12, !12, i64 0}
!21 = !{!11, !12, i64 296}
!22 = !{!11, !6, i64 288}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!11, !6, i64 264}
!26 = !{!14, !14, i64 0}
!27 = distinct !{!27, !24}


; 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 [128 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 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 i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

declare void @FreePool(ptr noundef) local_unnamed_addr #0

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @Ip6Groups(ptr noundef %0, i8 noundef zeroext %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = getelementptr inbounds i8, ptr %0, i64 96
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %.not = icmp eq i8 %1, 0
  br i1 %.not, label %30, label %6

6:                                                ; preds = %3
  %7 = tail call zeroext i8 @DebugAssertEnabled() #2
  %8 = icmp eq i8 %7, 0
  %9 = icmp ne ptr %2, null
  %or.cond = or i1 %9, %8
  br i1 %or.cond, label %11, label %10

10:                                               ; preds = %6
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 633, ptr noundef nonnull @.str.10) #2
  br label %11

11:                                               ; preds = %10, %6
  %12 = getelementptr inbounds i8, ptr %0, i64 296
  %13 = load i32, ptr %12, align 8, !tbaa !18
  %.not53 = icmp eq i32 %13, 0
  br i1 %.not53, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %11
  %14 = getelementptr inbounds i8, ptr %0, i64 288
  br label %19

15:                                               ; preds = %19
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = load i32, ptr %12, align 8, !tbaa !18
  %17 = zext i32 %16 to i64
  %18 = icmp ult i64 %indvars.iv.next, %17
  br i1 %18, label %19, label %._crit_edge, !llvm.loop !19

19:                                               ; preds = %.lr.ph, %15
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %15 ]
  %20 = load ptr, ptr %14, align 8, !tbaa !21
  %21 = getelementptr inbounds %struct.EFI_IPv6_ADDRESS, ptr %20, i64 %indvars.iv
  %22 = tail call i64 @CompareMem(ptr noundef %21, ptr noundef %2, i64 noundef 16) #2
  %23 = icmp eq i64 %22, 0
  br i1 %23, label %.loopexit, label %15

._crit_edge:                                      ; preds = %15, %11
  %24 = getelementptr inbounds i8, ptr %0, i64 264
  %25 = load ptr, ptr %24, align 8, !tbaa !22
  %26 = tail call i64 @Ip6JoinGroup(ptr noundef %5, ptr noundef %25, ptr noundef %2)
  %27 = icmp slt i64 %26, 0
  br i1 %27, label %.loopexit, label %28

28:                                               ; preds = %._crit_edge
  %29 = tail call i64 @Ip6CombineGroups(ptr noundef nonnull %0, ptr noundef %2)
  br label %.loopexit

30:                                               ; preds = %3
  %31 = getelementptr inbounds i8, ptr %0, i64 296
  %32 = load i32, ptr %31, align 8, !tbaa !18
  %.not4348 = icmp eq i32 %32, 0
  br i1 %.not4348, label %._crit_edge52, label %.lr.ph51

.lr.ph51:                                         ; preds = %30
  %33 = getelementptr inbounds i8, ptr %0, i64 288
  %34 = icmp eq ptr %2, null
  %35 = zext i32 %32 to i64
  br i1 %34, label %.lr.ph51.split.us, label %.lr.ph51.split

.lr.ph51.split.us:                                ; preds = %.lr.ph51, %53
  %indvars.iv64 = phi i64 [ %37, %53 ], [ %35, %.lr.ph51 ]
  %36 = load ptr, ptr %33, align 8, !tbaa !21
  %37 = add nsw i64 %indvars.iv64, -1
  %38 = getelementptr inbounds %struct.EFI_IPv6_ADDRESS, ptr %36, i64 %37
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = tail call i64 @Ip6LeaveGroup(ptr noundef %39, ptr noundef %38)
  %41 = icmp slt i64 %40, 0
  br i1 %41, label %.loopexit, label %42

42:                                               ; preds = %.lr.ph51.split.us
  %43 = tail call i64 @Ip6RemoveGroup(ptr noundef nonnull %0, ptr noundef %38)
  %44 = load i32, ptr %31, align 8, !tbaa !18
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %46, label %53

46:                                               ; preds = %42
  %47 = tail call zeroext i8 @DebugAssertEnabled() #2
  %48 = icmp eq i8 %47, 0
  %49 = icmp eq i64 %indvars.iv64, 1
  %or.cond3.us = or i1 %49, %48
  br i1 %or.cond3.us, label %51, label %50

50:                                               ; preds = %46
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 664, ptr noundef nonnull @.str.11) #2
  br label %51

51:                                               ; preds = %50, %46
  %52 = load ptr, ptr %33, align 8, !tbaa !21
  tail call void @FreePool(ptr noundef %52) #2
  store ptr null, ptr %33, align 8, !tbaa !21
  br label %53

53:                                               ; preds = %51, %42
  %.not43.us.wide = icmp eq i64 %37, 0
  br i1 %.not43.us.wide, label %._crit_edge52, label %.lr.ph51.split.us, !llvm.loop !23

.lr.ph51.split:                                   ; preds = %.lr.ph51, %74
  %indvars.iv61 = phi i64 [ %55, %74 ], [ %35, %.lr.ph51 ]
  %54 = load ptr, ptr %33, align 8, !tbaa !21
  %55 = add nsw i64 %indvars.iv61, -1
  %56 = getelementptr inbounds %struct.EFI_IPv6_ADDRESS, ptr %54, i64 %55
  %57 = tail call i64 @CompareMem(ptr noundef %56, ptr noundef nonnull %2, i64 noundef 16) #2
  %58 = icmp eq i64 %57, 0
  br i1 %58, label %59, label %74

59:                                               ; preds = %.lr.ph51.split
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = tail call i64 @Ip6LeaveGroup(ptr noundef %60, ptr noundef %56)
  %62 = icmp slt i64 %61, 0
  br i1 %62, label %.loopexit, label %63

63:                                               ; preds = %59
  %64 = tail call i64 @Ip6RemoveGroup(ptr noundef nonnull %0, ptr noundef %56)
  %65 = load i32, ptr %31, align 8, !tbaa !18
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %.loopexit

67:                                               ; preds = %63
  %68 = tail call zeroext i8 @DebugAssertEnabled() #2
  %69 = icmp eq i8 %68, 0
  %70 = icmp eq i64 %indvars.iv61, 1
  %or.cond3 = or i1 %70, %69
  br i1 %or.cond3, label %72, label %71

71:                                               ; preds = %67
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 664, ptr noundef nonnull @.str.11) #2
  br label %72

72:                                               ; preds = %71, %67
  %73 = load ptr, ptr %33, align 8, !tbaa !21
  tail call void @FreePool(ptr noundef %73) #2
  store ptr null, ptr %33, align 8, !tbaa !21
  br label %.loopexit

74:                                               ; preds = %.lr.ph51.split
  %.not43.wide = icmp eq i64 %55, 0
  br i1 %.not43.wide, label %._crit_edge52, label %.lr.ph51.split, !llvm.loop !23

._crit_edge52:                                    ; preds = %74, %53, %30
  %.not44 = icmp eq ptr %2, null
  %75 = select i1 %.not44, i64 0, i64 -9223372036854775794
  br label %.loopexit

.loopexit:                                        ; preds = %19, %.lr.ph51.split.us, %63, %72, %59, %._crit_edge, %._crit_edge52, %28
  %.0 = phi i64 [ %29, %28 ], [ %75, %._crit_edge52 ], [ %26, %._crit_edge ], [ %61, %59 ], [ 0, %72 ], [ 0, %63 ], [ %40, %.lr.ph51.split.us ], [ -9223372036854775788, %19 ]
  ret i64 %.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 96}
!6 = !{!"_IP6_PROTOCOL", !7, i64 0, !10, i64 8, !11, i64 80, !12, i64 88, !11, i64 96, !13, i64 104, !8, i64 120, !14, i64 128, !14, i64 168, !13, i64 208, !13, i64 224, !15, i64 240, !11, i64 264, !13, i64 272, !11, i64 288, !7, i64 296, !16, i64 300, !8, i64 352}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_EFI_IP6_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"long long", !8, i64 0}
!13 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!14 = !{!"", !13, i64 0, !13, i64 16, !12, i64 32}
!15 = !{!"", !12, i64 0, !12, i64 8, !7, i64 16}
!16 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !17, i64 4, !17, i64 20, !8, i64 36, !8, i64 37, !7, i64 40, !7, i64 44, !7, i64 48}
!17 = !{!"", !8, i64 0}
!18 = !{!6, !7, i64 296}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!6, !11, i64 288}
!22 = !{!6, !11, i64 264}
!23 = distinct !{!23, !20}


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