void rmvecteur(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):
<rmvecteur>:
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
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
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
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
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
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rmvecteur(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 = fneg float %14
%17 = call float @llvm.fmuladd.f32(float %16, float %15, float %11)
%18 = load float*, float** %5
%19 = getelementptr inbounds float, float* %18, i64 0
store float %17, float* %19
%20 = load float*, float** %6
%21 = getelementptr inbounds float, float* %20, i64 1
%22 = load float, float* %21
%23 = load float*, float** %7
%24 = getelementptr inbounds float, float* %23, i64 1
%25 = load float, float* %24
%26 = load float, float* %8
%27 = fneg float %25
%28 = call float @llvm.fmuladd.f32(float %27, float %26, float %22)
%29 = load float*, float** %5
%30 = getelementptr inbounds float, float* %29, i64 1
store float %28, float* %30
%31 = load float*, float** %6
%32 = getelementptr inbounds float, float* %31, i64 2
%33 = load float, float* %32
%34 = load float*, float** %7
%35 = getelementptr inbounds float, float* %34, i64 2
%36 = load float, float* %35
%37 = load float, float* %8
%38 = fneg float %36
%39 = call float @llvm.fmuladd.f32(float %38, float %37, float %33)
%40 = load float*, float** %5
%41 = getelementptr inbounds float, float* %40, i64 2
store float %39, float* %41
ret void
}

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