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


x86 assembly (clang, -O0):
<mm_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  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x18(%rbp),%rax
mulsd  0x18(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%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  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x18(%rbp),%rax
mulsd  0x18(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mm_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 2
%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 0
%25 = load double, double* %24
%26 = load double*, double** %6
%27 = getelementptr inbounds double, double* %26, i64 1
%28 = load double, double* %27
%29 = load double*, double** %5
%30 = getelementptr inbounds double, double* %29, i64 1
%31 = load double, double* %30
%32 = load double*, double** %6
%33 = getelementptr inbounds double, double* %32, i64 3
%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
%39 = load double*, double** %5
%40 = getelementptr inbounds double, double* %39, i64 2
%41 = load double, double* %40
%42 = load double*, double** %6
%43 = getelementptr inbounds double, double* %42, i64 0
%44 = load double, double* %43
%45 = load double*, double** %5
%46 = getelementptr inbounds double, double* %45, i64 3
%47 = load double, double* %46
%48 = load double*, double** %6
%49 = getelementptr inbounds double, double* %48, i64 2
%50 = load double, double* %49
%51 = fmul double %47, %50
%52 = call double @llvm.fmuladd.f64(double %41, double %44, double %51)
%53 = load double*, double** %4
%54 = getelementptr inbounds double, double* %53, i64 2
store double %52, double* %54
%55 = load double*, double** %5
%56 = getelementptr inbounds double, double* %55, i64 2
%57 = load double, double* %56
%58 = load double*, double** %6
%59 = getelementptr inbounds double, double* %58, i64 1
%60 = load double, double* %59
%61 = load double*, double** %5
%62 = getelementptr inbounds double, double* %61, i64 3
%63 = load double, double* %62
%64 = load double*, double** %6
%65 = getelementptr inbounds double, double* %64, i64 3
%66 = load double, double* %65
%67 = fmul double %63, %66
%68 = call double @llvm.fmuladd.f64(double %57, double %60, double %67)
%69 = load double*, double** %4
%70 = getelementptr inbounds double, double* %69, i64 3
store double %68, double* %70
ret void
}

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