; LLVM IR from jjimenezg93/star-control2 :: src/math.ll (Z12RectsOverlapdddddddd)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z12ValueInRangeddd(double noundef, double noundef, double noundef) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z12RectsOverlapdddddddd(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, double noundef %7) #0 {
  %9 = alloca i1, align 1
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  store double %0, ptr %10, align 8, !tbaa !5
  store double %1, ptr %11, align 8, !tbaa !5
  store double %2, ptr %12, align 8, !tbaa !5
  store double %3, ptr %13, align 8, !tbaa !5
  store double %4, ptr %14, align 8, !tbaa !5
  store double %5, ptr %15, align 8, !tbaa !5
  store double %6, ptr %16, align 8, !tbaa !5
  store double %7, ptr %17, align 8, !tbaa !5
  %18 = load double, ptr %10, align 8, !tbaa !5
  %19 = load double, ptr %14, align 8, !tbaa !5
  %20 = load double, ptr %14, align 8, !tbaa !5
  %21 = load double, ptr %16, align 8, !tbaa !5
  %22 = fadd double %20, %21
  %23 = call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %18, double noundef %19, double noundef %22)
  br i1 %23, label %33, label %24

24:                                               ; preds = %8
  %25 = load double, ptr %10, align 8, !tbaa !5
  %26 = load double, ptr %12, align 8, !tbaa !5
  %27 = fadd double %25, %26
  %28 = load double, ptr %14, align 8, !tbaa !5
  %29 = load double, ptr %14, align 8, !tbaa !5
  %30 = load double, ptr %16, align 8, !tbaa !5
  %31 = fadd double %29, %30
  %32 = call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %27, double noundef %28, double noundef %31)
  br i1 %32, label %33, label %51

33:                                               ; preds = %24, %8
  %34 = load double, ptr %11, align 8, !tbaa !5
  %35 = load double, ptr %15, align 8, !tbaa !5
  %36 = load double, ptr %15, align 8, !tbaa !5
  %37 = load double, ptr %17, align 8, !tbaa !5
  %38 = fadd double %36, %37
  %39 = call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %34, double noundef %35, double noundef %38)
  br i1 %39, label %49, label %40

40:                                               ; preds = %33
  %41 = load double, ptr %11, align 8, !tbaa !5
  %42 = load double, ptr %13, align 8, !tbaa !5
  %43 = fadd double %41, %42
  %44 = load double, ptr %15, align 8, !tbaa !5
  %45 = load double, ptr %15, align 8, !tbaa !5
  %46 = load double, ptr %17, align 8, !tbaa !5
  %47 = fadd double %45, %46
  %48 = call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %43, double noundef %44, double noundef %47)
  br i1 %48, label %49, label %50

49:                                               ; preds = %40, %33
  store i1 true, ptr %9, align 1
  br label %86

50:                                               ; preds = %40
  br label %51

51:                                               ; preds = %50, %24
  %52 = load double, ptr %14, align 8, !tbaa !5
  %53 = load double, ptr %10, align 8, !tbaa !5
  %54 = load double, ptr %10, align 8, !tbaa !5
  %55 = load double, ptr %12, align 8, !tbaa !5
  %56 = fadd double %54, %55
  %57 = call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %52, double noundef %53, double noundef %56)
  br i1 %57, label %67, label %58

58:                                               ; preds = %51
  %59 = load double, ptr %14, align 8, !tbaa !5
  %60 = load double, ptr %16, align 8, !tbaa !5
  %61 = fadd double %59, %60
  %62 = load double, ptr %10, align 8, !tbaa !5
  %63 = load double, ptr %10, align 8, !tbaa !5
  %64 = load double, ptr %12, align 8, !tbaa !5
  %65 = fadd double %63, %64
  %66 = call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %61, double noundef %62, double noundef %65)
  br i1 %66, label %67, label %85

67:                                               ; preds = %58, %51
  %68 = load double, ptr %15, align 8, !tbaa !5
  %69 = load double, ptr %11, align 8, !tbaa !5
  %70 = load double, ptr %11, align 8, !tbaa !5
  %71 = load double, ptr %13, align 8, !tbaa !5
  %72 = fadd double %70, %71
  %73 = call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %68, double noundef %69, double noundef %72)
  br i1 %73, label %83, label %74

74:                                               ; preds = %67
  %75 = load double, ptr %15, align 8, !tbaa !5
  %76 = load double, ptr %17, align 8, !tbaa !5
  %77 = fadd double %75, %76
  %78 = load double, ptr %11, align 8, !tbaa !5
  %79 = load double, ptr %11, align 8, !tbaa !5
  %80 = load double, ptr %13, align 8, !tbaa !5
  %81 = fadd double %79, %80
  %82 = call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %77, double noundef %78, double noundef %81)
  br i1 %82, label %83, label %84

83:                                               ; preds = %74, %67
  store i1 true, ptr %9, align 1
  br label %86

84:                                               ; preds = %74
  br label %85

85:                                               ; preds = %84, %58
  store i1 false, ptr %9, align 1
  br label %86

86:                                               ; preds = %85, %83, %49
  %87 = load i1, ptr %9, align 1
  ret i1 %87
}

attributes #0 = { 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" }

!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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z12ValueInRangeddd(double noundef, double noundef, double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z12RectsOverlapdddddddd(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, double noundef %7) local_unnamed_addr #0 {
  %9 = fadd double %4, %6
  %10 = tail call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %0, double noundef %4, double noundef %9)
  br i1 %10, label %14, label %11

11:                                               ; preds = %8
  %12 = fadd double %0, %2
  %13 = tail call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %12, double noundef %4, double noundef %9)
  br i1 %13, label %14, label %20

14:                                               ; preds = %11, %8
  %15 = fadd double %5, %7
  %16 = tail call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %1, double noundef %5, double noundef %15)
  br i1 %16, label %31, label %17

17:                                               ; preds = %14
  %18 = fadd double %1, %3
  %19 = tail call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %18, double noundef %5, double noundef %15)
  br i1 %19, label %31, label %._crit_edge

._crit_edge:                                      ; preds = %17
  %.pre = fadd double %0, %2
  br label %20

20:                                               ; preds = %._crit_edge, %11
  %.pre-phi = phi double [ %.pre, %._crit_edge ], [ %12, %11 ]
  %21 = tail call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %4, double noundef %0, double noundef %.pre-phi)
  br i1 %21, label %24, label %22

22:                                               ; preds = %20
  %23 = tail call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %9, double noundef %0, double noundef %.pre-phi)
  br i1 %23, label %24, label %30

24:                                               ; preds = %22, %20
  %25 = fadd double %1, %3
  %26 = tail call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %5, double noundef %1, double noundef %25)
  br i1 %26, label %31, label %27

27:                                               ; preds = %24
  %28 = fadd double %5, %7
  %29 = tail call noundef zeroext i1 @_Z12ValueInRangeddd(double noundef %28, double noundef %1, double noundef %25)
  br i1 %29, label %31, label %30

30:                                               ; preds = %27, %22
  br label %31

31:                                               ; preds = %24, %27, %14, %17, %30
  %.0 = phi i1 [ false, %30 ], [ true, %17 ], [ true, %14 ], [ true, %27 ], [ true, %24 ]
  ret i1 %.0
}

attributes #0 = { 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" }

!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,SROAPass,SimplifyCFGPass,TailCallElimPass