double InterpCubeLagrange(double xdiff, double ydiff, double zdiff,
                          double vval000, double vval001, double vval010,
                          double vval011, double vval100, double vval101,
                          double vval110, double vval111) {
  double value;
  double oneMinusXdiff;
  double oneMinusYdiff;
  double oneMinusZdiff;
  oneMinusXdiff = 1.0 - xdiff;
  oneMinusYdiff = 1.0 - ydiff;
  oneMinusZdiff = 1.0 - zdiff;
  value = oneMinusXdiff *
              (oneMinusYdiff * (vval000 * oneMinusZdiff + vval001 * zdiff) +
               ydiff * (vval010 * oneMinusZdiff + vval011 * zdiff)) +
          xdiff * (oneMinusYdiff * (vval100 * oneMinusZdiff + vval101 * zdiff) +
                   ydiff * (vval110 * oneMinusZdiff + vval111 * zdiff));
  return (value);
}


x86 assembly (clang, -O0):
<InterpCubeLagrange>:
push   %rbp
mov    %rsp,%rbp
movsd  0x20(%rbp),%xmm8
movsd  0x18(%rbp),%xmm8
movsd  0x10(%rbp),%xmm8
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  %xmm7,-0x40(%rbp)
movsd  0xeba(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xea8(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe96(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x60(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm4,%xmm3
addsd  %xmm1,%xmm3
movsd  -0x10(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm4
movsd  -0x60(%rbp),%xmm6
movsd  -0x38(%rbp),%xmm5
mulsd  -0x18(%rbp),%xmm5
mulsd  %xmm6,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x8(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm5
movsd  -0x60(%rbp),%xmm6
movsd  0x10(%rbp),%xmm4
mulsd  -0x18(%rbp),%xmm4
mulsd  %xmm6,%xmm5
addsd  %xmm4,%xmm5
movsd  -0x10(%rbp),%xmm4
movsd  0x18(%rbp),%xmm6
movsd  -0x60(%rbp),%xmm8
movsd  0x20(%rbp),%xmm7
mulsd  -0x18(%rbp),%xmm7
mulsd  %xmm8,%xmm6
addsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<InterpCubeLagrange>:
movsd  0xef7(%rip),%xmm9
movapd %xmm9,%xmm8
subsd  %xmm0,%xmm8
movapd %xmm9,%xmm10
subsd  %xmm1,%xmm10
subsd  %xmm2,%xmm9
mulsd  %xmm2,%xmm4
mulsd  %xmm9,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm2,%xmm6
mulsd  %xmm9,%xmm5
addsd  %xmm6,%xmm5
mulsd  %xmm1,%xmm5
mulsd  %xmm10,%xmm3
addsd  %xmm5,%xmm3
mulsd  %xmm3,%xmm8
movsd  0x8(%rsp),%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm9,%xmm7
addsd  %xmm7,%xmm3
mulsd  0x18(%rsp),%xmm2
mulsd  0x10(%rsp),%xmm9
addsd  %xmm2,%xmm9
mulsd  %xmm1,%xmm9
mulsd  %xmm10,%xmm3
addsd  %xmm9,%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm8,%xmm0
ret

LLVM IR (-O0):
define double @InterpCubeLagrange(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10) {
%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
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
store double %0, double* %12
store double %1, double* %13
store double %2, double* %14
store double %3, double* %15
store double %4, double* %16
store double %5, double* %17
store double %6, double* %18
store double %7, double* %19
store double %8, double* %20
store double %9, double* %21
store double %10, double* %22
%27 = load double, double* %12
%28 = fsub double 1.000000e+00, %27
store double %28, double* %24
%29 = load double, double* %13
%30 = fsub double 1.000000e+00, %29
store double %30, double* %25
%31 = load double, double* %14
%32 = fsub double 1.000000e+00, %31
store double %32, double* %26
%33 = load double, double* %24
%34 = load double, double* %25
%35 = load double, double* %15
%36 = load double, double* %26
%37 = load double, double* %16
%38 = load double, double* %14
%39 = fmul double %37, %38
%40 = call double @llvm.fmuladd.f64(double %35, double %36, double %39)
%41 = load double, double* %13
%42 = load double, double* %17
%43 = load double, double* %26
%44 = load double, double* %18
%45 = load double, double* %14
%46 = fmul double %44, %45
%47 = call double @llvm.fmuladd.f64(double %42, double %43, double %46)
%48 = fmul double %41, %47
%49 = call double @llvm.fmuladd.f64(double %34, double %40, double %48)
%50 = load double, double* %12
%51 = load double, double* %25
%52 = load double, double* %19
%53 = load double, double* %26
%54 = load double, double* %20
%55 = load double, double* %14
%56 = fmul double %54, %55
%57 = call double @llvm.fmuladd.f64(double %52, double %53, double %56)
%58 = load double, double* %13
%59 = load double, double* %21
%60 = load double, double* %26
%61 = load double, double* %22
%62 = load double, double* %14
%63 = fmul double %61, %62
%64 = call double @llvm.fmuladd.f64(double %59, double %60, double %63)
%65 = fmul double %58, %64
%66 = call double @llvm.fmuladd.f64(double %51, double %57, double %65)
%67 = fmul double %50, %66
%68 = call double @llvm.fmuladd.f64(double %33, double %49, double %67)
store double %68, double* %23
%69 = load double, double* %23
ret double %69
}

LLVM IR (-O2):
define double @InterpCubeLagrange(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10) {
%12 = fsub double 1.000000e+00, %0
%13 = fsub double 1.000000e+00, %1
%14 = fsub double 1.000000e+00, %2
%15 = fmul double %2, %4
%16 = tail call double @llvm.fmuladd.f64(double %3, double %14, double %15)
%17 = fmul double %2, %6
%18 = tail call double @llvm.fmuladd.f64(double %5, double %14, double %17)
%19 = fmul double %18, %1
%20 = tail call double @llvm.fmuladd.f64(double %13, double %16, double %19)
%21 = fmul double %2, %8
%22 = tail call double @llvm.fmuladd.f64(double %7, double %14, double %21)
%23 = fmul double %2, %10
%24 = tail call double @llvm.fmuladd.f64(double %9, double %14, double %23)
%25 = fmul double %24, %1
%26 = tail call double @llvm.fmuladd.f64(double %13, double %22, double %25)
%27 = fmul double %26, %0
%28 = tail call double @llvm.fmuladd.f64(double %12, double %20, double %27)
ret double %28
}