; LLVM IR from liminchen/OptCuts :: ext/libigl/external/cgal/src/CGAL_Project/examples/Mesh_3/implicit_functions._71a58ebf (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 @_Z20knot1_surf1_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
  store double %0, ptr %4, align 8, !tbaa !5
  store double %1, ptr %5, align 8, !tbaa !5
  store double %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %12 = load double, ptr %4, align 8, !tbaa !5
  %13 = load double, ptr %4, align 8, !tbaa !5
  %14 = call double @llvm.fmuladd.f64(double %12, double %13, double 1.000000e+00)
  %15 = load double, ptr %5, align 8, !tbaa !5
  %16 = load double, ptr %5, align 8, !tbaa !5
  %17 = call double @llvm.fmuladd.f64(double %15, double %16, double %14)
  %18 = load double, ptr %6, align 8, !tbaa !5
  %19 = load double, ptr %6, align 8, !tbaa !5
  %20 = call double @llvm.fmuladd.f64(double %18, double %19, double %17)
  store double %20, ptr %11, align 8, !tbaa !5
  %21 = load double, ptr %4, align 8, !tbaa !5
  %22 = fmul double 2.000000e+00, %21
  %23 = load double, ptr %11, align 8, !tbaa !5
  %24 = fdiv double %22, %23
  store double %24, ptr %7, align 8, !tbaa !5
  %25 = load double, ptr %5, align 8, !tbaa !5
  %26 = fmul double 2.000000e+00, %25
  %27 = load double, ptr %11, align 8, !tbaa !5
  %28 = fdiv double %26, %27
  store double %28, ptr %8, align 8, !tbaa !5
  %29 = load double, ptr %6, align 8, !tbaa !5
  %30 = fmul double 2.000000e+00, %29
  %31 = load double, ptr %11, align 8, !tbaa !5
  %32 = fdiv double %30, %31
  store double %32, ptr %9, align 8, !tbaa !5
  %33 = load double, ptr %4, align 8, !tbaa !5
  %34 = load double, ptr %4, align 8, !tbaa !5
  %35 = fneg double %33
  %36 = call double @llvm.fmuladd.f64(double %35, double %34, double 1.000000e+00)
  %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 %6, align 8, !tbaa !5
  %42 = load double, ptr %6, align 8, !tbaa !5
  %43 = fneg double %41
  %44 = call double @llvm.fmuladd.f64(double %43, double %42, double %40)
  %45 = load double, ptr %11, align 8, !tbaa !5
  %46 = fdiv double %44, %45
  store double %46, ptr %10, align 8, !tbaa !5
  %47 = load double, ptr %7, align 8, !tbaa !5
  %48 = load double, ptr %7, align 8, !tbaa !5
  %49 = load double, ptr %7, align 8, !tbaa !5
  %50 = load double, ptr %8, align 8, !tbaa !5
  %51 = load double, ptr %8, align 8, !tbaa !5
  %52 = fmul double %50, %51
  %53 = fneg double %52
  %54 = call double @llvm.fmuladd.f64(double %48, double %49, double %53)
  %55 = load double, ptr %7, align 8, !tbaa !5
  %56 = fmul double 2.000000e+00, %55
  %57 = load double, ptr %8, align 8, !tbaa !5
  %58 = fmul double %56, %57
  %59 = load double, ptr %8, align 8, !tbaa !5
  %60 = fmul double %58, %59
  %61 = fneg double %60
  %62 = call double @llvm.fmuladd.f64(double %47, double %54, double %61)
  %63 = load double, ptr %9, align 8, !tbaa !5
  %64 = load double, ptr %9, align 8, !tbaa !5
  %65 = fneg double %63
  %66 = call double @llvm.fmuladd.f64(double %65, double %64, double %62)
  %67 = load double, ptr %10, align 8, !tbaa !5
  %68 = load double, ptr %10, align 8, !tbaa !5
  %69 = call double @llvm.fmuladd.f64(double %67, double %68, double %66)
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret double %69
}

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 @_Z20knot1_surf1_functionddd(double noundef %0, double noundef %1, double noundef %2) local_unnamed_addr #1 {
  %4 = insertelement <2 x double> poison, double %1, i64 0
  %5 = insertelement <2 x double> %4, double %0, i64 1
  %6 = fmul <2 x double> %5, <double 2.000000e+00, double 2.000000e+00>
  %7 = fmul double %2, 2.000000e+00
  %8 = fneg double %0
  %9 = fneg double %1
  %10 = fneg double %2
  %11 = insertelement <2 x double> poison, double %0, i64 0
  %12 = shufflevector <2 x double> %11, <2 x double> poison, <2 x i32> zeroinitializer
  %13 = insertelement <2 x double> %12, double %8, i64 0
  %14 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %12, <2 x double> %13, <2 x double> <double 1.000000e+00, double 1.000000e+00>)
  %15 = shufflevector <2 x double> %4, <2 x double> poison, <2 x i32> zeroinitializer
  %16 = insertelement <2 x double> %15, double %9, i64 0
  %17 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %15, <2 x double> %16, <2 x double> %14)
  %18 = insertelement <2 x double> poison, double %2, i64 0
  %19 = shufflevector <2 x double> %18, <2 x double> poison, <2 x i32> zeroinitializer
  %20 = insertelement <2 x double> %19, double %10, i64 0
  %21 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %19, <2 x double> %20, <2 x double> %17)
  %22 = extractelement <2 x double> %21, i64 1
  %23 = shufflevector <2 x double> %21, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %24 = fdiv <2 x double> %6, %23
  %25 = fdiv double %7, %22
  %26 = extractelement <2 x double> %21, i64 0
  %27 = fdiv double %26, %22
  %28 = extractelement <2 x double> %24, i64 0
  %29 = fneg double %28
  %30 = fmul double %28, %29
  %31 = extractelement <2 x double> %24, i64 1
  %32 = tail call double @llvm.fmuladd.f64(double %31, double %31, double %30)
  %33 = fmul double %31, -2.000000e+00
  %34 = fmul double %28, %33
  %35 = fmul double %28, %34
  %36 = tail call double @llvm.fmuladd.f64(double %31, double %32, double %35)
  %37 = fneg double %25
  %38 = tail call double @llvm.fmuladd.f64(double %37, double %25, double %36)
  %39 = tail call double @llvm.fmuladd.f64(double %27, double %27, double %38)
  ret double %39
}

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