void bspine(double u, double *b0, double *b1, double *b2, double *b3) {
  double t1 = 1 - u;
  double t2 = u * u;
  double t3 = t2 * u;
  *b0 = t1 * t1 * t1 / 6;
  *b1 = (3 * t3 - 6 * t2 + 4) / 6;
  *b2 = ((t2 + u - t3) * 3 + 1) / 6;
  *b2 = -t3 / 6;
}


x86 assembly (clang, -O0):
<bspine>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  0xeef(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  0xea0(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
movsd  0xe87(%rip),%xmm1
mulsd  -0x38(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe6b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe6b(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe47(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  0xe2c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe28(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe0c(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xddc(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bspine>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
movapd %xmm1,%xmm3
mulsd  %xmm1,%xmm3
mulsd  %xmm1,%xmm3
movsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm3
movsd  %xmm3,(%rdi)
movsd  0xed4(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xed0(%rip),%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm2,%xmm4
addsd  0xec8(%rip),%xmm4
divsd  %xmm1,%xmm4
movsd  %xmm4,(%rsi)
divsd  %xmm3,%xmm0
movsd  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define void @bspine(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
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
%14 = load double, double* %6
%15 = fsub double 1.000000e+00, %14
store double %15, double* %11
%16 = load double, double* %6
%17 = load double, double* %6
%18 = fmul double %16, %17
store double %18, double* %12
%19 = load double, double* %12
%20 = load double, double* %6
%21 = fmul double %19, %20
store double %21, double* %13
%22 = load double, double* %11
%23 = load double, double* %11
%24 = fmul double %22, %23
%25 = load double, double* %11
%26 = fmul double %24, %25
%27 = fdiv double %26, 6.000000e+00
%28 = load double*, double** %7
store double %27, double* %28
%29 = load double, double* %13
%30 = load double, double* %12
%31 = fmul double 6.000000e+00, %30
%32 = fneg double %31
%33 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %29, double %32)
%34 = fadd double %33, 4.000000e+00
%35 = fdiv double %34, 6.000000e+00
%36 = load double*, double** %8
store double %35, double* %36
%37 = load double, double* %12
%38 = load double, double* %6
%39 = fadd double %37, %38
%40 = load double, double* %13
%41 = fsub double %39, %40
%42 = call double @llvm.fmuladd.f64(double %41, double 3.000000e+00, double 1.000000e+00)
%43 = fdiv double %42, 6.000000e+00
%44 = load double*, double** %9
store double %43, double* %44
%45 = load double, double* %13
%46 = fneg double %45
%47 = fdiv double %46, 6.000000e+00
%48 = load double*, double** %9
store double %47, double* %48
ret void
}

LLVM IR (-O2):
define void @bspine(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* nocapture readnone %4) {
%6 = fsub double 1.000000e+00, %0
%7 = fmul double %0, %0
%8 = fmul double %7, %0
%9 = fmul double %6, %6
%10 = fmul double %6, %9
%11 = fdiv double %10, 6.000000e+00
store double %11, double* %1
%12 = fmul double %7, -6.000000e+00
%13 = tail call double @llvm.fmuladd.f64(double %8, double 3.000000e+00, double %12)
%14 = fadd double %13, 4.000000e+00
%15 = fdiv double %14, 6.000000e+00
store double %15, double* %2
%16 = fdiv double %8, -6.000000e+00
store double %16, double* %3
ret void
}