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

; 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: 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) #2 align 2

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

55:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 1, ptr %13, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %56 = getelementptr inbounds %"class.voro::voronoicell_base", ptr %18, i32 0, i32 5
  %57 = load i32, ptr %56, align 8, !tbaa !16
  %58 = ashr i32 %57, 3
  store i32 %58, ptr %14, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 1, ptr %15, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  br label %59

59:                                               ; preds = %105, %55
  %60 = load i32, ptr %13, align 4, !tbaa !15
  %61 = load i32, ptr %14, align 4, !tbaa !15
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %63, label %110

63:                                               ; preds = %59
  %64 = load double, ptr %8, align 8, !tbaa !9
  %65 = getelementptr inbounds %"class.voro::voronoicell_base", ptr %18, i32 0, i32 9
  %66 = load ptr, ptr %65, align 8, !tbaa !14
  %67 = load i32, ptr %15, align 4, !tbaa !15
  %68 = mul nsw i32 3, %67
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds double, ptr %66, i64 %69
  %71 = load double, ptr %70, align 8, !tbaa !9
  %72 = load double, ptr %9, align 8, !tbaa !9
  %73 = getelementptr inbounds %"class.voro::voronoicell_base", ptr %18, i32 0, i32 9
  %74 = load ptr, ptr %73, align 8, !tbaa !14
  %75 = load i32, ptr %15, align 4, !tbaa !15
  %76 = mul nsw i32 3, %75
  %77 = add nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds double, ptr %74, i64 %78
  %80 = load double, ptr %79, align 8, !tbaa !9
  %81 = fmul double %72, %80
  %82 = call double @llvm.fmuladd.f64(double %64, double %71, double %81)
  %83 = load double, ptr %10, align 8, !tbaa !9
  %84 = getelementptr inbounds %"class.voro::voronoicell_base", ptr %18, i32 0, i32 9
  %85 = load ptr, ptr %84, align 8, !tbaa !14
  %86 = load i32, ptr %15, align 4, !tbaa !15
  %87 = mul nsw i32 3, %86
  %88 = add nsw i32 %87, 2
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds double, ptr %85, i64 %89
  %91 = load double, ptr %90, align 8, !tbaa !9
  %92 = call double @llvm.fmuladd.f64(double %83, double %91, double %82)
  store double %92, ptr %16, align 8, !tbaa !9
  %93 = load double, ptr %16, align 8, !tbaa !9
  %94 = load double, ptr %12, align 8, !tbaa !9
  %95 = fcmp ogt double %93, %94
  br i1 %95, label %96, label %105

96:                                               ; preds = %63
  %97 = load double, ptr %16, align 8, !tbaa !9
  %98 = load double, ptr %11, align 8, !tbaa !9
  %99 = fcmp ogt double %97, %98
  br i1 %99, label %100, label %101

100:                                              ; preds = %96
  store i1 true, ptr %6, align 1
  store i32 1, ptr %17, align 4
  br label %117

101:                                              ; preds = %96
  %102 = load double, ptr %16, align 8, !tbaa !9
  store double %102, ptr %12, align 8, !tbaa !9
  %103 = load i32, ptr %15, align 4, !tbaa !15
  %104 = getelementptr inbounds %"class.voro::voronoicell_base", ptr %18, i32 0, i32 6
  store i32 %103, ptr %104, align 4, !tbaa !11
  br label %105

105:                                              ; preds = %101, %63
  %106 = load i32, ptr %15, align 4, !tbaa !15
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %15, align 4, !tbaa !15
  %108 = load i32, ptr %13, align 4, !tbaa !15
  %109 = add nsw i32 %108, %106
  store i32 %109, ptr %13, align 4, !tbaa !15
  br label %59, !llvm.loop !17

110:                                              ; preds = %59
  %111 = load double, ptr %8, align 8, !tbaa !9
  %112 = load double, ptr %9, align 8, !tbaa !9
  %113 = load double, ptr %10, align 8, !tbaa !9
  %114 = load double, ptr %11, align 8, !tbaa !9
  %115 = load double, ptr %12, align 8, !tbaa !9
  %116 = call noundef zeroext i1 @_ZN4voro16voronoicell_base22plane_intersects_trackEddddd(ptr noundef nonnull align 8 dereferenceable(160) %18, double noundef %111, double noundef %112, double noundef %113, double noundef %114, double noundef %115)
  store i1 %116, ptr %6, align 1
  store i32 1, ptr %17, align 4
  br label %117

117:                                              ; preds = %110, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %119

118:                                              ; preds = %5
  store i1 true, ptr %6, align 1
  store i32 1, ptr %17, align 4
  br label %119

119:                                              ; preds = %118, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %120 = load i1, ptr %6, align 1
  ret i1 %120
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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" }
attributes #3 = { 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 #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, !13, i64 28}
!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, !6, i64 48}
!15 = !{!13, !13, i64 0}
!16 = !{!12, !13, i64 24}
!17 = distinct !{!17, !18}
!18 = !{!"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"

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

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

18:                                               ; preds = %5
  %19 = getelementptr inbounds i8, ptr %0, i64 24
  %20 = load i32, ptr %19, align 8, !tbaa !14
  %21 = ashr i32 %20, 3
  %22 = icmp sgt i32 %21, 1
  br i1 %22, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %18, %37
  %indvars.iv = phi i64 [ %indvars.iv.next, %37 ], [ 1, %18 ]
  %.02836 = phi double [ %.129, %37 ], [ %16, %18 ]
  %.03035 = phi i32 [ %38, %37 ], [ 1, %18 ]
  %.idx = mul i64 %indvars.iv, 24
  %23 = getelementptr inbounds i8, ptr %8, i64 %.idx
  %24 = load double, ptr %23, align 8, !tbaa !13
  %25 = getelementptr inbounds i8, ptr %23, i64 8
  %26 = load double, ptr %25, align 8, !tbaa !13
  %27 = fmul double %26, %2
  %28 = tail call double @llvm.fmuladd.f64(double %1, double %24, double %27)
  %29 = getelementptr inbounds i8, ptr %23, i64 16
  %30 = load double, ptr %29, align 8, !tbaa !13
  %31 = tail call double @llvm.fmuladd.f64(double %3, double %30, double %28)
  %32 = fcmp ogt double %31, %.02836
  br i1 %32, label %33, label %.lr.ph._crit_edge

.lr.ph._crit_edge:                                ; preds = %.lr.ph
  %.pre = trunc nuw nsw i64 %indvars.iv to i32
  br label %37

33:                                               ; preds = %.lr.ph
  %34 = fcmp ogt double %31, %4
  br i1 %34, label %.loopexit, label %35

35:                                               ; preds = %33
  %36 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %36, ptr %6, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %.lr.ph._crit_edge, %35
  %.pre-phi = phi i32 [ %.pre, %.lr.ph._crit_edge ], [ %36, %35 ]
  %.129 = phi double [ %.02836, %.lr.ph._crit_edge ], [ %31, %35 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %38 = add nuw nsw i32 %.pre-phi, %.03035
  %39 = icmp slt i32 %38, %21
  br i1 %39, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %37, %18
  %.028.lcssa = phi double [ %16, %18 ], [ %.129, %37 ]
  %40 = 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 %.028.lcssa)
  br label %.loopexit

.loopexit:                                        ; preds = %33, %5, %._crit_edge
  %.1 = phi i1 [ %40, %._crit_edge ], [ true, %5 ], [ true, %33 ]
  ret i1 %.1
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #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" }

!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, !7, i64 28}
!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, !10, i64 48}
!13 = !{!11, !11, i64 0}
!14 = !{!6, !7, i64 24}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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