void mv_mul(double *t, double *x, double *y) {
  t[0] = x[0] * y[0] + x[1] * y[1];
  t[1] = x[2] * y[0] + x[3] * y[1];
  return;
}


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

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

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

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