double linearInterpolationQuadratic(double *fx, double x1, double x2, double y1,
                                    double y2, double x, double y) {
  double b1, b2;
  b1 = (x - x1) / (x2 - x1);
  b2 = (y - y1) / (y2 - y1);
  return (1 - b1) * (1 - b2) * fx[0] + (b1) * (1 - b2) * fx[1] +
         (1 - b1) * (b2)*fx[2] + (b1) * (b2)*fx[3];
}


x86 assembly (clang, -O0):
<linearInterpolationQuadratic>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe98(%rip),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  0xe8b(%rip),%xmm1
subsd  -0x48(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x40(%rbp),%xmm1
movsd  0xe6d(%rip),%xmm3
subsd  -0x48(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe4b(%rip),%xmm1
subsd  -0x40(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<linearInterpolationQuadratic>:
unpcklpd %xmm5,%xmm4
unpcklpd %xmm2,%xmm0
subpd  %xmm0,%xmm4
unpcklpd %xmm3,%xmm1
subpd  %xmm0,%xmm1
divpd  %xmm1,%xmm4
movapd 0xee0(%rip),%xmm1
subpd  %xmm4,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
movapd %xmm1,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm4,%xmm0
mulsd  0x8(%rdi),%xmm0
mulsd  (%rdi),%xmm2
addsd  %xmm0,%xmm2
movapd %xmm4,%xmm0
unpckhpd %xmm4,%xmm0
mulsd  %xmm0,%xmm1
mulsd  0x10(%rdi),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm4,%xmm0
mulsd  0x18(%rdi),%xmm0
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @linearInterpolationQuadratic(double* nocapture %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = insertelement <2 x double> poison, double %5, i64 0
%9 = insertelement <2 x double> %8, double %6, i64 1
%10 = insertelement <2 x double> poison, double %1, i64 0
%11 = insertelement <2 x double> %10, double %3, i64 1
%12 = fsub <2 x double> %9, %11
%13 = insertelement <2 x double> poison, double %2, i64 0
%14 = insertelement <2 x double> %13, double %4, i64 1
%15 = fsub <2 x double> %14, %11
%16 = fdiv <2 x double> %12, %15
%17 = fsub <2 x double> <double 1.000000e+00, double 1.000000e+00>, %16
%18 = extractelement <2 x double> %17, i64 0
%19 = extractelement <2 x double> %17, i64 1
%20 = fmul double %18, %19
%21 = load double, double* %0
%22 = extractelement <2 x double> %16, i64 0
%23 = fmul double %22, %19
%24 = getelementptr inbounds double, double* %0, i64 1
%25 = load double, double* %24
%26 = fmul double %23, %25
%27 = tail call double @llvm.fmuladd.f64(double %20, double %21, double %26)
%28 = extractelement <2 x double> %16, i64 1
%29 = fmul double %18, %28
%30 = getelementptr inbounds double, double* %0, i64 2
%31 = load double, double* %30
%32 = tail call double @llvm.fmuladd.f64(double %29, double %31, double %27)
%33 = fmul double %22, %28
%34 = getelementptr inbounds double, double* %0, i64 3
%35 = load double, double* %34
%36 = tail call double @llvm.fmuladd.f64(double %33, double %35, double %32)
ret double %36
}