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 = vval000 * (oneMinusXdiff) * (oneMinusYdiff) * (oneMinusZdiff) +
          vval001 * (oneMinusXdiff) * (oneMinusYdiff)*zdiff +
          vval010 * (oneMinusXdiff)*ydiff * (oneMinusZdiff) +
          vval011 * (oneMinusXdiff)*ydiff * zdiff +
          vval100 * xdiff * (oneMinusYdiff) * (oneMinusZdiff) +
          vval101 * xdiff * (oneMinusYdiff)*zdiff +
          vval110 * xdiff * ydiff * (oneMinusZdiff) +
          vval111 * xdiff * ydiff * 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  -0x20(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x18(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x20(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
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),%xmm8
movapd %xmm8,%xmm9
subsd  %xmm0,%xmm9
movapd %xmm8,%xmm10
subsd  %xmm1,%xmm10
subsd  %xmm2,%xmm8
mulsd  %xmm9,%xmm3
mulsd  %xmm10,%xmm3
mulsd  %xmm9,%xmm4
mulsd  %xmm10,%xmm4
mulsd  %xmm2,%xmm4
mulsd  %xmm8,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm9,%xmm5
mulsd  %xmm1,%xmm5
mulsd  %xmm8,%xmm5
addsd  %xmm3,%xmm5
mulsd  %xmm6,%xmm9
mulsd  %xmm1,%xmm9
mulsd  %xmm2,%xmm9
addsd  %xmm5,%xmm9
mulsd  %xmm0,%xmm7
mulsd  %xmm10,%xmm7
mulsd  %xmm8,%xmm7
addsd  %xmm7,%xmm9
movsd  0x8(%rsp),%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm10,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm9,%xmm3
movsd  0x10(%rsp),%xmm4
mulsd  %xmm0,%xmm4
mulsd  %xmm1,%xmm4
mulsd  %xmm8,%xmm4
mulsd  0x18(%rsp),%xmm0
addsd  %xmm3,%xmm4
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm4,%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* %15
%34 = load double, double* %24
%35 = fmul double %33, %34
%36 = load double, double* %25
%37 = fmul double %35, %36
%38 = load double, double* %26
%39 = load double, double* %16
%40 = load double, double* %24
%41 = fmul double %39, %40
%42 = load double, double* %25
%43 = fmul double %41, %42
%44 = load double, double* %14
%45 = fmul double %43, %44
%46 = call double @llvm.fmuladd.f64(double %37, double %38, double %45)
%47 = load double, double* %17
%48 = load double, double* %24
%49 = fmul double %47, %48
%50 = load double, double* %13
%51 = fmul double %49, %50
%52 = load double, double* %26
%53 = call double @llvm.fmuladd.f64(double %51, double %52, double %46)
%54 = load double, double* %18
%55 = load double, double* %24
%56 = fmul double %54, %55
%57 = load double, double* %13
%58 = fmul double %56, %57
%59 = load double, double* %14
%60 = call double @llvm.fmuladd.f64(double %58, double %59, double %53)
%61 = load double, double* %19
%62 = load double, double* %12
%63 = fmul double %61, %62
%64 = load double, double* %25
%65 = fmul double %63, %64
%66 = load double, double* %26
%67 = call double @llvm.fmuladd.f64(double %65, double %66, double %60)
%68 = load double, double* %20
%69 = load double, double* %12
%70 = fmul double %68, %69
%71 = load double, double* %25
%72 = fmul double %70, %71
%73 = load double, double* %14
%74 = call double @llvm.fmuladd.f64(double %72, double %73, double %67)
%75 = load double, double* %21
%76 = load double, double* %12
%77 = fmul double %75, %76
%78 = load double, double* %13
%79 = fmul double %77, %78
%80 = load double, double* %26
%81 = call double @llvm.fmuladd.f64(double %79, double %80, double %74)
%82 = load double, double* %22
%83 = load double, double* %12
%84 = fmul double %82, %83
%85 = load double, double* %13
%86 = fmul double %84, %85
%87 = load double, double* %14
%88 = call double @llvm.fmuladd.f64(double %86, double %87, double %81)
store double %88, double* %23
%89 = load double, double* %23
ret double %89
}

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 %12, %3
%16 = fmul double %13, %15
%17 = fmul double %12, %4
%18 = fmul double %13, %17
%19 = fmul double %18, %2
%20 = tail call double @llvm.fmuladd.f64(double %16, double %14, double %19)
%21 = fmul double %12, %5
%22 = fmul double %21, %1
%23 = tail call double @llvm.fmuladd.f64(double %22, double %14, double %20)
%24 = fmul double %12, %6
%25 = fmul double %24, %1
%26 = tail call double @llvm.fmuladd.f64(double %25, double %2, double %23)
%27 = fmul double %0, %7
%28 = fmul double %13, %27
%29 = tail call double @llvm.fmuladd.f64(double %28, double %14, double %26)
%30 = fmul double %0, %8
%31 = fmul double %13, %30
%32 = tail call double @llvm.fmuladd.f64(double %31, double %2, double %29)
%33 = fmul double %0, %9
%34 = fmul double %33, %1
%35 = tail call double @llvm.fmuladd.f64(double %34, double %14, double %32)
%36 = fmul double %0, %10
%37 = fmul double %36, %1
%38 = tail call double @llvm.fmuladd.f64(double %37, double %2, double %35)
ret double %38
}