void corner_dttmm_uu_nt_2x2_lib4(double *A, double *B, double *C) {
  const int bs = 4;
  double a_0, a_1, b_0, b_1, c_00 = 0, c_01 = 0, c_11 = 0;
  a_0 = A[0 + bs * 0];
  b_0 = B[0 + bs * 0];
  b_1 = B[1 + bs * 0];
  c_00 += a_0 * b_0;
  c_01 += a_0 * b_1;
  a_0 = A[0 + bs * 1];
  a_1 = A[1 + bs * 1];
  b_1 = B[1 + bs * 1];
  c_01 += a_0 * b_1;
  c_11 += a_1 * b_1;
  C[0 + bs * 0] = c_00;
  C[0 + bs * 1] = c_01;
  C[1 + bs * 1] = c_11;
}


x86 assembly (clang, -O0):
<corner_dttmm_uu_nt_2x2_lib4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x4,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0x58(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x28(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<corner_dttmm_uu_nt_2x2_lib4>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
addsd  %xmm2,%xmm1
mulsd  0x8(%rsi),%xmm0
addsd  %xmm2,%xmm0
movupd 0x20(%rdi),%xmm2
movsd  0x28(%rsi),%xmm3
unpcklpd %xmm3,%xmm3
mulpd  %xmm2,%xmm3
movq   %xmm0,%xmm0
addpd  %xmm3,%xmm0
movsd  %xmm1,(%rdx)
movupd %xmm0,0x20(%rdx)
ret

LLVM IR (-O0):
define void @corner_dttmm_uu_nt_2x2_lib4(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
store i32 4, i32* %7
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %13
store double 0.000000e+00, double* %14
%15 = load double*, double** %4
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
store double %17, double* %8
%18 = load double*, double** %5
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
store double %20, double* %10
%21 = load double*, double** %5
%22 = getelementptr inbounds double, double* %21, i64 1
%23 = load double, double* %22
store double %23, double* %11
%24 = load double, double* %8
%25 = load double, double* %10
%26 = load double, double* %12
%27 = call double @llvm.fmuladd.f64(double %24, double %25, double %26)
store double %27, double* %12
%28 = load double, double* %8
%29 = load double, double* %11
%30 = load double, double* %13
%31 = call double @llvm.fmuladd.f64(double %28, double %29, double %30)
store double %31, double* %13
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 4
%34 = load double, double* %33
store double %34, double* %8
%35 = load double*, double** %4
%36 = getelementptr inbounds double, double* %35, i64 5
%37 = load double, double* %36
store double %37, double* %9
%38 = load double*, double** %5
%39 = getelementptr inbounds double, double* %38, i64 5
%40 = load double, double* %39
store double %40, double* %11
%41 = load double, double* %8
%42 = load double, double* %11
%43 = load double, double* %13
%44 = call double @llvm.fmuladd.f64(double %41, double %42, double %43)
store double %44, double* %13
%45 = load double, double* %9
%46 = load double, double* %11
%47 = load double, double* %14
%48 = call double @llvm.fmuladd.f64(double %45, double %46, double %47)
store double %48, double* %14
%49 = load double, double* %12
%50 = load double*, double** %6
%51 = getelementptr inbounds double, double* %50, i64 0
store double %49, double* %51
%52 = load double, double* %13
%53 = load double*, double** %6
%54 = getelementptr inbounds double, double* %53, i64 4
store double %52, double* %54
%55 = load double, double* %14
%56 = load double*, double** %6
%57 = getelementptr inbounds double, double* %56, i64 5
store double %55, double* %57
ret void
}

LLVM IR (-O2):
define void @corner_dttmm_uu_nt_2x2_lib4(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = tail call double @llvm.fmuladd.f64(double %4, double %5, double 0.000000e+00)
%9 = tail call double @llvm.fmuladd.f64(double %4, double %7, double 0.000000e+00)
%10 = getelementptr inbounds double, double* %0, i64 4
%11 = bitcast double* %10 to <2 x double>*
%12 = load <2 x double>, <2 x double>* %11
%13 = getelementptr inbounds double, double* %1, i64 5
%14 = load double, double* %13
%15 = insertelement <2 x double> poison, double %14, i64 0
%16 = shufflevector <2 x double> %15, <2 x double> poison, <2 x i32> zeroinitializer
%17 = insertelement <2 x double> <double poison, double 0.000000e+00>, double %9, i64 0
%18 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %12, <2 x double> %16, <2 x double> %17)
store double %8, double* %2
%19 = getelementptr inbounds double, double* %2, i64 4
%20 = bitcast double* %19 to <2 x double>*
store <2 x double> %18, <2 x double>* %20
ret void
}