; LLVM IR from clibraries/array-algorithms :: test (tests)

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

@.str.1 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.103 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__.test_partial_sort_copy = external hidden unnamed_addr constant [30 x i8], align 1
@.str.104 = external hidden unnamed_addr constant [15 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 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

; Function Attrs: nounwind uwtable
declare hidden i32 @compare_int(ptr noundef, ptr noundef, ptr noundef) #2

declare void @intv_random_shuffle(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @test_partial_sort_copy() #2 {
  %1 = alloca [100 x i32], align 16
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [10 x i32], align 16
  %6 = alloca i32, align 4
  %7 = alloca [10 x i32], align 16
  %8 = alloca i32, align 4
  %9 = alloca [100 x i32], align 16
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 400, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %21, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp slt i32 %13, 100
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %24

16:                                               ; preds = %12
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [100 x i32], ptr %1, i64 0, i64 %19
  store i32 %17, ptr %20, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %16
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !9

24:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %58, %24
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = icmp slt i32 %26, 1000
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %61

29:                                               ; preds = %25
  %30 = getelementptr inbounds [100 x i32], ptr %1, i64 0, i64 0
  %31 = getelementptr inbounds [100 x i32], ptr %1, i64 0, i64 0
  %32 = getelementptr inbounds i32, ptr %31, i64 100
  call void @intv_random_shuffle(ptr noundef %30, ptr noundef %32)
  call void @llvm.lifetime.start.p0(i64 40, ptr %5) #4
  %33 = getelementptr inbounds [100 x i32], ptr %1, i64 0, i64 0
  %34 = getelementptr inbounds [100 x i32], ptr %1, i64 0, i64 0
  %35 = getelementptr inbounds i32, ptr %34, i64 100
  %36 = getelementptr inbounds [10 x i32], ptr %5, i64 0, i64 0
  %37 = getelementptr inbounds [10 x i32], ptr %5, i64 0, i64 0
  %38 = getelementptr inbounds i32, ptr %37, i64 10
  %39 = call ptr @intv_partial_sort_copy(ptr noundef %33, ptr noundef %35, ptr noundef %36, ptr noundef %38, ptr noundef @compare_int, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %54, %29
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = icmp slt i32 %41, 10
  br i1 %42, label %44, label %43

43:                                               ; preds = %40
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %57

44:                                               ; preds = %40
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [10 x i32], ptr %5, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = icmp eq i32 %48, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %44
  br label %53

52:                                               ; preds = %44
  call void @__assert_fail(ptr noundef @.str.103, ptr noundef @.str.1, i32 noundef 627, ptr noundef @__PRETTY_FUNCTION__.test_partial_sort_copy) #5
  unreachable

53:                                               ; preds = %51
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %6, align 4, !tbaa !5
  br label %40, !llvm.loop !11

57:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 40, ptr %5) #4
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %3, align 4, !tbaa !5
  br label %25, !llvm.loop !12

61:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 400, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %71, %61
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = icmp slt i32 %63, 10
  br i1 %64, label %66, label %65

65:                                               ; preds = %62
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %74

66:                                               ; preds = %62
  %67 = load i32, ptr %8, align 4, !tbaa !5
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [10 x i32], ptr %7, i64 0, i64 %69
  store i32 %67, ptr %70, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %66
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %8, align 4, !tbaa !5
  br label %62, !llvm.loop !13

74:                                               ; preds = %65
  %75 = getelementptr inbounds [10 x i32], ptr %7, i64 0, i64 0
  %76 = getelementptr inbounds [10 x i32], ptr %7, i64 0, i64 0
  %77 = getelementptr inbounds i32, ptr %76, i64 10
  call void @intv_reverse(ptr noundef %75, ptr noundef %77)
  call void @llvm.lifetime.start.p0(i64 400, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %78 = getelementptr inbounds [10 x i32], ptr %7, i64 0, i64 0
  %79 = getelementptr inbounds [10 x i32], ptr %7, i64 0, i64 0
  %80 = getelementptr inbounds i32, ptr %79, i64 10
  %81 = getelementptr inbounds [100 x i32], ptr %9, i64 0, i64 0
  %82 = getelementptr inbounds [100 x i32], ptr %9, i64 0, i64 0
  %83 = getelementptr inbounds i32, ptr %82, i64 100
  %84 = call ptr @intv_partial_sort_copy(ptr noundef %78, ptr noundef %80, ptr noundef %81, ptr noundef %83, ptr noundef @compare_int, ptr noundef null)
  store ptr %84, ptr %10, align 8, !tbaa !14
  %85 = load ptr, ptr %10, align 8, !tbaa !14
  %86 = getelementptr inbounds [100 x i32], ptr %9, i64 0, i64 0
  %87 = getelementptr inbounds i32, ptr %86, i64 10
  %88 = icmp eq ptr %85, %87
  br i1 %88, label %89, label %90

89:                                               ; preds = %74
  br label %91

90:                                               ; preds = %74
  call void @__assert_fail(ptr noundef @.str.104, ptr noundef @.str.1, i32 noundef 643, ptr noundef @__PRETTY_FUNCTION__.test_partial_sort_copy) #5
  unreachable

91:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %106, %91
  %93 = load i32, ptr %11, align 4, !tbaa !5
  %94 = icmp slt i32 %93, 10
  br i1 %94, label %96, label %95

95:                                               ; preds = %92
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %109

96:                                               ; preds = %92
  %97 = load i32, ptr %11, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [100 x i32], ptr %9, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = load i32, ptr %11, align 4, !tbaa !5
  %102 = icmp eq i32 %100, %101
  br i1 %102, label %103, label %104

103:                                              ; preds = %96
  br label %105

104:                                              ; preds = %96
  call void @__assert_fail(ptr noundef @.str.103, ptr noundef @.str.1, i32 noundef 646, ptr noundef @__PRETTY_FUNCTION__.test_partial_sort_copy) #5
  unreachable

105:                                              ; preds = %103
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %11, align 4, !tbaa !5
  br label %92, !llvm.loop !16

109:                                              ; preds = %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 400, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #4
  ret void
}

declare ptr @intv_partial_sort_copy(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare void @intv_reverse(ptr noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "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 = { "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 #4 = { nounwind }
attributes #5 = { noreturn 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = distinct !{!16, !10}


; 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.1 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.103 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__.test_partial_sort_copy = external hidden unnamed_addr constant [30 x i8], align 1
@.str.104 = external hidden unnamed_addr constant [15 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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 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

; Function Attrs: nounwind uwtable
declare hidden i32 @compare_int(ptr noundef, ptr noundef, ptr noundef) #2

declare void @intv_random_shuffle(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @test_partial_sort_copy() local_unnamed_addr #2 {
vector.ph:
  %0 = alloca [100 x i32], align 16
  %1 = alloca [10 x i32], align 16
  %2 = alloca [10 x i32], align 16
  %3 = alloca [100 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %0) #4
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, ptr %0, align 16, !tbaa !5
  store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, ptr %4, align 16, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  %6 = getelementptr inbounds i8, ptr %0, i64 48
  store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, ptr %5, align 16, !tbaa !5
  store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, ptr %6, align 16, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 64
  %8 = getelementptr inbounds i8, ptr %0, i64 80
  store <4 x i32> <i32 16, i32 17, i32 18, i32 19>, ptr %7, align 16, !tbaa !5
  store <4 x i32> <i32 20, i32 21, i32 22, i32 23>, ptr %8, align 16, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 96
  %10 = getelementptr inbounds i8, ptr %0, i64 112
  store <4 x i32> <i32 24, i32 25, i32 26, i32 27>, ptr %9, align 16, !tbaa !5
  store <4 x i32> <i32 28, i32 29, i32 30, i32 31>, ptr %10, align 16, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 128
  %12 = getelementptr inbounds i8, ptr %0, i64 144
  store <4 x i32> <i32 32, i32 33, i32 34, i32 35>, ptr %11, align 16, !tbaa !5
  store <4 x i32> <i32 36, i32 37, i32 38, i32 39>, ptr %12, align 16, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 160
  %14 = getelementptr inbounds i8, ptr %0, i64 176
  store <4 x i32> <i32 40, i32 41, i32 42, i32 43>, ptr %13, align 16, !tbaa !5
  store <4 x i32> <i32 44, i32 45, i32 46, i32 47>, ptr %14, align 16, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 192
  %16 = getelementptr inbounds i8, ptr %0, i64 208
  store <4 x i32> <i32 48, i32 49, i32 50, i32 51>, ptr %15, align 16, !tbaa !5
  store <4 x i32> <i32 52, i32 53, i32 54, i32 55>, ptr %16, align 16, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %0, i64 224
  %18 = getelementptr inbounds i8, ptr %0, i64 240
  store <4 x i32> <i32 56, i32 57, i32 58, i32 59>, ptr %17, align 16, !tbaa !5
  store <4 x i32> <i32 60, i32 61, i32 62, i32 63>, ptr %18, align 16, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %0, i64 256
  %20 = getelementptr inbounds i8, ptr %0, i64 272
  store <4 x i32> <i32 64, i32 65, i32 66, i32 67>, ptr %19, align 16, !tbaa !5
  store <4 x i32> <i32 68, i32 69, i32 70, i32 71>, ptr %20, align 16, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %0, i64 288
  %22 = getelementptr inbounds i8, ptr %0, i64 304
  store <4 x i32> <i32 72, i32 73, i32 74, i32 75>, ptr %21, align 16, !tbaa !5
  store <4 x i32> <i32 76, i32 77, i32 78, i32 79>, ptr %22, align 16, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %0, i64 320
  %24 = getelementptr inbounds i8, ptr %0, i64 336
  store <4 x i32> <i32 80, i32 81, i32 82, i32 83>, ptr %23, align 16, !tbaa !5
  store <4 x i32> <i32 84, i32 85, i32 86, i32 87>, ptr %24, align 16, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %0, i64 352
  %26 = getelementptr inbounds i8, ptr %0, i64 368
  store <4 x i32> <i32 88, i32 89, i32 90, i32 91>, ptr %25, align 16, !tbaa !5
  store <4 x i32> <i32 92, i32 93, i32 94, i32 95>, ptr %26, align 16, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %0, i64 384
  store i32 96, ptr %27, align 16, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %0, i64 388
  store i32 97, ptr %28, align 4, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %0, i64 392
  store i32 98, ptr %29, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %0, i64 396
  store i32 99, ptr %30, align 4, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %0, i64 400
  %32 = getelementptr inbounds i8, ptr %1, i64 40
  %33 = getelementptr inbounds i8, ptr %1, i64 32
  %34 = getelementptr inbounds i8, ptr %1, i64 36
  br label %44

35:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %0) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %2) #4
  store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, ptr %2, align 16, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %2, i64 16
  store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, ptr %36, align 16, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %2, i64 32
  store i32 8, ptr %37, align 16, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %2, i64 36
  store i32 9, ptr %38, align 4, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %2, i64 40
  call void @intv_reverse(ptr noundef nonnull %2, ptr noundef nonnull %39) #4
  call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %3) #4
  %40 = getelementptr inbounds i8, ptr %3, i64 400
  %41 = call ptr @intv_partial_sort_copy(ptr noundef nonnull %2, ptr noundef nonnull %39, ptr noundef nonnull %3, ptr noundef nonnull %40, ptr noundef nonnull @compare_int, ptr noundef null) #4
  %42 = getelementptr inbounds i8, ptr %3, i64 40
  %43 = icmp eq ptr %41, %42
  br i1 %43, label %.preheader.preheader, label %67

44:                                               ; preds = %vector.ph, %54
  %.02125 = phi i32 [ 0, %vector.ph ], [ %55, %54 ]
  call void @intv_random_shuffle(ptr noundef nonnull %0, ptr noundef nonnull %31) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %1) #4
  %45 = call ptr @intv_partial_sort_copy(ptr noundef nonnull %0, ptr noundef nonnull %31, ptr noundef nonnull %1, ptr noundef nonnull %32, ptr noundef nonnull @compare_int, ptr noundef null) #4
  %46 = load <8 x i32>, ptr %1, align 16
  %.fr = freeze <8 x i32> %46
  %47 = load i32, ptr %33, align 16
  %.fr91 = freeze i32 %47
  %48 = icmp eq i32 %.fr91, 8
  %49 = load i32, ptr %34, align 4
  %50 = icmp eq i32 %49, 9
  %51 = icmp ne <8 x i32> %.fr, <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
  %52 = bitcast <8 x i1> %51 to i8
  %53 = icmp eq i8 %52, 0
  %op.rdx88 = and i1 %53, %48
  %op.rdx89 = select i1 %op.rdx88, i1 %50, i1 false
  br i1 %op.rdx89, label %54, label %56

54:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %1) #4
  %55 = add nuw nsw i32 %.02125, 1
  %exitcond33.not = icmp eq i32 %55, 1000
  br i1 %exitcond33.not, label %35, label %44, !llvm.loop !9

56:                                               ; preds = %44
  call void @__assert_fail(ptr noundef nonnull @.str.103, ptr noundef nonnull @.str.1, i32 noundef 627, ptr noundef nonnull @__PRETTY_FUNCTION__.test_partial_sort_copy) #5
  unreachable

.preheader.preheader:                             ; preds = %35
  %57 = load <8 x i32>, ptr %3, align 16
  %.fr92 = freeze <8 x i32> %57
  %58 = getelementptr inbounds i8, ptr %3, i64 32
  %59 = load i32, ptr %58, align 16
  %.fr94 = freeze i32 %59
  %60 = icmp eq i32 %.fr94, 8
  %61 = getelementptr inbounds i8, ptr %3, i64 36
  %62 = load i32, ptr %61, align 4
  %63 = icmp eq i32 %62, 9
  %64 = icmp ne <8 x i32> %.fr92, <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
  %65 = bitcast <8 x i1> %64 to i8
  %66 = icmp eq i8 %65, 0
  %op.rdx = and i1 %66, %60
  %op.rdx87 = select i1 %op.rdx, i1 %63, i1 false
  br i1 %op.rdx87, label %68, label %69

67:                                               ; preds = %35
  call void @__assert_fail(ptr noundef nonnull @.str.104, ptr noundef nonnull @.str.1, i32 noundef 643, ptr noundef nonnull @__PRETTY_FUNCTION__.test_partial_sort_copy) #5
  unreachable

68:                                               ; preds = %.preheader.preheader
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #4
  ret void

69:                                               ; preds = %.preheader.preheader
  call void @__assert_fail(ptr noundef nonnull @.str.103, ptr noundef nonnull @.str.1, i32 noundef 646, ptr noundef nonnull @__PRETTY_FUNCTION__.test_partial_sort_copy) #5
  unreachable
}

declare ptr @intv_partial_sort_copy(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @intv_reverse(ptr noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "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 = { "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 #4 = { nounwind }
attributes #5 = { noreturn 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass