; LLVM IR from robotics-upo/Heuristic_path_planners :: include/voro++-0.4.6/src/cell.ll (ZN4voro16voronoicell_base16plane_intersectsEdddd)

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

%"class.voro::voronoicell_base" = type { ptr, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, double, double, double, double }

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4voro16voronoicell_base16plane_intersectsEdddd(ptr noundef nonnull align 8 dereferenceable(160) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4) #2 align 2 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store double %1, ptr %8, align 8, !tbaa !9
  store double %2, ptr %9, align 8, !tbaa !9
  store double %3, ptr %10, align 8, !tbaa !9
  store double %4, ptr %11, align 8, !tbaa !9
  %14 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %15 = load double, ptr %8, align 8, !tbaa !9
  %16 = getelementptr inbounds %"class.voro::voronoicell_base", ptr %14, i32 0, i32 9
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %18 = getelementptr inbounds %"class.voro::voronoicell_base", ptr %14, i32 0, i32 6
  %19 = load i32, ptr %18, align 4, !tbaa !14
  %20 = mul nsw i32 3, %19
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds double, ptr %17, i64 %21
  %23 = load double, ptr %22, align 8, !tbaa !9
  %24 = load double, ptr %9, align 8, !tbaa !9
  %25 = getelementptr inbounds %"class.voro::voronoicell_base", ptr %14, i32 0, i32 9
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  %27 = getelementptr inbounds %"class.voro::voronoicell_base", ptr %14, i32 0, i32 6
  %28 = load i32, ptr %27, align 4, !tbaa !14
  %29 = mul nsw i32 3, %28
  %30 = add nsw i32 %29, 1
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds double, ptr %26, i64 %31
  %33 = load double, ptr %32, align 8, !tbaa !9
  %34 = fmul double %24, %33
  %35 = call double @llvm.fmuladd.f64(double %15, double %23, double %34)
  %36 = load double, ptr %10, align 8, !tbaa !9
  %37 = getelementptr inbounds %"class.voro::voronoicell_base", ptr %14, i32 0, i32 9
  %38 = load ptr, ptr %37, align 8, !tbaa !11
  %39 = getelementptr inbounds %"class.voro::voronoicell_base", ptr %14, i32 0, i32 6
  %40 = load i32, ptr %39, align 4, !tbaa !14
  %41 = mul nsw i32 3, %40
  %42 = add nsw i32 %41, 2
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds double, ptr %38, i64 %43
  %45 = load double, ptr %44, align 8, !tbaa !9
  %46 = call double @llvm.fmuladd.f64(double %36, double %45, double %35)
  store double %46, ptr %12, align 8, !tbaa !9
  %47 = load double, ptr %12, align 8, !tbaa !9
  %48 = load double, ptr %11, align 8, !tbaa !9
  %49 = fcmp olt double %47, %48
  br i1 %49, label %50, label %57

50:                                               ; preds = %5
  %51 = load double, ptr %8, align 8, !tbaa !9
  %52 = load double, ptr %9, align 8, !tbaa !9
  %53 = load double, ptr %10, align 8, !tbaa !9
  %54 = load double, ptr %11, align 8, !tbaa !9
  %55 = load double, ptr %12, align 8, !tbaa !9
  %56 = call noundef zeroext i1 @_ZN4voro16voronoicell_base22plane_intersects_trackEddddd(ptr noundef nonnull align 8 dereferenceable(160) %14, double noundef %51, double noundef %52, double noundef %53, double noundef %54, double noundef %55)
  store i1 %56, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %58

57:                                               ; preds = %5
  store i1 true, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %58

58:                                               ; preds = %57, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %59 = load i1, ptr %6, align 1
  ret i1 %59
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4voro16voronoicell_base22plane_intersects_trackEddddd(ptr noundef nonnull align 8 dereferenceable(160), double noundef, double noundef, double noundef, double noundef, double noundef) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress 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 = { inlinehint 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !6, i64 48}
!12 = !{!"_ZTSN4voro16voronoicell_baseE", !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !13, i64 112, !13, i64 116, !6, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !13, i64 28}


; 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 nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZN4voro16voronoicell_base16plane_intersectsEdddd(ptr noundef nonnull align 8 dereferenceable(160) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4) local_unnamed_addr #1 align 2 {
  %6 = getelementptr inbounds i8, ptr %0, i64 48
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 28
  %9 = load i32, ptr %8, align 4, !tbaa !12
  %10 = mul nsw i32 %9, 3
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds double, ptr %7, i64 %11
  %13 = load double, ptr %12, align 8, !tbaa !13
  %14 = getelementptr i8, ptr %12, i64 8
  %15 = load double, ptr %14, align 8, !tbaa !13
  %16 = fmul double %15, %2
  %17 = tail call double @llvm.fmuladd.f64(double %1, double %13, double %16)
  %18 = getelementptr i8, ptr %12, i64 16
  %19 = load double, ptr %18, align 8, !tbaa !13
  %20 = tail call double @llvm.fmuladd.f64(double %3, double %19, double %17)
  %21 = fcmp olt double %20, %4
  br i1 %21, label %22, label %24

22:                                               ; preds = %5
  %23 = tail call noundef zeroext i1 @_ZN4voro16voronoicell_base22plane_intersects_trackEddddd(ptr noundef nonnull align 8 dereferenceable(160) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %20)
  br label %24

24:                                               ; preds = %5, %22
  %.0 = phi i1 [ %23, %22 ], [ true, %5 ]
  ret i1 %.0
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4voro16voronoicell_base22plane_intersects_trackEddddd(ptr noundef nonnull align 8 dereferenceable(160), double noundef, double noundef, double noundef, double noundef, double noundef) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { inlinehint 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, !10, i64 48}
!6 = !{!"_ZTSN4voro16voronoicell_baseE", !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !7, i64 112, !7, i64 116, !10, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!6, !7, i64 28}
!13 = !{!11, !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass