void addvecteur(float *res, float *vect1, float *vect2, float speed) {
  res[0] = vect1[0] + vect2[0] * speed;
  res[1] = vect1[1] + vect2[1] * speed;
  res[2] = vect1[2] + vect2[2] * speed;
}


x86 assembly (clang, -O0):
<addvecteur>:
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
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addvecteur>:
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 @addvecteur(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** %7
%13 = getelementptr inbounds float, float* %12, i64 0
%14 = load float, float* %13
%15 = load float, float* %8
%16 = call float @llvm.fmuladd.f32(float %14, 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** %7
%23 = getelementptr inbounds float, float* %22, i64 1
%24 = load float, float* %23
%25 = load float, float* %8
%26 = call float @llvm.fmuladd.f32(float %24, 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** %7
%33 = getelementptr inbounds float, float* %32, i64 2
%34 = load float, float* %33
%35 = load float, float* %8
%36 = call float @llvm.fmuladd.f32(float %34, 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 @addvecteur(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 %6, float %3, 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 %11, float %3, 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 %17, float %3, float %15)
%19 = getelementptr inbounds float, float* %0, i64 2
store float %18, float* %19
ret void
}