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

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

%"struct.voro::wall_cone" = type { %"class.voro::wall", i32, double, double, double, double, double, double, double, double, double, double }
%"class.voro::wall" = type { ptr }

; 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 nounwind uwtable
define dso_local noundef zeroext i1 @_ZN4voro9wall_cone12point_insideEddd(ptr noundef nonnull align 8 dereferenceable(96) %0, double noundef %1, double noundef %2, double noundef %3) unnamed_addr #2 align 2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca double, 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 double, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store double %1, ptr %7, align 8, !tbaa !9
  store double %2, ptr %8, align 8, !tbaa !9
  store double %3, ptr %9, align 8, !tbaa !9
  %15 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %16 = load double, ptr %7, align 8, !tbaa !9
  %17 = getelementptr inbounds %"struct.voro::wall_cone", ptr %15, i32 0, i32 2
  %18 = load double, ptr %17, align 8, !tbaa !11
  %19 = fsub double %16, %18
  store double %19, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %20 = load double, ptr %8, align 8, !tbaa !9
  %21 = getelementptr inbounds %"struct.voro::wall_cone", ptr %15, i32 0, i32 3
  %22 = load double, ptr %21, align 8, !tbaa !15
  %23 = fsub double %20, %22
  store double %23, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %24 = load double, ptr %9, align 8, !tbaa !9
  %25 = getelementptr inbounds %"struct.voro::wall_cone", ptr %15, i32 0, i32 4
  %26 = load double, ptr %25, align 8, !tbaa !16
  %27 = fsub double %24, %26
  store double %27, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %28 = load double, ptr %10, align 8, !tbaa !9
  %29 = getelementptr inbounds %"struct.voro::wall_cone", ptr %15, i32 0, i32 5
  %30 = load double, ptr %29, align 8, !tbaa !17
  %31 = load double, ptr %11, align 8, !tbaa !9
  %32 = getelementptr inbounds %"struct.voro::wall_cone", ptr %15, i32 0, i32 6
  %33 = load double, ptr %32, align 8, !tbaa !18
  %34 = fmul double %31, %33
  %35 = call double @llvm.fmuladd.f64(double %28, double %30, double %34)
  %36 = load double, ptr %12, align 8, !tbaa !9
  %37 = getelementptr inbounds %"struct.voro::wall_cone", ptr %15, i32 0, i32 7
  %38 = load double, ptr %37, align 8, !tbaa !19
  %39 = call double @llvm.fmuladd.f64(double %36, double %38, double %35)
  %40 = getelementptr inbounds %"struct.voro::wall_cone", ptr %15, i32 0, i32 8
  %41 = load double, ptr %40, align 8, !tbaa !20
  %42 = fmul double %39, %41
  store double %42, ptr %13, align 8, !tbaa !9
  %43 = getelementptr inbounds %"struct.voro::wall_cone", ptr %15, i32 0, i32 5
  %44 = load double, ptr %43, align 8, !tbaa !17
  %45 = load double, ptr %13, align 8, !tbaa !9
  %46 = load double, ptr %10, align 8, !tbaa !9
  %47 = fneg double %44
  %48 = call double @llvm.fmuladd.f64(double %47, double %45, double %46)
  store double %48, ptr %10, align 8, !tbaa !9
  %49 = getelementptr inbounds %"struct.voro::wall_cone", ptr %15, i32 0, i32 6
  %50 = load double, ptr %49, align 8, !tbaa !18
  %51 = load double, ptr %13, align 8, !tbaa !9
  %52 = load double, ptr %11, align 8, !tbaa !9
  %53 = fneg double %50
  %54 = call double @llvm.fmuladd.f64(double %53, double %51, double %52)
  store double %54, ptr %11, align 8, !tbaa !9
  %55 = getelementptr inbounds %"struct.voro::wall_cone", ptr %15, i32 0, i32 7
  %56 = load double, ptr %55, align 8, !tbaa !19
  %57 = load double, ptr %13, align 8, !tbaa !9
  %58 = load double, ptr %12, align 8, !tbaa !9
  %59 = fneg double %56
  %60 = call double @llvm.fmuladd.f64(double %59, double %57, double %58)
  store double %60, ptr %12, align 8, !tbaa !9
  %61 = getelementptr inbounds %"struct.voro::wall_cone", ptr %15, i32 0, i32 9
  %62 = load double, ptr %61, align 8, !tbaa !21
  %63 = load double, ptr %13, align 8, !tbaa !9
  %64 = fmul double %63, %62
  store double %64, ptr %13, align 8, !tbaa !9
  %65 = load double, ptr %13, align 8, !tbaa !9
  %66 = fcmp olt double %65, 0.000000e+00
  br i1 %66, label %67, label %68

67:                                               ; preds = %4
  store i1 false, ptr %5, align 1
  store i32 1, ptr %14, align 4
  br label %83

68:                                               ; preds = %4
  %69 = load double, ptr %13, align 8, !tbaa !9
  %70 = load double, ptr %13, align 8, !tbaa !9
  %71 = fmul double %70, %69
  store double %71, ptr %13, align 8, !tbaa !9
  %72 = load double, ptr %10, align 8, !tbaa !9
  %73 = load double, ptr %10, align 8, !tbaa !9
  %74 = load double, ptr %11, align 8, !tbaa !9
  %75 = load double, ptr %11, align 8, !tbaa !9
  %76 = fmul double %74, %75
  %77 = call double @llvm.fmuladd.f64(double %72, double %73, double %76)
  %78 = load double, ptr %12, align 8, !tbaa !9
  %79 = load double, ptr %12, align 8, !tbaa !9
  %80 = call double @llvm.fmuladd.f64(double %78, double %79, double %77)
  %81 = load double, ptr %13, align 8, !tbaa !9
  %82 = fcmp olt double %80, %81
  store i1 %82, ptr %5, align 1
  store i32 1, ptr %14, align 4
  br label %83

83:                                               ; preds = %68, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %84 = load i1, ptr %5, align 1
  ret i1 %84
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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, !10, i64 16}
!12 = !{!"_ZTSN4voro9wall_coneE", !13, i64 0, !14, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88}
!13 = !{!"_ZTSN4voro4wallE"}
!14 = !{!"int", !7, i64 0}
!15 = !{!12, !10, i64 24}
!16 = !{!12, !10, i64 32}
!17 = !{!12, !10, i64 40}
!18 = !{!12, !10, i64 48}
!19 = !{!12, !10, i64 56}
!20 = !{!12, !10, i64 64}
!21 = !{!12, !10, i64 72}


; 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 nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local noundef zeroext i1 @_ZN4voro9wall_cone12point_insideEddd(ptr nocapture noundef nonnull readonly align 8 dereferenceable(96) %0, double noundef %1, double noundef %2, double noundef %3) unnamed_addr #1 align 2 {
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  %6 = load double, ptr %5, align 8, !tbaa !5
  %7 = fsub double %1, %6
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  %9 = load double, ptr %8, align 8, !tbaa !12
  %10 = fsub double %2, %9
  %11 = getelementptr inbounds i8, ptr %0, i64 32
  %12 = load double, ptr %11, align 8, !tbaa !13
  %13 = fsub double %3, %12
  %14 = getelementptr inbounds i8, ptr %0, i64 40
  %15 = load double, ptr %14, align 8, !tbaa !14
  %16 = getelementptr inbounds i8, ptr %0, i64 48
  %17 = load double, ptr %16, align 8, !tbaa !15
  %18 = fmul double %10, %17
  %19 = tail call double @llvm.fmuladd.f64(double %7, double %15, double %18)
  %20 = getelementptr inbounds i8, ptr %0, i64 56
  %21 = load double, ptr %20, align 8, !tbaa !16
  %22 = tail call double @llvm.fmuladd.f64(double %13, double %21, double %19)
  %23 = getelementptr inbounds i8, ptr %0, i64 64
  %24 = load double, ptr %23, align 8, !tbaa !17
  %25 = fmul double %24, %22
  %26 = getelementptr inbounds i8, ptr %0, i64 72
  %27 = load double, ptr %26, align 8, !tbaa !18
  %28 = fmul double %27, %25
  %29 = fcmp olt double %28, 0.000000e+00
  br i1 %29, label %42, label %30

30:                                               ; preds = %4
  %31 = fneg double %21
  %32 = tail call double @llvm.fmuladd.f64(double %31, double %25, double %13)
  %33 = fneg double %17
  %34 = tail call double @llvm.fmuladd.f64(double %33, double %25, double %10)
  %35 = fneg double %15
  %36 = tail call double @llvm.fmuladd.f64(double %35, double %25, double %7)
  %37 = fmul double %28, %28
  %38 = fmul double %34, %34
  %39 = tail call double @llvm.fmuladd.f64(double %36, double %36, double %38)
  %40 = tail call double @llvm.fmuladd.f64(double %32, double %32, double %39)
  %41 = fcmp olt double %40, %37
  br label %42

42:                                               ; preds = %4, %30
  %.0 = phi i1 [ %41, %30 ], [ false, %4 ]
  ret i1 %.0
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) 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, !11, i64 16}
!6 = !{!"_ZTSN4voro9wall_coneE", !7, i64 0, !8, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88}
!7 = !{!"_ZTSN4voro4wallE"}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"double", !9, i64 0}
!12 = !{!6, !11, i64 24}
!13 = !{!6, !11, i64 32}
!14 = !{!6, !11, i64 40}
!15 = !{!6, !11, i64 48}
!16 = !{!6, !11, i64 56}
!17 = !{!6, !11, i64 64}
!18 = !{!6, !11, i64 72}


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