void VecAddScalarMult3fv(float v[3], const float a[3], const float b[3],
                         float s) {
  v[0] = a[0] + (s * b[0]);
  v[1] = a[1] + (s * b[1]);
  v[2] = a[2] + (s * b[2]);
}


x86 assembly (clang, -O0):
<VecAddScalarMult3fv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
movss  -0x1c(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
movss  -0x1c(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm1
movss  -0x1c(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<VecAddScalarMult3fv>:
movss  (%rdx),%xmm1
mulss  %xmm0,%xmm1
addss  (%rsi),%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdx),%xmm1
mulss  %xmm0,%xmm1
addss  0x4(%rsi),%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rdx),%xmm0
addss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @VecAddScalarMult3fv(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2, float %3) {
%5 = load float, float* %1
%6 = load float, float* %2
%7 = tail call float @llvm.fmuladd.f32(float %3, float %6, float %5)
store float %7, float* %0
%8 = getelementptr inbounds float, float* %1, i64 1
%9 = load float, float* %8
%10 = getelementptr inbounds float, float* %2, i64 1
%11 = load float, float* %10
%12 = tail call float @llvm.fmuladd.f32(float %3, float %11, float %9)
%13 = getelementptr inbounds float, float* %0, i64 1
store float %12, float* %13
%14 = getelementptr inbounds float, float* %1, i64 2
%15 = load float, float* %14
%16 = getelementptr inbounds float, float* %2, i64 2
%17 = load float, float* %16
%18 = tail call float @llvm.fmuladd.f32(float %3, float %17, float %15)
%19 = getelementptr inbounds float, float* %0, i64 2
store float %18, float* %19
ret void
}