double cspline_eval_core(double x, double x0, double y0, double u0, double x1,
                         double y1, double u1) {
  double h, w, a, b, c, d, t;
  h = y1 - y0;
  w = x1 - x0;
  a = (u1 - u0) / w / 6.0;
  b = 0.5 * u0;
  c = h / w - (u1 + 2.0 * u0) * w / 6.0;
  d = y0;
  t = x - x0;
  return d + (c + (b + a * t) * t) * t;
}


x86 assembly (clang, -O0):
<cspline_eval_core>:
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  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe9b(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
mulsd  -0x48(%rbp),%xmm1
movsd  0xe60(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm4
mulsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
movsd  -0x70(%rbp),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
movsd  -0x70(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cspline_eval_core>:
subsd  %xmm1,%xmm4
movapd %xmm6,%xmm7
subsd  %xmm3,%xmm7
divsd  %xmm4,%xmm7
divsd  0xee8(%rip),%xmm7
movsd  0xee7(%rip),%xmm8
mulsd  %xmm3,%xmm8
addsd  %xmm3,%xmm3
addsd  %xmm6,%xmm3
unpcklpd %xmm4,%xmm6
unpcklpd %xmm3,%xmm3
mulpd  %xmm6,%xmm3
subsd  %xmm2,%xmm5
movsd  %xmm5,%xmm3
shufpd $0x2,0xec5(%rip),%xmm4
divpd  %xmm4,%xmm3
movapd %xmm3,%xmm4
unpckhpd %xmm3,%xmm4
subsd  %xmm4,%xmm3
subsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm7
addsd  %xmm8,%xmm7
mulsd  %xmm0,%xmm7
addsd  %xmm3,%xmm7
mulsd  %xmm7,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @cspline_eval_core(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double %6, double* %14
%22 = load double, double* %13
%23 = load double, double* %10
%24 = fsub double %22, %23
store double %24, double* %15
%25 = load double, double* %12
%26 = load double, double* %9
%27 = fsub double %25, %26
store double %27, double* %16
%28 = load double, double* %14
%29 = load double, double* %11
%30 = fsub double %28, %29
%31 = load double, double* %16
%32 = fdiv double %30, %31
%33 = fdiv double %32, 6.000000e+00
store double %33, double* %17
%34 = load double, double* %11
%35 = fmul double 5.000000e-01, %34
store double %35, double* %18
%36 = load double, double* %15
%37 = load double, double* %16
%38 = fdiv double %36, %37
%39 = load double, double* %14
%40 = load double, double* %11
%41 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %40, double %39)
%42 = load double, double* %16
%43 = fmul double %41, %42
%44 = fdiv double %43, 6.000000e+00
%45 = fsub double %38, %44
store double %45, double* %19
%46 = load double, double* %10
store double %46, double* %20
%47 = load double, double* %8
%48 = load double, double* %9
%49 = fsub double %47, %48
store double %49, double* %21
%50 = load double, double* %20
%51 = load double, double* %19
%52 = load double, double* %18
%53 = load double, double* %17
%54 = load double, double* %21
%55 = call double @llvm.fmuladd.f64(double %53, double %54, double %52)
%56 = load double, double* %21
%57 = call double @llvm.fmuladd.f64(double %55, double %56, double %51)
%58 = load double, double* %21
%59 = call double @llvm.fmuladd.f64(double %57, double %58, double %50)
ret double %59
}

LLVM IR (-O2):
define double @cspline_eval_core(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fsub double %4, %1
%9 = fsub double %6, %3
%10 = fdiv double %9, %8
%11 = fdiv double %10, 6.000000e+00
%12 = fmul double %3, 5.000000e-01
%13 = tail call double @llvm.fmuladd.f64(double %3, double 2.000000e+00, double %6)
%14 = insertelement <2 x double> poison, double %5, i64 0
%15 = insertelement <2 x double> %14, double %8, i64 1
%16 = insertelement <2 x double> poison, double %2, i64 0
%17 = insertelement <2 x double> %16, double %13, i64 1
%18 = fsub <2 x double> %15, %17
%19 = fmul <2 x double> %15, %17
%20 = shufflevector <2 x double> %18, <2 x double> %19, <2 x i32> <i32 0, i32 3>
%21 = insertelement <2 x double> <double poison, double 6.000000e+00>, double %8, i64 0
%22 = fdiv <2 x double> %20, %21
%23 = shufflevector <2 x double> %22, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%24 = fsub <2 x double> %22, %23
%25 = extractelement <2 x double> %24, i64 0
%26 = fsub double %0, %1
%27 = tail call double @llvm.fmuladd.f64(double %11, double %26, double %12)
%28 = tail call double @llvm.fmuladd.f64(double %27, double %26, double %25)
%29 = tail call double @llvm.fmuladd.f64(double %28, double %26, double %2)
ret double %29
}