; LLVM IR from liminchen/OptCuts :: ext/libigl/external/cgal/src/CGAL_Project/examples/Mesh_3/implicit_functions._26e8dd17 (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
declare dso_local void @_Z5puissRdS_i(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_Z14knot1_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 double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = 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.000000e-01, ptr %8, align 8, !tbaa !5
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %21 = load double, ptr %5, align 8, !tbaa !5
  %22 = load double, ptr %5, align 8, !tbaa !5
  %23 = call double @llvm.fmuladd.f64(double %21, double %22, double 1.000000e+00)
  %24 = load double, ptr %6, align 8, !tbaa !5
  %25 = load double, ptr %6, align 8, !tbaa !5
  %26 = call double @llvm.fmuladd.f64(double %24, double %25, double %23)
  %27 = load double, ptr %7, align 8, !tbaa !5
  %28 = load double, ptr %7, align 8, !tbaa !5
  %29 = call double @llvm.fmuladd.f64(double %27, double %28, double %26)
  store double %29, ptr %13, align 8, !tbaa !5
  %30 = load double, ptr %5, align 8, !tbaa !5
  %31 = fmul double 2.000000e+00, %30
  %32 = load double, ptr %13, align 8, !tbaa !5
  %33 = fdiv double %31, %32
  store double %33, ptr %9, align 8, !tbaa !5
  %34 = load double, ptr %6, align 8, !tbaa !5
  %35 = fmul double 2.000000e+00, %34
  %36 = load double, ptr %13, align 8, !tbaa !5
  %37 = fdiv double %35, %36
  store double %37, ptr %10, align 8, !tbaa !5
  %38 = load double, ptr %7, align 8, !tbaa !5
  %39 = fmul double 2.000000e+00, %38
  %40 = load double, ptr %13, align 8, !tbaa !5
  %41 = fdiv double %39, %40
  store double %41, ptr %11, align 8, !tbaa !5
  %42 = load double, ptr %5, align 8, !tbaa !5
  %43 = load double, ptr %5, align 8, !tbaa !5
  %44 = fneg double %42
  %45 = call double @llvm.fmuladd.f64(double %44, double %43, double 1.000000e+00)
  %46 = load double, ptr %6, align 8, !tbaa !5
  %47 = load double, ptr %6, align 8, !tbaa !5
  %48 = fneg double %46
  %49 = call double @llvm.fmuladd.f64(double %48, double %47, double %45)
  %50 = load double, ptr %7, align 8, !tbaa !5
  %51 = load double, ptr %7, align 8, !tbaa !5
  %52 = fneg double %50
  %53 = call double @llvm.fmuladd.f64(double %52, double %51, double %49)
  %54 = load double, ptr %13, align 8, !tbaa !5
  %55 = fdiv double %53, %54
  store double %55, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %56 = load double, ptr %9, align 8, !tbaa !5
  store double %56, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %57 = load double, ptr %10, align 8, !tbaa !5
  store double %57, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %58 = load double, ptr %11, align 8, !tbaa !5
  store double %58, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %59 = load double, ptr %12, align 8, !tbaa !5
  store double %59, ptr %17, align 8, !tbaa !5
  call void @_Z5puissRdS_i(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15, i32 noundef 3)
  call void @_Z5puissRdS_i(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %60 = load double, ptr %16, align 8, !tbaa !5
  %61 = load double, ptr %14, align 8, !tbaa !5
  %62 = fsub double %60, %61
  store double %62, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %63 = load double, ptr %17, align 8, !tbaa !5
  %64 = load double, ptr %15, align 8, !tbaa !5
  %65 = fsub double %63, %64
  store double %65, ptr %19, align 8, !tbaa !5
  %66 = load double, ptr %18, align 8, !tbaa !5
  %67 = load double, ptr %18, align 8, !tbaa !5
  %68 = fmul double %66, %67
  store double %68, ptr %18, align 8, !tbaa !5
  %69 = load double, ptr %19, align 8, !tbaa !5
  %70 = load double, ptr %19, align 8, !tbaa !5
  %71 = fmul double %69, %70
  store double %71, ptr %19, align 8, !tbaa !5
  %72 = load double, ptr %8, align 8, !tbaa !5
  %73 = load double, ptr %8, align 8, !tbaa !5
  %74 = fmul double %72, %73
  %75 = load double, ptr %13, align 8, !tbaa !5
  %76 = fsub double %75, 1.000000e+00
  %77 = fdiv double %74, %76
  store double %77, ptr %8, align 8, !tbaa !5
  %78 = load double, ptr %18, align 8, !tbaa !5
  %79 = load double, ptr %19, align 8, !tbaa !5
  %80 = fadd double %78, %79
  %81 = load double, ptr %8, align 8, !tbaa !5
  %82 = fsub double %80, %81
  %83 = fcmp olt double %82, 0.000000e+00
  br i1 %83, label %84, label %85

84:                                               ; preds = %3
  store double -1.000000e+00, ptr %4, align 8
  store i32 1, ptr %20, align 4
  br label %94

85:                                               ; preds = %3
  %86 = load double, ptr %18, align 8, !tbaa !5
  %87 = load double, ptr %19, align 8, !tbaa !5
  %88 = fadd double %86, %87
  %89 = load double, ptr %8, align 8, !tbaa !5
  %90 = fsub double %88, %89
  %91 = fcmp ogt double %90, 0.000000e+00
  br i1 %91, label %92, label %93

92:                                               ; preds = %85
  store double 1.000000e+00, ptr %4, align 8
  store i32 1, ptr %20, align 4
  br label %94

93:                                               ; preds = %85
  store double 0.000000e+00, ptr %4, align 8
  store i32 1, ptr %20, align 4
  br label %94

94:                                               ; preds = %93, %92, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %95 = load double, ptr %4, align 8
  ret double %95
}

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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5puissRdS_i(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_Z14knot1_functionddd(double noundef %0, double noundef %1, double noundef %2) local_unnamed_addr #1 {
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = fmul double %0, 2.000000e+00
  %9 = fmul double %1, 2.000000e+00
  %10 = fmul double %2, 2.000000e+00
  %11 = fneg double %0
  %12 = fneg double %1
  %13 = fneg double %2
  %14 = insertelement <2 x double> poison, double %0, i64 0
  %15 = shufflevector <2 x double> %14, <2 x double> poison, <2 x i32> zeroinitializer
  %16 = insertelement <2 x double> %15, double %11, i64 0
  %17 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %15, <2 x double> %16, <2 x double> <double 1.000000e+00, double 1.000000e+00>)
  %18 = insertelement <2 x double> poison, double %1, i64 0
  %19 = shufflevector <2 x double> %18, <2 x double> poison, <2 x i32> zeroinitializer
  %20 = insertelement <2 x double> %19, double %12, i64 0
  %21 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %19, <2 x double> %20, <2 x double> %17)
  %22 = insertelement <2 x double> poison, double %2, i64 0
  %23 = shufflevector <2 x double> %22, <2 x double> poison, <2 x i32> zeroinitializer
  %24 = insertelement <2 x double> %23, double %13, i64 0
  %25 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %23, <2 x double> %24, <2 x double> %21)
  %26 = extractelement <2 x double> %25, i64 1
  %27 = fdiv double %8, %26
  %28 = fdiv double %9, %26
  %29 = fdiv double %10, %26
  %30 = extractelement <2 x double> %25, i64 0
  %31 = fdiv double %30, %26
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  store double %27, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  store double %28, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  store double %29, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  store double %31, ptr %7, align 8, !tbaa !5
  call void @_Z5puissRdS_i(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 3)
  call void @_Z5puissRdS_i(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef 2)
  %32 = load double, ptr %6, align 8, !tbaa !5
  %33 = load double, ptr %4, align 8, !tbaa !5
  %34 = load double, ptr %7, align 8, !tbaa !5
  %35 = load double, ptr %5, align 8, !tbaa !5
  %36 = insertelement <2 x double> poison, double %32, i64 0
  %37 = insertelement <2 x double> %36, double %34, i64 1
  %38 = insertelement <2 x double> poison, double %33, i64 0
  %39 = insertelement <2 x double> %38, double %35, i64 1
  %40 = fsub <2 x double> %37, %39
  %41 = fmul <2 x double> %40, %40
  %42 = fadd double %26, -1.000000e+00
  %43 = fdiv double 0x3F847AE147AE147C, %42
  %shift = shufflevector <2 x double> %41, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %44 = fadd <2 x double> %41, %shift
  %45 = extractelement <2 x double> %44, i64 0
  %46 = fsub double %45, %43
  %47 = fcmp olt double %46, 0.000000e+00
  %48 = fcmp ogt double %46, 0.000000e+00
  %. = select i1 %48, double 1.000000e+00, double 0.000000e+00
  %.0 = select i1 %47, double -1.000000e+00, double %.
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  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 willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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"}


; Effective O3 passes: EarlyCSEPass,GlobalDCEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass