double nlerp2(double *xin, double *f) {
  return (1.0 - xin[1]) * ((1.0 - xin[0]) * f[0] + xin[0] * f[1]) +
         xin[1] * ((1.0 - xin[0]) * f[2] + xin[0] * f[3]);
}


x86 assembly (clang, -O0):
<nlerp2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xee8(%rip),%xmm0
subsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0xed7(%rip),%xmm2
subsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm3
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0xe9d(%rip),%xmm3
subsd  (%rax),%xmm3
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm5
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm4
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @nlerp2(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 1
%7 = load double, double* %6
%8 = fsub double 1.000000e+00, %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = fsub double 1.000000e+00, %11
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = load double*, double** %3
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fmul double %18, %21
%23 = call double @llvm.fmuladd.f64(double %12, double %15, double %22)
%24 = load double*, double** %3
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = load double*, double** %3
%28 = getelementptr inbounds double, double* %27, i64 0
%29 = load double, double* %28
%30 = fsub double 1.000000e+00, %29
%31 = load double*, double** %4
%32 = getelementptr inbounds double, double* %31, i64 2
%33 = load double, double* %32
%34 = load double*, double** %3
%35 = getelementptr inbounds double, double* %34, i64 0
%36 = load double, double* %35
%37 = load double*, double** %4
%38 = getelementptr inbounds double, double* %37, i64 3
%39 = load double, double* %38
%40 = fmul double %36, %39
%41 = call double @llvm.fmuladd.f64(double %30, double %33, double %40)
%42 = fmul double %26, %41
%43 = call double @llvm.fmuladd.f64(double %8, double %23, double %42)
ret double %43
}

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