double dotabc(double a[3], double b[3], double c[3]) {
  return (b[0] - a[0]) * c[0] + (b[1] - a[1]) * c[1] + (b[2] - a[2]) * c[2];
}


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

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

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

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