; LLVM IR from o0o0o0o0o0o0o/image-processing-from-scratch :: ImageMatting/Eigen/bench/analyze-blocking-sizes.ll (Z29is_number_of_subsets_feasiblemm)

; 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.25 = external hidden unnamed_addr constant [129 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._Z29is_number_of_subsets_feasiblemm = external hidden unnamed_addr constant [51 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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z29is_number_of_subsets_feasiblemm(i64 noundef %0, i64 noundef %1) #2 {
  %3 = alloca i1, align 1
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  store i64 %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !5
  %10 = load i64, ptr %4, align 8, !tbaa !5
  %11 = icmp ugt i64 %10, 0
  br i1 %11, label %12, label %19

12:                                               ; preds = %2
  %13 = load i64, ptr %5, align 8, !tbaa !5
  %14 = icmp ugt i64 %13, 0
  br i1 %14, label %15, label %19

15:                                               ; preds = %12
  %16 = load i64, ptr %5, align 8, !tbaa !5
  %17 = load i64, ptr %4, align 8, !tbaa !5
  %18 = icmp ule i64 %16, %17
  br label %19

19:                                               ; preds = %15, %12, %2
  %20 = phi i1 [ false, %12 ], [ false, %2 ], [ %18, %15 ]
  br i1 %20, label %21, label %22

21:                                               ; preds = %19
  br label %24

22:                                               ; preds = %19
  call void @__assert_fail(ptr noundef @.str.28, ptr noundef @.str.25, i32 noundef 449, ptr noundef @__PRETTY_FUNCTION__._Z29is_number_of_subsets_feasiblemm) #3
  unreachable

23:                                               ; No predecessors!
  br label %24

24:                                               ; preds = %23, %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store i64 1, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store i64 1, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store i64 0, ptr %8, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %46, %24
  %26 = load i64, ptr %8, align 8, !tbaa !5
  %27 = load i64, ptr %5, align 8, !tbaa !5
  %28 = icmp ult i64 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  store i32 2, ptr %9, align 4
  br label %49

30:                                               ; preds = %25
  %31 = load i64, ptr %4, align 8, !tbaa !5
  %32 = load i64, ptr %8, align 8, !tbaa !5
  %33 = sub i64 %31, %32
  %34 = load i64, ptr %6, align 8, !tbaa !5
  %35 = mul i64 %34, %33
  store i64 %35, ptr %6, align 8, !tbaa !5
  %36 = load i64, ptr %8, align 8, !tbaa !5
  %37 = add i64 %36, 1
  %38 = load i64, ptr %7, align 8, !tbaa !5
  %39 = mul i64 %38, %37
  store i64 %39, ptr %7, align 8, !tbaa !5
  %40 = load i64, ptr %6, align 8, !tbaa !5
  %41 = load i64, ptr %7, align 8, !tbaa !5
  %42 = mul i64 %41, 100
  %43 = icmp ugt i64 %40, %42
  br i1 %43, label %44, label %45

44:                                               ; preds = %30
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %49

45:                                               ; preds = %30
  br label %46

46:                                               ; preds = %45
  %47 = load i64, ptr %8, align 8, !tbaa !5
  %48 = add i64 %47, 1
  store i64 %48, ptr %8, align 8, !tbaa !5
  br label %25, !llvm.loop !9

49:                                               ; preds = %44, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %50 = load i32, ptr %9, align 4
  switch i32 %50, label %52 [
    i32 2, label %51
  ]

51:                                               ; preds = %49
  store i1 true, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %52

52:                                               ; preds = %51, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %53 = load i1, ptr %3, align 1
  ret i1 %53
}

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 = { mustprogress 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 = { noreturn nounwind }
attributes #4 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.25 = external hidden unnamed_addr constant [129 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._Z29is_number_of_subsets_feasiblemm = external hidden unnamed_addr constant [51 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z29is_number_of_subsets_feasiblemm(i64 noundef %0, i64 noundef %1) local_unnamed_addr #1 {
  %3 = add i64 %1, -1
  %.not = icmp ult i64 %3, %0
  br i1 %.not, label %.preheader, label %.critedge

.critedge:                                        ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.28, ptr noundef nonnull @.str.25, i32 noundef 449, ptr noundef nonnull @__PRETTY_FUNCTION__._Z29is_number_of_subsets_feasiblemm) #2
  unreachable

.preheader:                                       ; preds = %2, %4
  %.018 = phi i64 [ %6, %4 ], [ 1, %2 ]
  %.017 = phi i64 [ %8, %4 ], [ 1, %2 ]
  %.016 = phi i64 [ %7, %4 ], [ 0, %2 ]
  %exitcond = icmp eq i64 %.016, %1
  br i1 %exitcond, label %.critedge26, label %4

4:                                                ; preds = %.preheader
  %5 = sub i64 %0, %.016
  %6 = mul i64 %5, %.018
  %7 = add i64 %.016, 1
  %8 = mul i64 %7, %.017
  %9 = mul i64 %8, 100
  %10 = icmp ugt i64 %6, %9
  br i1 %10, label %.critedge26, label %.preheader, !llvm.loop !5

.critedge26:                                      ; preds = %.preheader, %4
  %.not23 = icmp uge i64 %.016, %1
  ret i1 %.not23
}

attributes #0 = { 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 #1 = { mustprogress 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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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