; LLVM IR from liminchen/OptCuts :: ext/libigl/external/cgal/src/CGAL_Project/examples/Mesh_3/implicit_functions._2e18930a (functionddd)

; 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: 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 double @_Z19false_knot_functionddd(double noundef %0, double noundef %1, double noundef %2) #2 {
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, 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 i32, align 4
  store double %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !5
  store double %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  store double 1.200000e+00, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  store double 1.000000e-01, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %14 = load double, ptr %5, align 8, !tbaa !5
  %15 = load double, ptr %5, align 8, !tbaa !5
  %16 = load double, ptr %5, align 8, !tbaa !5
  %17 = load double, ptr %7, align 8, !tbaa !5
  %18 = load double, ptr %7, align 8, !tbaa !5
  %19 = fmul double %17, %18
  %20 = fneg double %19
  %21 = call double @llvm.fmuladd.f64(double %15, double %16, double %20)
  %22 = load double, ptr %5, align 8, !tbaa !5
  %23 = fmul double 2.000000e+00, %22
  %24 = load double, ptr %7, align 8, !tbaa !5
  %25 = fmul double %23, %24
  %26 = load double, ptr %7, align 8, !tbaa !5
  %27 = fmul double %25, %26
  %28 = fneg double %27
  %29 = call double @llvm.fmuladd.f64(double %14, double %21, double %28)
  %30 = load double, ptr %6, align 8, !tbaa !5
  %31 = load double, ptr %6, align 8, !tbaa !5
  %32 = fneg double %30
  %33 = call double @llvm.fmuladd.f64(double %32, double %31, double %29)
  %34 = load double, ptr %8, align 8, !tbaa !5
  %35 = load double, ptr %8, align 8, !tbaa !5
  %36 = call double @llvm.fmuladd.f64(double %34, double %35, double %33)
  %37 = load double, ptr %5, align 8, !tbaa !5
  %38 = load double, ptr %5, align 8, !tbaa !5
  %39 = fneg double %37
  %40 = call double @llvm.fmuladd.f64(double %39, double %38, double %36)
  %41 = load double, ptr %7, align 8, !tbaa !5
  %42 = load double, ptr %7, align 8, !tbaa !5
  %43 = fneg double %41
  %44 = call double @llvm.fmuladd.f64(double %43, double %42, double %40)
  %45 = load double, ptr %6, align 8, !tbaa !5
  %46 = load double, ptr %6, align 8, !tbaa !5
  %47 = fneg double %45
  %48 = call double @llvm.fmuladd.f64(double %47, double %46, double %44)
  store double %48, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %49 = load double, ptr %7, align 8, !tbaa !5
  %50 = load double, ptr %5, align 8, !tbaa !5
  %51 = load double, ptr %5, align 8, !tbaa !5
  %52 = load double, ptr %7, align 8, !tbaa !5
  %53 = load double, ptr %7, align 8, !tbaa !5
  %54 = fmul double %52, %53
  %55 = fneg double %54
  %56 = call double @llvm.fmuladd.f64(double %50, double %51, double %55)
  %57 = load double, ptr %5, align 8, !tbaa !5
  %58 = fmul double 2.000000e+00, %57
  %59 = load double, ptr %5, align 8, !tbaa !5
  %60 = fmul double %58, %59
  %61 = load double, ptr %7, align 8, !tbaa !5
  %62 = fmul double %60, %61
  %63 = call double @llvm.fmuladd.f64(double %49, double %56, double %62)
  store double %63, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %64 = load double, ptr %6, align 8, !tbaa !5
  %65 = fmul double 4.000000e+00, %64
  %66 = load double, ptr %6, align 8, !tbaa !5
  %67 = fmul double %65, %66
  %68 = load double, ptr %8, align 8, !tbaa !5
  %69 = load double, ptr %8, align 8, !tbaa !5
  %70 = load double, ptr %5, align 8, !tbaa !5
  %71 = load double, ptr %5, align 8, !tbaa !5
  %72 = fmul double %70, %71
  %73 = fneg double %72
  %74 = call double @llvm.fmuladd.f64(double %68, double %69, double %73)
  %75 = load double, ptr %7, align 8, !tbaa !5
  %76 = load double, ptr %7, align 8, !tbaa !5
  %77 = fneg double %75
  %78 = call double @llvm.fmuladd.f64(double %77, double %76, double %74)
  %79 = load double, ptr %6, align 8, !tbaa !5
  %80 = load double, ptr %6, align 8, !tbaa !5
  %81 = fneg double %79
  %82 = call double @llvm.fmuladd.f64(double %81, double %80, double %78)
  %83 = load double, ptr %11, align 8, !tbaa !5
  %84 = load double, ptr %11, align 8, !tbaa !5
  %85 = fmul double %83, %84
  %86 = fneg double %85
  %87 = call double @llvm.fmuladd.f64(double %67, double %82, double %86)
  store double %87, ptr %12, align 8, !tbaa !5
  %88 = load double, ptr %10, align 8, !tbaa !5
  %89 = load double, ptr %10, align 8, !tbaa !5
  %90 = load double, ptr %9, align 8, !tbaa !5
  %91 = load double, ptr %9, align 8, !tbaa !5
  %92 = fmul double %90, %91
  %93 = fneg double %92
  %94 = call double @llvm.fmuladd.f64(double %88, double %89, double %93)
  store double %94, ptr %10, align 8, !tbaa !5
  %95 = load double, ptr %12, align 8, !tbaa !5
  %96 = load double, ptr %12, align 8, !tbaa !5
  %97 = load double, ptr %9, align 8, !tbaa !5
  %98 = load double, ptr %9, align 8, !tbaa !5
  %99 = fmul double %97, %98
  %100 = fneg double %99
  %101 = call double @llvm.fmuladd.f64(double %95, double %96, double %100)
  store double %101, ptr %12, align 8, !tbaa !5
  %102 = load double, ptr %10, align 8, !tbaa !5
  %103 = fcmp olt double %102, 0.000000e+00
  br i1 %103, label %104, label %108

104:                                              ; preds = %3
  %105 = load double, ptr %12, align 8, !tbaa !5
  %106 = fcmp olt double %105, 0.000000e+00
  br i1 %106, label %107, label %108

107:                                              ; preds = %104
  store double -1.000000e+00, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %116

108:                                              ; preds = %104, %3
  %109 = load double, ptr %10, align 8, !tbaa !5
  %110 = fcmp ogt double %109, 0.000000e+00
  br i1 %110, label %114, label %111

111:                                              ; preds = %108
  %112 = load double, ptr %12, align 8, !tbaa !5
  %113 = fcmp ogt double %112, 0.000000e+00
  br i1 %113, label %114, label %115

114:                                              ; preds = %111, %108
  store double 1.000000e+00, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %116

115:                                              ; preds = %111
  store double 0.000000e+00, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %116

116:                                              ; preds = %115, %114, %107
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %117 = load double, ptr %4, align 8
  ret double %117
}

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 = !{!"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 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(none) uwtable
define dso_local noundef double @_Z19false_knot_functionddd(double noundef %0, double noundef %1, double noundef %2) local_unnamed_addr #1 {
  %4 = fneg double %2
  %5 = fmul double %4, %2
  %6 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %5)
  %7 = fmul double %0, 2.000000e+00
  %8 = fneg double %7
  %9 = fmul double %8, %2
  %10 = fmul double %9, %2
  %11 = tail call double @llvm.fmuladd.f64(double %0, double %6, double %10)
  %12 = fneg double %1
  %13 = tail call double @llvm.fmuladd.f64(double %12, double %1, double %11)
  %14 = fadd double %13, 1.440000e+00
  %15 = fneg double %0
  %16 = tail call double @llvm.fmuladd.f64(double %15, double %0, double %14)
  %17 = tail call double @llvm.fmuladd.f64(double %4, double %2, double %16)
  %18 = fmul double %7, %0
  %19 = fmul double %18, %2
  %20 = tail call double @llvm.fmuladd.f64(double %2, double %6, double %19)
  %21 = fmul double %1, 4.000000e+00
  %22 = fmul double %21, %1
  %23 = fmul double %0, %0
  %24 = fsub double 1.440000e+00, %23
  %25 = tail call double @llvm.fmuladd.f64(double %4, double %2, double %24)
  %26 = tail call double @llvm.fmuladd.f64(double %12, double %1, double %25)
  %27 = fneg double %20
  %28 = fmul double %20, %27
  %29 = insertelement <2 x double> poison, double %22, i64 0
  %30 = insertelement <2 x double> %29, double %12, i64 1
  %31 = insertelement <2 x double> poison, double %26, i64 0
  %32 = insertelement <2 x double> %31, double %1, i64 1
  %33 = insertelement <2 x double> poison, double %28, i64 0
  %34 = insertelement <2 x double> %33, double %17, i64 1
  %35 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %30, <2 x double> %32, <2 x double> %34)
  %36 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %35, <2 x double> %35, <2 x double> <double 0xBF847AE147AE147C, double 0xBF847AE147AE147C>)
  %37 = extractelement <2 x double> %36, i64 1
  %38 = fcmp olt double %37, 0.000000e+00
  %39 = extractelement <2 x double> %36, i64 0
  %40 = fcmp olt double %39, 0.000000e+00
  %or.cond = select i1 %38, i1 %40, i1 false
  br i1 %or.cond, label %45, label %41

41:                                               ; preds = %3
  %42 = fcmp ogt <2 x double> %36, zeroinitializer
  %43 = extractelement <2 x i1> %42, i64 0
  %44 = extractelement <2 x i1> %42, i64 1
  %or.cond3 = select i1 %44, i1 true, i1 %43
  %. = select i1 %or.cond3, double 1.000000e+00, double 0.000000e+00
  br label %45

45:                                               ; preds = %41, %3
  %.0 = phi double [ -1.000000e+00, %3 ], [ %., %41 ]
  ret double %.0
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #2

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

!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,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass