double Bezier(double x, double P1, double C1, double C2, double P2) {
  P1 += x * (C1 - P1);
  C1 += x * (C2 - C1);
  C2 += x * (P2 - C2);
  P1 += x * (C1 - P1);
  C1 += x * (C2 - C1);
  P1 += x * (C1 - P1);
  return P1;
}


x86 assembly (clang, -O0):
<Bezier>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bezier>:
unpcklpd %xmm3,%xmm4
unpcklpd %xmm2,%xmm3
subsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
subpd  %xmm3,%xmm4
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
mulpd  %xmm1,%xmm4
addpd  %xmm3,%xmm4
movapd %xmm4,%xmm3
shufpd $0x1,%xmm2,%xmm3
subpd  %xmm3,%xmm4
mulpd  %xmm4,%xmm1
addpd  %xmm3,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @Bezier(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %6
%12 = load double, double* %8
%13 = load double, double* %7
%14 = fsub double %12, %13
%15 = load double, double* %7
%16 = call double @llvm.fmuladd.f64(double %11, double %14, double %15)
store double %16, double* %7
%17 = load double, double* %6
%18 = load double, double* %9
%19 = load double, double* %8
%20 = fsub double %18, %19
%21 = load double, double* %8
%22 = call double @llvm.fmuladd.f64(double %17, double %20, double %21)
store double %22, double* %8
%23 = load double, double* %6
%24 = load double, double* %10
%25 = load double, double* %9
%26 = fsub double %24, %25
%27 = load double, double* %9
%28 = call double @llvm.fmuladd.f64(double %23, double %26, double %27)
store double %28, double* %9
%29 = load double, double* %6
%30 = load double, double* %8
%31 = load double, double* %7
%32 = fsub double %30, %31
%33 = load double, double* %7
%34 = call double @llvm.fmuladd.f64(double %29, double %32, double %33)
store double %34, double* %7
%35 = load double, double* %6
%36 = load double, double* %9
%37 = load double, double* %8
%38 = fsub double %36, %37
%39 = load double, double* %8
%40 = call double @llvm.fmuladd.f64(double %35, double %38, double %39)
store double %40, double* %8
%41 = load double, double* %6
%42 = load double, double* %8
%43 = load double, double* %7
%44 = fsub double %42, %43
%45 = load double, double* %7
%46 = call double @llvm.fmuladd.f64(double %41, double %44, double %45)
store double %46, double* %7
%47 = load double, double* %7
ret double %47
}

LLVM IR (-O2):
define double @Bezier(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %2, %1
%7 = tail call double @llvm.fmuladd.f64(double %0, double %6, double %1)
%8 = insertelement <2 x double> poison, double %4, i64 0
%9 = insertelement <2 x double> %8, double %3, i64 1
%10 = insertelement <2 x double> poison, double %3, i64 0
%11 = insertelement <2 x double> %10, double %2, i64 1
%12 = fsub <2 x double> %9, %11
%13 = insertelement <2 x double> poison, double %0, i64 0
%14 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> zeroinitializer
%15 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %14, <2 x double> %12, <2 x double> %11)
%16 = extractelement <2 x double> %15, i64 1
%17 = insertelement <2 x double> poison, double %16, i64 0
%18 = insertelement <2 x double> %17, double %7, i64 1
%19 = fsub <2 x double> %15, %18
%20 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %14, <2 x double> %19, <2 x double> %18)
%21 = extractelement <2 x double> %20, i64 0
%22 = extractelement <2 x double> %20, i64 1
%23 = fsub double %21, %22
%24 = tail call double @llvm.fmuladd.f64(double %0, double %23, double %22)
ret double %24
}