double catmull_rom_interpolate(double y0, double y1, double y2, double y3,
                               double t) {
  double t2 = t * t;
  double a0 = -0.5 * y0 + 1.5 * y1 - 1.5 * y2 + 0.5 * y3;
  double a1 = y0 - 2.5 * y1 + 2 * y2 - 0.5 * y3;
  double a2 = -0.5 * y0 + 0.5 * y2;
  double a3 = y1;
  return a0 * t * t2 + a1 * t2 + a2 * t + a3;
}


x86 assembly (clang, -O0):
<catmull_rom_interpolate>:
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  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee7(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xeba(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xebd(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  0xe98(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe81(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  0xe4f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe3d(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xe28(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x50(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<catmull_rom_interpolate>:
movsd  0xef8(%rip),%xmm6
mulsd  %xmm1,%xmm6
movsd  0xef3(%rip),%xmm8
movapd %xmm0,%xmm7
mulsd  %xmm8,%xmm7
addsd  %xmm7,%xmm6
movsd  0xee6(%rip),%xmm5
mulsd  %xmm2,%xmm5
addsd  %xmm6,%xmm5
movsd  0xede(%rip),%xmm6
mulsd  %xmm3,%xmm8
mulsd  %xmm6,%xmm3
addsd  %xmm5,%xmm3
mulsd  %xmm2,%xmm6
addsd  %xmm7,%xmm6
mulsd  %xmm4,%xmm3
mulsd  %xmm4,%xmm6
mulsd  %xmm4,%xmm4
movsd  0xebd(%rip),%xmm5
mulsd  %xmm1,%xmm5
addsd  %xmm5,%xmm0
addsd  %xmm2,%xmm2
addsd  %xmm2,%xmm0
addsd  %xmm8,%xmm0
mulsd  %xmm4,%xmm0
mulsd  %xmm4,%xmm3
addsd  %xmm3,%xmm0
addsd  %xmm6,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @catmull_rom_interpolate(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
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = 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
%16 = load double, double* %10
%17 = load double, double* %10
%18 = fmul double %16, %17
store double %18, double* %11
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fmul double 1.500000e+00, %20
%22 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %19, double %21)
%23 = load double, double* %8
%24 = call double @llvm.fmuladd.f64(double -1.500000e+00, double %23, double %22)
%25 = load double, double* %9
%26 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %25, double %24)
store double %26, double* %12
%27 = load double, double* %6
%28 = load double, double* %7
%29 = call double @llvm.fmuladd.f64(double -2.500000e+00, double %28, double %27)
%30 = load double, double* %8
%31 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %30, double %29)
%32 = load double, double* %9
%33 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %32, double %31)
store double %33, double* %13
%34 = load double, double* %6
%35 = load double, double* %8
%36 = fmul double 5.000000e-01, %35
%37 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %34, double %36)
store double %37, double* %14
%38 = load double, double* %7
store double %38, double* %15
%39 = load double, double* %12
%40 = load double, double* %10
%41 = fmul double %39, %40
%42 = load double, double* %11
%43 = load double, double* %13
%44 = load double, double* %11
%45 = fmul double %43, %44
%46 = call double @llvm.fmuladd.f64(double %41, double %42, double %45)
%47 = load double, double* %14
%48 = load double, double* %10
%49 = call double @llvm.fmuladd.f64(double %47, double %48, double %46)
%50 = load double, double* %15
%51 = fadd double %49, %50
ret double %51
}

LLVM IR (-O2):
define double @catmull_rom_interpolate(double %0, double %1, double %2, double %3, double %4) {
%6 = fmul double %4, %4
%7 = fmul double %1, 1.500000e+00
%8 = tail call double @llvm.fmuladd.f64(double %0, double -5.000000e-01, double %7)
%9 = tail call double @llvm.fmuladd.f64(double %2, double -1.500000e+00, double %8)
%10 = tail call double @llvm.fmuladd.f64(double %3, double 5.000000e-01, double %9)
%11 = tail call double @llvm.fmuladd.f64(double %1, double -2.500000e+00, double %0)
%12 = tail call double @llvm.fmuladd.f64(double %2, double 2.000000e+00, double %11)
%13 = tail call double @llvm.fmuladd.f64(double %3, double -5.000000e-01, double %12)
%14 = fmul double %2, 5.000000e-01
%15 = tail call double @llvm.fmuladd.f64(double %0, double -5.000000e-01, double %14)
%16 = fmul double %10, %4
%17 = fmul double %13, %6
%18 = tail call double @llvm.fmuladd.f64(double %16, double %6, double %17)
%19 = tail call double @llvm.fmuladd.f64(double %15, double %4, double %18)
%20 = fadd double %19, %1
ret double %20
}