void mix3d(double *v1, double *v2, double fxn, double *v3) {
  double fxn_1 = 1.0F - fxn;
  v3[0] = v1[0] * fxn_1 + v2[0] * fxn;
  v3[1] = v1[1] * fxn_1 + v2[1] * fxn;
  v3[2] = v1[2] * fxn_1 + v2[2] * fxn;
}


x86 assembly (clang, -O0):
<mix3d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  0xee3(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x28(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x28(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x28(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mix3d>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  (%rsi),%xmm2
mulsd  %xmm0,%xmm2
movsd  (%rdi),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,(%rdx)
movsd  0x8(%rsi),%xmm2
mulsd  %xmm0,%xmm2
movsd  0x8(%rdi),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,0x8(%rdx)
mulsd  0x10(%rsi),%xmm0
mulsd  0x10(%rdi),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rdx)
ret

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

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