void routlm(double *v1, double *v2, double *v3, double la, double mu,
            double *r) {
  r[0] = (1 - la - mu) * v1[0] + la * v2[0] + mu * v3[0];
  r[1] = (1 - la - mu) * v1[1] + la * v2[1] + mu * v3[1];
  r[2] = (1 - la - mu) * v1[2] + la * v2[2] + mu * v3[2];
  return;
}


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

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

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

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