double cubic_interpolate(double y[4], double mu) {
  double a0, a1, a2, a3, mu2;
  mu2 = ((mu) * (mu));
  a0 = y[3] - y[2] - y[0] + y[1];
  a1 = y[0] - y[1] - a0;
  a2 = y[2] - y[0];
  a3 = y[1];
  return (a0 * mu * mu2) + (a1 * mu2) + (a2 * mu) + a3;
}


x86 assembly (clang, -O0):
<cubic_interpolate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubic_interpolate>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0x18(%rdi),%xmm2
movsd  0x10(%rdi),%xmm3
subsd  %xmm3,%xmm2
movsd  (%rdi),%xmm4
movsd  0x8(%rdi),%xmm5
subsd  %xmm4,%xmm2
addsd  %xmm5,%xmm2
subsd  %xmm4,%xmm3
subsd  %xmm5,%xmm4
subsd  %xmm2,%xmm4
mulsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm4
mulsd  %xmm1,%xmm2
addsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm5,%xmm0
ret

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

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