void kernel_dgemm_nn_2x2_vs_lib4(int km, int kn, int kmax, double *A, double *B,
                                 int sdb, double *C, double *D, int alg, int tc,
                                 int td) {
  if (kmax <= 0)
    return;
  const int bs = 4;
  int k;
  double a_0, a_1, b_0, b_1, c_00 = 0, c_01 = 0, c_10 = 0, c_11 = 0;
  for (k = 0; k < kmax - 3; k += 4) {
    a_0 = A[0 + bs * 0];
    a_1 = A[1 + bs * 0];
    b_0 = B[0 + bs * 0];
    b_1 = B[0 + bs * 1];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    a_0 = A[0 + bs * 1];
    a_1 = A[1 + bs * 1];
    b_0 = B[1 + bs * 0];
    b_1 = B[1 + bs * 1];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    a_0 = A[0 + bs * 2];
    a_1 = A[1 + bs * 2];
    b_0 = B[2 + bs * 0];
    b_1 = B[2 + bs * 1];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    a_0 = A[0 + bs * 3];
    a_1 = A[1 + bs * 3];
    b_0 = B[3 + bs * 0];
    b_1 = B[3 + bs * 1];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    A += 16;
    B += 4 * sdb;
  }
  for (; k < kmax; k++) {
    a_0 = A[0 + bs * 0];
    a_1 = A[1 + bs * 0];
    b_0 = B[0 + bs * 0];
    b_1 = B[0 + bs * 1];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    A += 4;
    B += 1;
  }
  double d_00, d_01, d_10, d_11;
  if (alg == 0) {
    if (td == 0) {
      goto store_n;
    } else {
      goto store_t;
    }
  } else {
    if (tc == 0) {
      d_00 = C[0 + bs * 0];
      d_10 = C[1 + bs * 0];
      d_01 = C[0 + bs * 1];
      d_11 = C[1 + bs * 1];
    } else {
      d_00 = C[0 + bs * 0];
      d_01 = C[1 + bs * 0];
      d_10 = C[0 + bs * 1];
      d_11 = C[1 + bs * 1];
    }
    if (alg == 1) {
      c_00 = d_00 + c_00;
      c_10 = d_10 + c_10;
      c_01 = d_01 + c_01;
      c_11 = d_11 + c_11;
    } else {
      c_00 = d_00 - c_00;
      c_10 = d_10 - c_10;
      c_01 = d_01 - c_01;
      c_11 = d_11 - c_11;
    }
    if (td == 0) {
      goto store_n;
    } else {
      goto store_t;
    }
  }
store_n:
  if (km >= 2) {
    D[0 + bs * 0] = c_00;
    D[1 + bs * 0] = c_10;
    if (kn >= 2) {
      D[0 + bs * 1] = c_01;
      D[1 + bs * 1] = c_11;
    }
  } else {
    D[0 + bs * 0] = c_00;
    if (kn >= 2) {
      D[0 + bs * 1] = c_01;
    }
  }
  return;
store_t:
  if (kn >= 2) {
    D[0 + bs * 0] = c_00;
    D[1 + bs * 0] = c_01;
    if (km >= 2) {
      D[0 + bs * 1] = c_10;
      D[1 + bs * 1] = c_11;
    }
  } else {
    D[0 + bs * 0] = c_00;
    if (km >= 2) {
      D[0 + bs * 1] = c_10;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<kernel_dgemm_nn_2x2_vs_lib4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     113d <kernel_dgemm_nn_2x2_vs_lib4+0x3d>
jmp    1777 <kernel_dgemm_nn_2x2_vs_lib4+0x677>
movl   $0x4,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    144e <kernel_dgemm_nn_2x2_vs_lib4+0x34e>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x48(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x60(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x68(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x38(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x18(%rbp)
mov    -0x24(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x2c(%rbp)
jmp    116b <kernel_dgemm_nn_2x2_vs_lib4+0x6b>
jmp    1453 <kernel_dgemm_nn_2x2_vs_lib4+0x353>
mov    -0x2c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    152b <kernel_dgemm_nn_2x2_vs_lib4+0x42b>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1453 <kernel_dgemm_nn_2x2_vs_lib4+0x353>
cmpl   $0x0,0x20(%rbp)
jne    1549 <kernel_dgemm_nn_2x2_vs_lib4+0x449>
cmpl   $0x0,0x30(%rbp)
jne    1544 <kernel_dgemm_nn_2x2_vs_lib4+0x444>
jmp    1679 <kernel_dgemm_nn_2x2_vs_lib4+0x579>
jmp    16f8 <kernel_dgemm_nn_2x2_vs_lib4+0x5f8>
cmpl   $0x0,0x28(%rbp)
jne    1595 <kernel_dgemm_nn_2x2_vs_lib4+0x495>
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    15d2 <kernel_dgemm_nn_2x2_vs_lib4+0x4d2>
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
cmpl   $0x1,0x20(%rbp)
jne    1623 <kernel_dgemm_nn_2x2_vs_lib4+0x523>
movsd  -0x78(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x80(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    1665 <kernel_dgemm_nn_2x2_vs_lib4+0x565>
movsd  -0x78(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x80(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
subsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
cmpl   $0x0,0x30(%rbp)
jne    1674 <kernel_dgemm_nn_2x2_vs_lib4+0x574>
jmp    1679 <kernel_dgemm_nn_2x2_vs_lib4+0x579>
jmp    16f8 <kernel_dgemm_nn_2x2_vs_lib4+0x5f8>
cmpl   $0x2,-0x4(%rbp)
jl     16c9 <kernel_dgemm_nn_2x2_vs_lib4+0x5c9>
movsd  -0x58(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x68(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
cmpl   $0x2,-0x8(%rbp)
jl     16c4 <kernel_dgemm_nn_2x2_vs_lib4+0x5c4>
movsd  -0x60(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0x70(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,0x28(%rax)
jmp    16f3 <kernel_dgemm_nn_2x2_vs_lib4+0x5f3>
movsd  -0x58(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,(%rax)
cmpl   $0x2,-0x8(%rbp)
jl     16ee <kernel_dgemm_nn_2x2_vs_lib4+0x5ee>
movsd  -0x60(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,0x20(%rax)
jmp    16f3 <kernel_dgemm_nn_2x2_vs_lib4+0x5f3>
jmp    1777 <kernel_dgemm_nn_2x2_vs_lib4+0x677>
cmpl   $0x2,-0x8(%rbp)
jl     1748 <kernel_dgemm_nn_2x2_vs_lib4+0x648>
movsd  -0x58(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x60(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
cmpl   $0x2,-0x4(%rbp)
jl     1743 <kernel_dgemm_nn_2x2_vs_lib4+0x643>
movsd  -0x68(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0x70(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,0x28(%rax)
jmp    1772 <kernel_dgemm_nn_2x2_vs_lib4+0x672>
movsd  -0x58(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,(%rax)
cmpl   $0x2,-0x4(%rbp)
jl     176d <kernel_dgemm_nn_2x2_vs_lib4+0x66d>
movsd  -0x68(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,0x20(%rax)
jmp    1772 <kernel_dgemm_nn_2x2_vs_lib4+0x672>
jmp    1777 <kernel_dgemm_nn_2x2_vs_lib4+0x677>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dgemm_nn_2x2_vs_lib4>:
test   %edx,%edx
jle    12f2 <kernel_dgemm_nn_2x2_vs_lib4+0x1f2>
cmp    $0x4,%edx
jb     1202 <kernel_dgemm_nn_2x2_vs_lib4+0x102>
lea    -0x3(%rdx),%r10d
shl    $0x2,%r9d
movslq %r9d,%r9
shl    $0x3,%r9
xorpd  %xmm4,%xmm4
xor    %eax,%eax
xorpd  %xmm5,%xmm5
nopw   0x0(%rax,%rax,1)
movupd (%rcx),%xmm7
movupd 0x20(%rcx),%xmm3
movupd 0x40(%rcx),%xmm9
movupd 0x60(%rcx),%xmm8
movsd  (%r8),%xmm0
movsd  0x8(%r8),%xmm6
movsd  0x10(%r8),%xmm2
movsd  0x18(%r8),%xmm1
unpcklpd %xmm0,%xmm0
mulpd  %xmm7,%xmm0
addpd  %xmm5,%xmm0
movsd  0x20(%r8),%xmm5
unpcklpd %xmm5,%xmm5
mulpd  %xmm7,%xmm5
addpd  %xmm4,%xmm5
unpcklpd %xmm6,%xmm6
mulpd  %xmm3,%xmm6
addpd  %xmm0,%xmm6
movsd  0x28(%r8),%xmm0
unpcklpd %xmm0,%xmm0
mulpd  %xmm3,%xmm0
addpd  %xmm5,%xmm0
unpcklpd %xmm2,%xmm2
mulpd  %xmm9,%xmm2
addpd  %xmm6,%xmm2
movsd  0x30(%r8),%xmm6
unpcklpd %xmm6,%xmm6
mulpd  %xmm9,%xmm6
addpd  %xmm0,%xmm6
unpcklpd %xmm1,%xmm1
mulpd  %xmm8,%xmm1
movapd %xmm1,%xmm5
addpd  %xmm2,%xmm5
movsd  0x38(%r8),%xmm0
unpcklpd %xmm0,%xmm0
mulpd  %xmm8,%xmm0
movapd %xmm0,%xmm4
addpd  %xmm6,%xmm4
sub    $0xffffffffffffff80,%rcx
add    $0x4,%eax
add    %r9,%r8
cmp    %r10d,%eax
jl     1130 <kernel_dgemm_nn_2x2_vs_lib4+0x30>
addpd  %xmm6,%xmm0
addpd  %xmm2,%xmm1
mov    %edx,%eax
and    $0xfffffffc,%eax
jmp    120c <kernel_dgemm_nn_2x2_vs_lib4+0x10c>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
xorpd  %xmm1,%xmm1
mov    0x18(%rsp),%r9d
cmp    %edx,%eax
jge    1275 <kernel_dgemm_nn_2x2_vs_lib4+0x175>
sub    %eax,%edx
xor    %eax,%eax
nopl   0x0(%rax)
movapd %xmm1,%xmm2
movapd %xmm0,%xmm3
movupd (%rcx),%xmm0
movsd  (%r8,%rax,8),%xmm4
movsd  0x20(%r8,%rax,8),%xmm5
unpcklpd %xmm4,%xmm4
mulpd  %xmm0,%xmm4
movapd %xmm4,%xmm1
addpd  %xmm2,%xmm1
unpcklpd %xmm5,%xmm5
mulpd  %xmm0,%xmm5
movapd %xmm5,%xmm0
addpd  %xmm3,%xmm0
add    $0x20,%rcx
add    $0x1,%rax
cmp    %eax,%edx
jne    1220 <kernel_dgemm_nn_2x2_vs_lib4+0x120>
addpd  %xmm3,%xmm5
addpd  %xmm2,%xmm4
movapd %xmm5,%xmm0
movapd %xmm4,%xmm1
mov    0x28(%rsp),%r10d
mov    0x10(%rsp),%r8
test   %r9d,%r9d
je     12c8 <kernel_dgemm_nn_2x2_vs_lib4+0x1c8>
mov    0x8(%rsp),%rax
lea    0x20(%rax),%rcx
lea    0x8(%rax),%rdx
cmpl   $0x0,0x20(%rsp)
movsd  (%rax),%xmm2
movsd  0x28(%rax),%xmm3
mov    %rcx,%rax
cmove  %rdx,%rax
movsd  (%rax),%xmm5
cmove  %rcx,%rdx
movsd  (%rdx),%xmm4
unpcklpd %xmm5,%xmm2
cmp    $0x1,%r9d
jne    12f3 <kernel_dgemm_nn_2x2_vs_lib4+0x1f3>
addpd  %xmm2,%xmm1
unpcklpd %xmm3,%xmm4
addpd  %xmm4,%xmm0
test   %r10d,%r10d
je     130c <kernel_dgemm_nn_2x2_vs_lib4+0x20c>
movapd %xmm1,%xmm3
unpckhpd %xmm0,%xmm3
movapd %xmm0,%xmm2
movapd %xmm3,%xmm0
movsd  %xmm1,(%r8)
cmp    $0x2,%esi
jl     1337 <kernel_dgemm_nn_2x2_vs_lib4+0x237>
movsd  %xmm2,0x8(%r8)
cmp    $0x1,%edi
jg     1321 <kernel_dgemm_nn_2x2_vs_lib4+0x221>
ret
subpd  %xmm1,%xmm2
unpcklpd %xmm3,%xmm4
subpd  %xmm0,%xmm4
movapd %xmm4,%xmm0
movapd %xmm2,%xmm1
test   %r10d,%r10d
jne    12cd <kernel_dgemm_nn_2x2_vs_lib4+0x1cd>
movlpd %xmm1,(%r8)
cmp    $0x2,%edi
jl     133e <kernel_dgemm_nn_2x2_vs_lib4+0x23e>
movhpd %xmm1,0x8(%r8)
cmp    $0x1,%esi
jle    12f2 <kernel_dgemm_nn_2x2_vs_lib4+0x1f2>
movlpd %xmm0,0x20(%r8)
unpckhpd %xmm0,%xmm0
mov    $0x5,%eax
movsd  %xmm0,(%r8,%rax,8)
ret
cmp    $0x1,%edi
jle    12f2 <kernel_dgemm_nn_2x2_vs_lib4+0x1f2>
jmp    1343 <kernel_dgemm_nn_2x2_vs_lib4+0x243>
cmp    $0x1,%esi
jle    12f2 <kernel_dgemm_nn_2x2_vs_lib4+0x1f2>
mov    $0x4,%eax
movsd  %xmm0,(%r8,%rax,8)
ret

LLVM IR (-O0):
define void @kernel_dgemm_nn_2x2_vs_lib4(i32 %0, i32 %1, i32 %2, double* %3, double* %4, i32 %5, double* %6, double* %7, i32 %8, i32 %9, i32 %10) {
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca double*
%16 = alloca double*
%17 = alloca i32
%18 = alloca double*
%19 = alloca double*
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
store i32 %0, i32* %12
store i32 %1, i32* %13
store i32 %2, i32* %14
store double* %3, double** %15
store double* %4, double** %16
store i32 %5, i32* %17
store double* %6, double** %18
store double* %7, double** %19
store i32 %8, i32* %20
store i32 %9, i32* %21
store i32 %10, i32* %22
%37 = load i32, i32* %14
%38 = icmp sle i32 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %11
br label %345
40: ; preds = %11
store i32 4, i32* %23
store double 0.000000e+00, double* %29
store double 0.000000e+00, double* %30
store double 0.000000e+00, double* %31
store double 0.000000e+00, double* %32
store i32 0, i32* %24
br label %41
41: ; preds = %166, %40
%42 = load i32, i32* %24
%43 = load i32, i32* %14
%44 = sub nsw i32 %43, 3
%45 = icmp slt i32 %42, %44
br i1 %45, label %46, label %169
46: ; preds = %41
%47 = load double*, double** %15
%48 = getelementptr inbounds double, double* %47, i64 0
%49 = load double, double* %48
store double %49, double* %25
%50 = load double*, double** %15
%51 = getelementptr inbounds double, double* %50, i64 1
%52 = load double, double* %51
store double %52, double* %26
%53 = load double*, double** %16
%54 = getelementptr inbounds double, double* %53, i64 0
%55 = load double, double* %54
store double %55, double* %27
%56 = load double*, double** %16
%57 = getelementptr inbounds double, double* %56, i64 4
%58 = load double, double* %57
store double %58, double* %28
%59 = load double, double* %25
%60 = load double, double* %27
%61 = load double, double* %29
%62 = call double @llvm.fmuladd.f64(double %59, double %60, double %61)
store double %62, double* %29
%63 = load double, double* %26
%64 = load double, double* %27
%65 = load double, double* %31
%66 = call double @llvm.fmuladd.f64(double %63, double %64, double %65)
store double %66, double* %31
%67 = load double, double* %25
%68 = load double, double* %28
%69 = load double, double* %30
%70 = call double @llvm.fmuladd.f64(double %67, double %68, double %69)
store double %70, double* %30
%71 = load double, double* %26
%72 = load double, double* %28
%73 = load double, double* %32
%74 = call double @llvm.fmuladd.f64(double %71, double %72, double %73)
store double %74, double* %32
%75 = load double*, double** %15
%76 = getelementptr inbounds double, double* %75, i64 4
%77 = load double, double* %76
store double %77, double* %25
%78 = load double*, double** %15
%79 = getelementptr inbounds double, double* %78, i64 5
%80 = load double, double* %79
store double %80, double* %26
%81 = load double*, double** %16
%82 = getelementptr inbounds double, double* %81, i64 1
%83 = load double, double* %82
store double %83, double* %27
%84 = load double*, double** %16
%85 = getelementptr inbounds double, double* %84, i64 5
%86 = load double, double* %85
store double %86, double* %28
%87 = load double, double* %25
%88 = load double, double* %27
%89 = load double, double* %29
%90 = call double @llvm.fmuladd.f64(double %87, double %88, double %89)
store double %90, double* %29
%91 = load double, double* %26
%92 = load double, double* %27
%93 = load double, double* %31
%94 = call double @llvm.fmuladd.f64(double %91, double %92, double %93)
store double %94, double* %31
%95 = load double, double* %25
%96 = load double, double* %28
%97 = load double, double* %30
%98 = call double @llvm.fmuladd.f64(double %95, double %96, double %97)
store double %98, double* %30
%99 = load double, double* %26
%100 = load double, double* %28
%101 = load double, double* %32
%102 = call double @llvm.fmuladd.f64(double %99, double %100, double %101)
store double %102, double* %32
%103 = load double*, double** %15
%104 = getelementptr inbounds double, double* %103, i64 8
%105 = load double, double* %104
store double %105, double* %25
%106 = load double*, double** %15
%107 = getelementptr inbounds double, double* %106, i64 9
%108 = load double, double* %107
store double %108, double* %26
%109 = load double*, double** %16
%110 = getelementptr inbounds double, double* %109, i64 2
%111 = load double, double* %110
store double %111, double* %27
%112 = load double*, double** %16
%113 = getelementptr inbounds double, double* %112, i64 6
%114 = load double, double* %113
store double %114, double* %28
%115 = load double, double* %25
%116 = load double, double* %27
%117 = load double, double* %29
%118 = call double @llvm.fmuladd.f64(double %115, double %116, double %117)
store double %118, double* %29
%119 = load double, double* %26
%120 = load double, double* %27
%121 = load double, double* %31
%122 = call double @llvm.fmuladd.f64(double %119, double %120, double %121)
store double %122, double* %31
%123 = load double, double* %25
%124 = load double, double* %28
%125 = load double, double* %30
%126 = call double @llvm.fmuladd.f64(double %123, double %124, double %125)
store double %126, double* %30
%127 = load double, double* %26
%128 = load double, double* %28
%129 = load double, double* %32
%130 = call double @llvm.fmuladd.f64(double %127, double %128, double %129)
store double %130, double* %32
%131 = load double*, double** %15
%132 = getelementptr inbounds double, double* %131, i64 12
%133 = load double, double* %132
store double %133, double* %25
%134 = load double*, double** %15
%135 = getelementptr inbounds double, double* %134, i64 13
%136 = load double, double* %135
store double %136, double* %26
%137 = load double*, double** %16
%138 = getelementptr inbounds double, double* %137, i64 3
%139 = load double, double* %138
store double %139, double* %27
%140 = load double*, double** %16
%141 = getelementptr inbounds double, double* %140, i64 7
%142 = load double, double* %141
store double %142, double* %28
%143 = load double, double* %25
%144 = load double, double* %27
%145 = load double, double* %29
%146 = call double @llvm.fmuladd.f64(double %143, double %144, double %145)
store double %146, double* %29
%147 = load double, double* %26
%148 = load double, double* %27
%149 = load double, double* %31
%150 = call double @llvm.fmuladd.f64(double %147, double %148, double %149)
store double %150, double* %31
%151 = load double, double* %25
%152 = load double, double* %28
%153 = load double, double* %30
%154 = call double @llvm.fmuladd.f64(double %151, double %152, double %153)
store double %154, double* %30
%155 = load double, double* %26
%156 = load double, double* %28
%157 = load double, double* %32
%158 = call double @llvm.fmuladd.f64(double %155, double %156, double %157)
store double %158, double* %32
%159 = load double*, double** %15
%160 = getelementptr inbounds double, double* %159, i64 16
store double* %160, double** %15
%161 = load i32, i32* %17
%162 = mul nsw i32 4, %161
%163 = load double*, double** %16
%164 = sext i32 %162 to i64
%165 = getelementptr inbounds double, double* %163, i64 %164
store double* %165, double** %16
br label %166
166: ; preds = %46
%167 = load i32, i32* %24
%168 = add nsw i32 %167, 4
store i32 %168, i32* %24
br label %41
169: ; preds = %41
br label %170
170: ; preds = %207, %169
%171 = load i32, i32* %24
%172 = load i32, i32* %14
%173 = icmp slt i32 %171, %172
br i1 %173, label %174, label %210
174: ; preds = %170
%175 = load double*, double** %15
%176 = getelementptr inbounds double, double* %175, i64 0
%177 = load double, double* %176
store double %177, double* %25
%178 = load double*, double** %15
%179 = getelementptr inbounds double, double* %178, i64 1
%180 = load double, double* %179
store double %180, double* %26
%181 = load double*, double** %16
%182 = getelementptr inbounds double, double* %181, i64 0
%183 = load double, double* %182
store double %183, double* %27
%184 = load double*, double** %16
%185 = getelementptr inbounds double, double* %184, i64 4
%186 = load double, double* %185
store double %186, double* %28
%187 = load double, double* %25
%188 = load double, double* %27
%189 = load double, double* %29
%190 = call double @llvm.fmuladd.f64(double %187, double %188, double %189)
store double %190, double* %29
%191 = load double, double* %26
%192 = load double, double* %27
%193 = load double, double* %31
%194 = call double @llvm.fmuladd.f64(double %191, double %192, double %193)
store double %194, double* %31
%195 = load double, double* %25
%196 = load double, double* %28
%197 = load double, double* %30
%198 = call double @llvm.fmuladd.f64(double %195, double %196, double %197)
store double %198, double* %30
%199 = load double, double* %26
%200 = load double, double* %28
%201 = load double, double* %32
%202 = call double @llvm.fmuladd.f64(double %199, double %200, double %201)
store double %202, double* %32
%203 = load double*, double** %15
%204 = getelementptr inbounds double, double* %203, i64 4
store double* %204, double** %15
%205 = load double*, double** %16
%206 = getelementptr inbounds double, double* %205, i64 1
store double* %206, double** %16
br label %207
207: ; preds = %174
%208 = load i32, i32* %24
%209 = add nsw i32 %208, 1
store i32 %209, i32* %24
br label %170
210: ; preds = %170
%211 = load i32, i32* %20
%212 = icmp eq i32 %211, 0
br i1 %212, label %213, label %218
213: ; preds = %210
%214 = load i32, i32* %22
%215 = icmp eq i32 %214, 0
br i1 %215, label %216, label %217
216: ; preds = %213
br label %281
217: ; preds = %213
br label %313
218: ; preds = %210
%219 = load i32, i32* %21
%220 = icmp eq i32 %219, 0
br i1 %220, label %221, label %234
221: ; preds = %218
%222 = load double*, double** %18
%223 = getelementptr inbounds double, double* %222, i64 0
%224 = load double, double* %223
store double %224, double* %33
%225 = load double*, double** %18
%226 = getelementptr inbounds double, double* %225, i64 1
%227 = load double, double* %226
store double %227, double* %35
%228 = load double*, double** %18
%229 = getelementptr inbounds double, double* %228, i64 4
%230 = load double, double* %229
store double %230, double* %34
%231 = load double*, double** %18
%232 = getelementptr inbounds double, double* %231, i64 5
%233 = load double, double* %232
store double %233, double* %36
br label %247
234: ; preds = %218
%235 = load double*, double** %18
%236 = getelementptr inbounds double, double* %235, i64 0
%237 = load double, double* %236
store double %237, double* %33
%238 = load double*, double** %18
%239 = getelementptr inbounds double, double* %238, i64 1
%240 = load double, double* %239
store double %240, double* %34
%241 = load double*, double** %18
%242 = getelementptr inbounds double, double* %241, i64 4
%243 = load double, double* %242
store double %243, double* %35
%244 = load double*, double** %18
%245 = getelementptr inbounds double, double* %244, i64 5
%246 = load double, double* %245
store double %246, double* %36
br label %247
247: ; preds = %234, %221
%248 = load i32, i32* %20
%249 = icmp eq i32 %248, 1
br i1 %249, label %250, label %263
250: ; preds = %247
%251 = load double, double* %33
%252 = load double, double* %29
%253 = fadd double %251, %252
store double %253, double* %29
%254 = load double, double* %35
%255 = load double, double* %31
%256 = fadd double %254, %255
store double %256, double* %31
%257 = load double, double* %34
%258 = load double, double* %30
%259 = fadd double %257, %258
store double %259, double* %30
%260 = load double, double* %36
%261 = load double, double* %32
%262 = fadd double %260, %261
store double %262, double* %32
br label %276
263: ; preds = %247
%264 = load double, double* %33
%265 = load double, double* %29
%266 = fsub double %264, %265
store double %266, double* %29
%267 = load double, double* %35
%268 = load double, double* %31
%269 = fsub double %267, %268
store double %269, double* %31
%270 = load double, double* %34
%271 = load double, double* %30
%272 = fsub double %270, %271
store double %272, double* %30
%273 = load double, double* %36
%274 = load double, double* %32
%275 = fsub double %273, %274
store double %275, double* %32
br label %276
276: ; preds = %263, %250
%277 = load i32, i32* %22
%278 = icmp eq i32 %277, 0
br i1 %278, label %279, label %280
279: ; preds = %276
br label %281
280: ; preds = %276
br label %313
281: ; preds = %279, %216
%282 = load i32, i32* %12
%283 = icmp sge i32 %282, 2
br i1 %283, label %284, label %301
284: ; preds = %281
%285 = load double, double* %29
%286 = load double*, double** %19
%287 = getelementptr inbounds double, double* %286, i64 0
store double %285, double* %287
%288 = load double, double* %31
%289 = load double*, double** %19
%290 = getelementptr inbounds double, double* %289, i64 1
store double %288, double* %290
%291 = load i32, i32* %13
%292 = icmp sge i32 %291, 2
br i1 %292, label %293, label %300
293: ; preds = %284
%294 = load double, double* %30
%295 = load double*, double** %19
%296 = getelementptr inbounds double, double* %295, i64 4
store double %294, double* %296
%297 = load double, double* %32
%298 = load double*, double** %19
%299 = getelementptr inbounds double, double* %298, i64 5
store double %297, double* %299
br label %300
300: ; preds = %293, %284
br label %312
301: ; preds = %281
%302 = load double, double* %29
%303 = load double*, double** %19
%304 = getelementptr inbounds double, double* %303, i64 0
store double %302, double* %304
%305 = load i32, i32* %13
%306 = icmp sge i32 %305, 2
br i1 %306, label %307, label %311
307: ; preds = %301
%308 = load double, double* %30
%309 = load double*, double** %19
%310 = getelementptr inbounds double, double* %309, i64 4
store double %308, double* %310
br label %311
311: ; preds = %307, %301
br label %312
312: ; preds = %311, %300
br label %345
313: ; preds = %280, %217
%314 = load i32, i32* %13
%315 = icmp sge i32 %314, 2
br i1 %315, label %316, label %333
316: ; preds = %313
%317 = load double, double* %29
%318 = load double*, double** %19
%319 = getelementptr inbounds double, double* %318, i64 0
store double %317, double* %319
%320 = load double, double* %30
%321 = load double*, double** %19
%322 = getelementptr inbounds double, double* %321, i64 1
store double %320, double* %322
%323 = load i32, i32* %12
%324 = icmp sge i32 %323, 2
br i1 %324, label %325, label %332
325: ; preds = %316
%326 = load double, double* %31
%327 = load double*, double** %19
%328 = getelementptr inbounds double, double* %327, i64 4
store double %326, double* %328
%329 = load double, double* %32
%330 = load double*, double** %19
%331 = getelementptr inbounds double, double* %330, i64 5
store double %329, double* %331
br label %332
332: ; preds = %325, %316
br label %344
333: ; preds = %313
%334 = load double, double* %29
%335 = load double*, double** %19
%336 = getelementptr inbounds double, double* %335, i64 0
store double %334, double* %336
%337 = load i32, i32* %12
%338 = icmp sge i32 %337, 2
br i1 %338, label %339, label %343
339: ; preds = %333
%340 = load double, double* %31
%341 = load double*, double** %19
%342 = getelementptr inbounds double, double* %341, i64 4
store double %340, double* %342
br label %343
343: ; preds = %339, %333
br label %344
344: ; preds = %343, %332
br label %345
345: ; preds = %344, %312, %39
ret void
}

LLVM IR (-O2):
define void @kernel_dgemm_nn_2x2_vs_lib4(i32 %0, i32 %1, i32 %2, double* nocapture %3, double* nocapture %4, i32 %5, double* nocapture %6, double* nocapture writeonly %7, i32 %8, i32 %9, i32 %10) {
%12 = icmp slt i32 %2, 1
br i1 %12, label %194, label %13
13: ; preds = %11
%14 = add nsw i32 %2, -3
%15 = icmp ugt i32 %2, 3
br i1 %15, label %16, label %29
16: ; preds = %13
%17 = shl nsw i32 %5, 2
%18 = sext i32 %17 to i64
br label %36
19: ; preds = %36
%20 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %43, <2 x double> %51, <2 x double> %40)
%21 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %55, <2 x double> %64, <2 x double> %20)
%22 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %68, <2 x double> %77, <2 x double> %21)
%23 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %81, <2 x double> %90, <2 x double> %22)
%24 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %43, <2 x double> %48, <2 x double> %41)
%25 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %55, <2 x double> %61, <2 x double> %24)
%26 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %68, <2 x double> %74, <2 x double> %25)
%27 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %81, <2 x double> %87, <2 x double> %26)
%28 = and i32 %2, -4
br label %29
29: ; preds = %19, %13
%30 = phi double* [ %4, %13 ], [ %93, %19 ]
%31 = phi double* [ %3, %13 ], [ %92, %19 ]
%32 = phi i32 [ 0, %13 ], [ %28, %19 ]
%33 = phi <2 x double> [ zeroinitializer, %13 ], [ %23, %19 ]
%34 = phi <2 x double> [ zeroinitializer, %13 ], [ %27, %19 ]
%35 = icmp slt i32 %32, %2
br i1 %35, label %96, label %120
36: ; preds = %16, %36
%37 = phi i32 [ 0, %16 ], [ %94, %36 ]
%38 = phi double* [ %3, %16 ], [ %92, %36 ]
%39 = phi double* [ %4, %16 ], [ %93, %36 ]
%40 = phi <2 x double> [ zeroinitializer, %16 ], [ %91, %36 ]
%41 = phi <2 x double> [ zeroinitializer, %16 ], [ %88, %36 ]
%42 = bitcast double* %38 to <2 x double>*
%43 = load <2 x double>, <2 x double>* %42
%44 = load double, double* %39
%45 = getelementptr inbounds double, double* %39, i64 4
%46 = load double, double* %45
%47 = insertelement <2 x double> poison, double %44, i64 0
%48 = shufflevector <2 x double> %47, <2 x double> poison, <2 x i32> zeroinitializer
%49 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %43, <2 x double> %48, <2 x double> %41)
%50 = insertelement <2 x double> poison, double %46, i64 0
%51 = shufflevector <2 x double> %50, <2 x double> poison, <2 x i32> zeroinitializer
%52 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %43, <2 x double> %51, <2 x double> %40)
%53 = getelementptr inbounds double, double* %38, i64 4
%54 = bitcast double* %53 to <2 x double>*
%55 = load <2 x double>, <2 x double>* %54
%56 = getelementptr inbounds double, double* %39, i64 1
%57 = load double, double* %56
%58 = getelementptr inbounds double, double* %39, i64 5
%59 = load double, double* %58
%60 = insertelement <2 x double> poison, double %57, i64 0
%61 = shufflevector <2 x double> %60, <2 x double> poison, <2 x i32> zeroinitializer
%62 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %55, <2 x double> %61, <2 x double> %49)
%63 = insertelement <2 x double> poison, double %59, i64 0
%64 = shufflevector <2 x double> %63, <2 x double> poison, <2 x i32> zeroinitializer
%65 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %55, <2 x double> %64, <2 x double> %52)
%66 = getelementptr inbounds double, double* %38, i64 8
%67 = bitcast double* %66 to <2 x double>*
%68 = load <2 x double>, <2 x double>* %67
%69 = getelementptr inbounds double, double* %39, i64 2
%70 = load double, double* %69
%71 = getelementptr inbounds double, double* %39, i64 6
%72 = load double, double* %71
%73 = insertelement <2 x double> poison, double %70, i64 0
%74 = shufflevector <2 x double> %73, <2 x double> poison, <2 x i32> zeroinitializer
%75 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %68, <2 x double> %74, <2 x double> %62)
%76 = insertelement <2 x double> poison, double %72, i64 0
%77 = shufflevector <2 x double> %76, <2 x double> poison, <2 x i32> zeroinitializer
%78 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %68, <2 x double> %77, <2 x double> %65)
%79 = getelementptr inbounds double, double* %38, i64 12
%80 = bitcast double* %79 to <2 x double>*
%81 = load <2 x double>, <2 x double>* %80
%82 = getelementptr inbounds double, double* %39, i64 3
%83 = load double, double* %82
%84 = getelementptr inbounds double, double* %39, i64 7
%85 = load double, double* %84
%86 = insertelement <2 x double> poison, double %83, i64 0
%87 = shufflevector <2 x double> %86, <2 x double> poison, <2 x i32> zeroinitializer
%88 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %81, <2 x double> %87, <2 x double> %75)
%89 = insertelement <2 x double> poison, double %85, i64 0
%90 = shufflevector <2 x double> %89, <2 x double> poison, <2 x i32> zeroinitializer
%91 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %81, <2 x double> %90, <2 x double> %78)
%92 = getelementptr inbounds double, double* %38, i64 16
%93 = getelementptr inbounds double, double* %39, i64 %18
%94 = add nuw nsw i32 %37, 4
%95 = icmp slt i32 %94, %14
br i1 %95, label %36, label %19
96: ; preds = %29, %96
%97 = phi i32 [ %115, %96 ], [ %32, %29 ]
%98 = phi double* [ %113, %96 ], [ %31, %29 ]
%99 = phi double* [ %114, %96 ], [ %30, %29 ]
%100 = phi <2 x double> [ %112, %96 ], [ %33, %29 ]
%101 = phi <2 x double> [ %109, %96 ], [ %34, %29 ]
%102 = bitcast double* %98 to <2 x double>*
%103 = load <2 x double>, <2 x double>* %102
%104 = load double, double* %99
%105 = getelementptr inbounds double, double* %99, i64 4
%106 = load double, double* %105
%107 = insertelement <2 x double> poison, double %104, i64 0
%108 = shufflevector <2 x double> %107, <2 x double> poison, <2 x i32> zeroinitializer
%109 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %103, <2 x double> %108, <2 x double> %101)
%110 = insertelement <2 x double> poison, double %106, i64 0
%111 = shufflevector <2 x double> %110, <2 x double> poison, <2 x i32> zeroinitializer
%112 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %103, <2 x double> %111, <2 x double> %100)
%113 = getelementptr inbounds double, double* %98, i64 4
%114 = getelementptr inbounds double, double* %99, i64 1
%115 = add nuw nsw i32 %97, 1
%116 = icmp eq i32 %115, %2
br i1 %116, label %117, label %96
117: ; preds = %96
%118 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %103, <2 x double> %111, <2 x double> %100)
%119 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %103, <2 x double> %108, <2 x double> %101)
br label %120
120: ; preds = %117, %29
%121 = phi <2 x double> [ %33, %29 ], [ %118, %117 ]
%122 = phi <2 x double> [ %34, %29 ], [ %119, %117 ]
%123 = icmp eq i32 %8, 0
br i1 %123, label %124, label %129
124: ; preds = %120
%125 = icmp eq i32 %10, 0
%126 = shufflevector <2 x double> %122, <2 x double> %121, <2 x i32> <i32 1, i32 3>
%127 = extractelement <2 x double> %121, i64 0
%128 = extractelement <2 x double> %122, i64 0
br i1 %125, label %162, label %174
129: ; preds = %120
%130 = icmp eq i32 %9, 0
%131 = getelementptr inbounds double, double* %6, i64 1
%132 = getelementptr inbounds double, double* %6, i64 4
%133 = select i1 %130, double* %132, double* %131
%134 = select i1 %130, double* %131, double* %132
%135 = getelementptr inbounds double, double* %6, i64 5
%136 = load double, double* %135
%137 = load double, double* %134
%138 = load double, double* %133
%139 = load double, double* %6
%140 = icmp eq i32 %8, 1
br i1 %140, label %141, label %148
141: ; preds = %129
%142 = insertelement <2 x double> poison, double %139, i64 0
%143 = insertelement <2 x double> %142, double %137, i64 1
%144 = fadd <2 x double> %122, %143
%145 = insertelement <2 x double> poison, double %138, i64 0
%146 = insertelement <2 x double> %145, double %136, i64 1
%147 = fadd <2 x double> %121, %146
br label %155
148: ; preds = %129
%149 = insertelement <2 x double> poison, double %139, i64 0
%150 = insertelement <2 x double> %149, double %137, i64 1
%151 = fsub <2 x double> %150, %122
%152 = insertelement <2 x double> poison, double %138, i64 0
%153 = insertelement <2 x double> %152, double %136, i64 1
%154 = fsub <2 x double> %153, %121
br label %155
155: ; preds = %148, %141
%156 = phi <2 x double> [ %147, %141 ], [ %154, %148 ]
%157 = phi <2 x double> [ %144, %141 ], [ %151, %148 ]
%158 = icmp eq i32 %10, 0
%159 = shufflevector <2 x double> %157, <2 x double> %156, <2 x i32> <i32 1, i32 3>
%160 = extractelement <2 x double> %156, i64 0
%161 = extractelement <2 x double> %157, i64 0
br i1 %158, label %162, label %174
162: ; preds = %155, %124
%163 = phi <2 x double> [ %121, %124 ], [ %156, %155 ]
%164 = phi <2 x double> [ %122, %124 ], [ %157, %155 ]
%165 = icmp sgt i32 %0, 1
%166 = extractelement <2 x double> %164, i64 0
store double %166, double* %7
br i1 %165, label %167, label %171
167: ; preds = %162
%168 = getelementptr inbounds double, double* %7, i64 1
%169 = extractelement <2 x double> %164, i64 1
store double %169, double* %168
%170 = icmp sgt i32 %1, 1
br i1 %170, label %185, label %194
171: ; preds = %162
%172 = icmp sgt i32 %1, 1
%173 = extractelement <2 x double> %163, i64 0
br i1 %172, label %190, label %194
174: ; preds = %155, %124
%175 = phi double [ %128, %124 ], [ %161, %155 ]
%176 = phi double [ %127, %124 ], [ %160, %155 ]
%177 = phi <2 x double> [ %126, %124 ], [ %159, %155 ]
%178 = icmp sgt i32 %1, 1
store double %175, double* %7
br i1 %178, label %179, label %182
179: ; preds = %174
%180 = getelementptr inbounds double, double* %7, i64 1
store double %176, double* %180
%181 = icmp sgt i32 %0, 1
br i1 %181, label %185, label %194
182: ; preds = %174
%183 = icmp sgt i32 %0, 1
%184 = extractelement <2 x double> %177, i64 0
br i1 %183, label %190, label %194
185: ; preds = %179, %167
%186 = phi <2 x double> [ %163, %167 ], [ %177, %179 ]
%187 = getelementptr inbounds double, double* %7, i64 4
%188 = extractelement <2 x double> %186, i64 0
store double %188, double* %187
%189 = extractelement <2 x double> %186, i64 1
br label %190
190: ; preds = %185, %182, %171
%191 = phi i64 [ 4, %171 ], [ 4, %182 ], [ 5, %185 ]
%192 = phi double [ %173, %171 ], [ %184, %182 ], [ %189, %185 ]
%193 = getelementptr inbounds double, double* %7, i64 %191
store double %192, double* %193
br label %194
194: ; preds = %190, %171, %167, %182, %179, %11
ret void
}