; 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
@__const.test_heap.nums = external hidden unnamed_addr constant [10 x i32], align 16
@.str.96 = external hidden unnamed_addr constant [53 x i8], align 1
@__PRETTY_FUNCTION__.test_heap = external hidden unnamed_addr constant [17 x i8], align 1
@.str.97 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.98 = external hidden unnamed_addr constant [52 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; 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) #3

; Function Attrs: nounwind uwtable
declare hidden void @print_array(ptr noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @test_heap() #3 {
  %1 = alloca [10 x i32], align 16
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 40, ptr %1) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %1, ptr align 16 @__const.test_heap.nums, i64 40, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 10, ptr %2, align 4, !tbaa !5
  %5 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %6 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = getelementptr inbounds i32, ptr %6, i64 %8
  %10 = call i32 @intv_is_heap(ptr noundef %5, ptr noundef %9, ptr noundef @compare_int, ptr noundef null)
  %11 = icmp ne i32 %10, 0
  br i1 %11, label %13, label %12

12:                                               ; preds = %0
  br label %14

13:                                               ; preds = %0
  call void @__assert_fail(ptr noundef @.str.96, ptr noundef @.str.1, i32 noundef 531, ptr noundef @__PRETTY_FUNCTION__.test_heap) #6
  unreachable

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

15:                                               ; preds = %36, %14
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = icmp sle i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %39

20:                                               ; preds = %15
  %21 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  call void @intv_push_heap_n(ptr noundef %21, i64 noundef %23, ptr noundef @compare_int, ptr noundef null)
  %24 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %25 = load i32, ptr %3, align 4, !tbaa !5
  call void @print_array(ptr noundef %24, i32 noundef %25)
  %26 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %27 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds i32, ptr %27, i64 %29
  %31 = call i32 @intv_is_heap(ptr noundef %26, ptr noundef %30, ptr noundef @compare_int, ptr noundef null)
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %20
  br label %35

34:                                               ; preds = %20
  call void @__assert_fail(ptr noundef @.str.97, ptr noundef @.str.1, i32 noundef 536, ptr noundef @__PRETTY_FUNCTION__.test_heap) #6
  unreachable

35:                                               ; preds = %33
  br label %36

36:                                               ; preds = %35
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %3, align 4, !tbaa !5
  br label %15, !llvm.loop !9

39:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %40 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %40, ptr %4, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %56, %39
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %44, label %64

44:                                               ; preds = %41
  %45 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %46 = load i32, ptr %4, align 4, !tbaa !5
  call void @print_array(ptr noundef %45, i32 noundef %46)
  %47 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %48 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr %48, i64 %50
  %52 = call i32 @intv_is_heap(ptr noundef %47, ptr noundef %51, ptr noundef @compare_int, ptr noundef null)
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %44
  br label %56

55:                                               ; preds = %44
  call void @__assert_fail(ptr noundef @.str.97, ptr noundef @.str.1, i32 noundef 542, ptr noundef @__PRETTY_FUNCTION__.test_heap) #6
  unreachable

56:                                               ; preds = %54
  %57 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %58 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i32, ptr %58, i64 %60
  call void @intv_pop_heap(ptr noundef %57, ptr noundef %61, ptr noundef @compare_int, ptr noundef null)
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = add nsw i32 %62, -1
  store i32 %63, ptr %4, align 4, !tbaa !5
  br label %41, !llvm.loop !11

64:                                               ; preds = %41
  %65 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %66 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds i32, ptr %66, i64 %68
  call void @intv_make_heap(ptr noundef %65, ptr noundef %69, ptr noundef @compare_int, ptr noundef null)
  %70 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %71 = load i32, ptr %2, align 4, !tbaa !5
  call void @print_array(ptr noundef %70, i32 noundef %71)
  %72 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %73 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %74 = load i32, ptr %2, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i32, ptr %73, i64 %75
  %77 = call i32 @intv_is_heap(ptr noundef %72, ptr noundef %76, ptr noundef @compare_int, ptr noundef null)
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %80

79:                                               ; preds = %64
  br label %81

80:                                               ; preds = %64
  call void @__assert_fail(ptr noundef @.str.98, ptr noundef @.str.1, i32 noundef 549, ptr noundef @__PRETTY_FUNCTION__.test_heap) #6
  unreachable

81:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %1) #5
  ret void
}

declare i32 @intv_is_heap(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare void @intv_push_heap_n(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #4

declare void @intv_pop_heap(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare void @intv_make_heap(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { "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 #5 = { nounwind }
attributes #6 = { 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}


; 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
@__const.test_heap.nums = external hidden unnamed_addr constant [10 x i32], align 16
@.str.96 = external hidden unnamed_addr constant [53 x i8], align 1
@__PRETTY_FUNCTION__.test_heap = external hidden unnamed_addr constant [17 x i8], align 1
@.str.97 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.98 = external hidden unnamed_addr constant [52 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; 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) #3

; Function Attrs: nounwind uwtable
declare hidden void @print_array(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @test_heap() local_unnamed_addr #3 {
  %1 = alloca [10 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %1) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %1, ptr noundef nonnull align 16 dereferenceable(40) @__const.test_heap.nums, i64 40, i1 false)
  %2 = getelementptr inbounds i8, ptr %1, i64 40
  %3 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %.preheader20.preheader, label %6

.preheader20.preheader:                           ; preds = %0
  call void @intv_push_heap_n(ptr noundef nonnull %1, i64 noundef 2, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 2)
  %4 = getelementptr inbounds i8, ptr %1, i64 8
  %5 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %4, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not19 = icmp eq i32 %5, 0
  br i1 %.not19, label %23, label %.preheader20.1

6:                                                ; preds = %0
  call void @__assert_fail(ptr noundef nonnull @.str.96, ptr noundef nonnull @.str.1, i32 noundef 531, ptr noundef nonnull @__PRETTY_FUNCTION__.test_heap) #6
  unreachable

.preheader20.1:                                   ; preds = %.preheader20.preheader
  call void @intv_push_heap_n(ptr noundef nonnull %1, i64 noundef 3, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 3)
  %7 = getelementptr inbounds i8, ptr %1, i64 12
  %8 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %7, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not19.1 = icmp eq i32 %8, 0
  br i1 %.not19.1, label %23, label %.preheader20.2

.preheader20.2:                                   ; preds = %.preheader20.1
  call void @intv_push_heap_n(ptr noundef nonnull %1, i64 noundef 4, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 4)
  %9 = getelementptr inbounds i8, ptr %1, i64 16
  %10 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %9, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not19.2 = icmp eq i32 %10, 0
  br i1 %.not19.2, label %23, label %.preheader20.3

.preheader20.3:                                   ; preds = %.preheader20.2
  call void @intv_push_heap_n(ptr noundef nonnull %1, i64 noundef 5, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 5)
  %11 = getelementptr inbounds i8, ptr %1, i64 20
  %12 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %11, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not19.3 = icmp eq i32 %12, 0
  br i1 %.not19.3, label %23, label %.preheader20.4

.preheader20.4:                                   ; preds = %.preheader20.3
  call void @intv_push_heap_n(ptr noundef nonnull %1, i64 noundef 6, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 6)
  %13 = getelementptr inbounds i8, ptr %1, i64 24
  %14 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %13, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not19.4 = icmp eq i32 %14, 0
  br i1 %.not19.4, label %23, label %.preheader20.5

.preheader20.5:                                   ; preds = %.preheader20.4
  call void @intv_push_heap_n(ptr noundef nonnull %1, i64 noundef 7, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 7)
  %15 = getelementptr inbounds i8, ptr %1, i64 28
  %16 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %15, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not19.5 = icmp eq i32 %16, 0
  br i1 %.not19.5, label %23, label %.preheader20.6

.preheader20.6:                                   ; preds = %.preheader20.5
  call void @intv_push_heap_n(ptr noundef nonnull %1, i64 noundef 8, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 8)
  %17 = getelementptr inbounds i8, ptr %1, i64 32
  %18 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %17, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not19.6 = icmp eq i32 %18, 0
  br i1 %.not19.6, label %23, label %.preheader20.7

.preheader20.7:                                   ; preds = %.preheader20.6
  call void @intv_push_heap_n(ptr noundef nonnull %1, i64 noundef 9, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 9)
  %19 = getelementptr inbounds i8, ptr %1, i64 36
  %20 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %19, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not19.7 = icmp eq i32 %20, 0
  br i1 %.not19.7, label %23, label %.preheader20.8

.preheader20.8:                                   ; preds = %.preheader20.7
  call void @intv_push_heap_n(ptr noundef nonnull %1, i64 noundef 10, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 10)
  %21 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not19.8 = icmp eq i32 %21, 0
  br i1 %.not19.8, label %23, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader20.8
  call void @print_array(ptr noundef nonnull %1, i32 noundef 10)
  %22 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not18 = icmp eq i32 %22, 0
  br i1 %.not18, label %24, label %.preheader.1

23:                                               ; preds = %.preheader20.8, %.preheader20.7, %.preheader20.6, %.preheader20.5, %.preheader20.4, %.preheader20.3, %.preheader20.2, %.preheader20.1, %.preheader20.preheader
  call void @__assert_fail(ptr noundef nonnull @.str.97, ptr noundef nonnull @.str.1, i32 noundef 536, ptr noundef nonnull @__PRETTY_FUNCTION__.test_heap) #6
  unreachable

24:                                               ; preds = %.preheader.9, %.preheader.8, %.preheader.7, %.preheader.6, %.preheader.5, %.preheader.4, %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  call void @__assert_fail(ptr noundef nonnull @.str.97, ptr noundef nonnull @.str.1, i32 noundef 542, ptr noundef nonnull @__PRETTY_FUNCTION__.test_heap) #6
  unreachable

.preheader.1:                                     ; preds = %.preheader.preheader
  call void @intv_pop_heap(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 9)
  %25 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %19, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not18.1 = icmp eq i32 %25, 0
  br i1 %.not18.1, label %24, label %.preheader.2

.preheader.2:                                     ; preds = %.preheader.1
  call void @intv_pop_heap(ptr noundef nonnull %1, ptr noundef nonnull %19, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 8)
  %26 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %17, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not18.2 = icmp eq i32 %26, 0
  br i1 %.not18.2, label %24, label %.preheader.3

.preheader.3:                                     ; preds = %.preheader.2
  call void @intv_pop_heap(ptr noundef nonnull %1, ptr noundef nonnull %17, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 7)
  %27 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %15, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not18.3 = icmp eq i32 %27, 0
  br i1 %.not18.3, label %24, label %.preheader.4

.preheader.4:                                     ; preds = %.preheader.3
  call void @intv_pop_heap(ptr noundef nonnull %1, ptr noundef nonnull %15, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 6)
  %28 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %13, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not18.4 = icmp eq i32 %28, 0
  br i1 %.not18.4, label %24, label %.preheader.5

.preheader.5:                                     ; preds = %.preheader.4
  call void @intv_pop_heap(ptr noundef nonnull %1, ptr noundef nonnull %13, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 5)
  %29 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %11, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not18.5 = icmp eq i32 %29, 0
  br i1 %.not18.5, label %24, label %.preheader.6

.preheader.6:                                     ; preds = %.preheader.5
  call void @intv_pop_heap(ptr noundef nonnull %1, ptr noundef nonnull %11, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 4)
  %30 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %9, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not18.6 = icmp eq i32 %30, 0
  br i1 %.not18.6, label %24, label %.preheader.7

.preheader.7:                                     ; preds = %.preheader.6
  call void @intv_pop_heap(ptr noundef nonnull %1, ptr noundef nonnull %9, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 3)
  %31 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %7, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not18.7 = icmp eq i32 %31, 0
  br i1 %.not18.7, label %24, label %.preheader.8

.preheader.8:                                     ; preds = %.preheader.7
  call void @intv_pop_heap(ptr noundef nonnull %1, ptr noundef nonnull %7, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 2)
  %32 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %4, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not18.8 = icmp eq i32 %32, 0
  br i1 %.not18.8, label %24, label %.preheader.9

.preheader.9:                                     ; preds = %.preheader.8
  call void @intv_pop_heap(ptr noundef nonnull %1, ptr noundef nonnull %4, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 1)
  %33 = getelementptr inbounds i8, ptr %1, i64 4
  %34 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %33, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not18.9 = icmp eq i32 %34, 0
  br i1 %.not18.9, label %24, label %35

35:                                               ; preds = %.preheader.9
  call void @intv_pop_heap(ptr noundef nonnull %1, ptr noundef nonnull %33, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @intv_make_heap(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull @compare_int, ptr noundef null) #5
  call void @print_array(ptr noundef nonnull %1, i32 noundef 10)
  %36 = call i32 @intv_is_heap(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull @compare_int, ptr noundef null) #5
  %.not17 = icmp eq i32 %36, 0
  br i1 %.not17, label %37, label %38

37:                                               ; preds = %35
  call void @__assert_fail(ptr noundef nonnull @.str.98, ptr noundef nonnull @.str.1, i32 noundef 549, ptr noundef nonnull @__PRETTY_FUNCTION__.test_heap) #6
  unreachable

38:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %1) #5
  ret void
}

declare i32 @intv_is_heap(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @intv_push_heap_n(ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @intv_pop_heap(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @intv_make_heap(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { "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 #5 = { nounwind }
attributes #6 = { 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)"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass