double evalspline(double t, const double D[2], const double y[2]) {
  double c[4];
  c[0] = y[0];
  c[1] = D[0];
  c[2] = 3 * (y[1] - y[0]) - 2 * D[0] - D[1];
  c[3] = 2 * (y[0] - y[1]) + D[0] + D[1];
  return t * (t * (t * c[3] + c[2]) + c[1]) + c[0];
}


x86 assembly (clang, -O0):
<evalspline>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0xec0(%rip),%xmm1
mulsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe95(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm4,%xmm3
addsd  %xmm1,%xmm3
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<evalspline>:
movsd  (%rsi),%xmm1
movsd  0x8(%rsi),%xmm2
movapd %xmm1,%xmm3
subsd  %xmm2,%xmm3
subsd  %xmm1,%xmm2
movsd  (%rdi),%xmm4
movsd  0x8(%rdi),%xmm5
movapd %xmm4,%xmm6
mulsd  0xed6(%rip),%xmm2
addsd  %xmm4,%xmm6
subsd  %xmm6,%xmm2
subsd  %xmm5,%xmm2
addsd  %xmm3,%xmm3
addsd  %xmm4,%xmm3
addsd  %xmm5,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @evalspline(double %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %2
%5 = load double, double* %1
%6 = getelementptr inbounds double, double* %2, i64 1
%7 = load double, double* %6
%8 = fsub double %7, %4
%9 = fmul double %5, -2.000000e+00
%10 = tail call double @llvm.fmuladd.f64(double %8, double 3.000000e+00, double %9)
%11 = getelementptr inbounds double, double* %1, i64 1
%12 = load double, double* %11
%13 = fsub double %10, %12
%14 = fsub double %4, %7
%15 = tail call double @llvm.fmuladd.f64(double %14, double 2.000000e+00, double %5)
%16 = fadd double %12, %15
%17 = tail call double @llvm.fmuladd.f64(double %0, double %16, double %13)
%18 = tail call double @llvm.fmuladd.f64(double %0, double %17, double %5)
%19 = tail call double @llvm.fmuladd.f64(double %0, double %18, double %4)
ret double %19
}