void kernel_dtrsm_nn_ru_2x2_vs_lib4(int km, int kn, int kmax, double *A,
                                    double *B, int sdb, int alg, double *C,
                                    double *D, double *E, int use_inv_diag_E,
                                    double *inv_diag_E) {
  const int bs = 4;
  int k;
  double tmp, a_0, a_1, b_0, b_1, e_00, e_01, e_11, d_00 = 0, d_01 = 0,
                                                    d_10 = 0, d_11 = 0;
  if (kmax <= 0)
    goto add;
  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];
    d_00 -= a_0 * b_0;
    d_10 -= a_1 * b_0;
    d_01 -= a_0 * b_1;
    d_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];
    d_00 -= a_0 * b_0;
    d_10 -= a_1 * b_0;
    d_01 -= a_0 * b_1;
    d_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];
    d_00 -= a_0 * b_0;
    d_10 -= a_1 * b_0;
    d_01 -= a_0 * b_1;
    d_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];
    d_00 -= a_0 * b_0;
    d_10 -= a_1 * b_0;
    d_01 -= a_0 * b_1;
    d_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];
    d_00 -= a_0 * b_0;
    d_10 -= a_1 * b_0;
    d_01 -= a_0 * b_1;
    d_11 -= a_1 * b_1;
    A += 4;
    B += 1;
  }
add:
  if (alg != 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];
  }
  if (use_inv_diag_E) {
    e_00 = inv_diag_E[0];
    d_00 *= e_00;
    d_10 *= e_00;
    D[0 + bs * 0] = d_00;
    if (km >= 2)
      D[1 + bs * 0] = d_10;
    if (kn < 2)
      return;
    e_01 = E[0 + bs * 1];
    e_11 = inv_diag_E[1];
    d_01 -= d_00 * e_01;
    d_11 -= d_10 * e_01;
    d_01 *= e_11;
    d_11 *= e_11;
    D[0 + bs * 1] = d_01;
    if (km >= 2)
      D[1 + bs * 1] = d_11;
  } else {
    e_00 = 1.0 / E[0 + bs * 0];
    d_00 *= e_00;
    d_10 *= e_00;
    D[0 + bs * 0] = d_00;
    if (km >= 2)
      D[1 + bs * 0] = d_10;
    if (kn < 2)
      return;
    e_01 = E[0 + bs * 1];
    e_11 = 1.0 / E[1 + bs * 1];
    d_01 -= d_00 * e_01;
    d_11 -= d_10 * e_01;
    d_01 *= e_11;
    d_11 *= e_11;
    D[0 + bs * 1] = d_01;
    if (km >= 2)
      D[1 + bs * 1] = d_11;
  }
  return;
}


x86 assembly (clang, -O0):
<kernel_dtrsm_nn_ru_2x2_vs_lib4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
movl   $0x4,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
cmpl   $0x0,-0xc(%rbp)
jg     116f <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x6f>
jmp    1743 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x643>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    15f9 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x4f9>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x18(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x48(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x18(%rbp),%rax
movsd  0x60(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x68(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x38(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
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    1176 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x76>
jmp    15fe <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x4fe>
mov    -0x2c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    173e <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x63e>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
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    15fe <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x4fe>
jmp    1743 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x643>
cmpl   $0x0,0x10(%rbp)
je     17a4 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x6a4>
mov    0x18(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
addsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
mov    0x18(%rbp),%rax
movsd  0x20(%rax),%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    0x18(%rbp),%rax
movsd  0x28(%rax),%xmm0
addsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
cmpl   $0x0,0x30(%rbp)
je     18f3 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x7f3>
mov    0x38(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
mov    0x20(%rbp),%rax
movsd  %xmm0,(%rax)
cmpl   $0x2,-0x4(%rbp)
jl     1807 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x707>
movsd  -0x88(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
cmpl   $0x2,-0x8(%rbp)
jge    1816 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x716>
jmp    1a4d <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x94d>
mov    0x28(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    0x38(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x68(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
mov    0x20(%rbp),%rax
movsd  %xmm0,0x20(%rax)
cmpl   $0x2,-0x4(%rbp)
jl     18ee <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x7ee>
movsd  -0x90(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
movsd  %xmm0,0x28(%rax)
jmp    1a48 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x948>
mov    0x28(%rbp),%rax
movsd  0x701(%rip),%xmm0
divsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
mov    0x20(%rbp),%rax
movsd  %xmm0,(%rax)
cmpl   $0x2,-0x4(%rbp)
jl     1954 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x854>
movsd  -0x88(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
cmpl   $0x2,-0x8(%rbp)
jge    1963 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x863>
jmp    1a4d <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x94d>
mov    0x28(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    0x28(%rbp),%rax
movsd  0x683(%rip),%xmm0
divsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x68(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
mov    0x20(%rbp),%rax
movsd  %xmm0,0x20(%rax)
cmpl   $0x2,-0x4(%rbp)
jl     1a43 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x943>
movsd  -0x90(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
movsd  %xmm0,0x28(%rax)
jmp    1a48 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x948>
jmp    1a4d <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x94d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dtrsm_nn_ru_2x2_vs_lib4>:
mov    0x8(%rsp),%r10d
test   %edx,%edx
jle    12d5 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x1d5>
cmp    $0x4,%edx
jb     12e2 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x1e2>
lea    -0x3(%rdx),%r11d
shl    $0x2,%r9d
movslq %r9d,%r9
shl    $0x3,%r9
xorpd  %xmm1,%xmm1
xor    %eax,%eax
movapd 0xecc(%rip),%xmm14
xorpd  %xmm5,%xmm5
nopl   0x0(%rax,%rax,1)
movapd %xmm5,%xmm10
movapd %xmm1,%xmm8
movupd (%rcx),%xmm9
movupd 0x20(%rcx),%xmm13
movupd 0x40(%rcx),%xmm12
movupd 0x60(%rcx),%xmm11
movapd %xmm9,%xmm0
unpckhpd %xmm9,%xmm0
movapd %xmm9,%xmm3
unpcklpd %xmm9,%xmm3
movsd  (%r8),%xmm7
movsd  0x8(%r8),%xmm6
movsd  0x10(%r8),%xmm4
movsd  0x18(%r8),%xmm2
movhpd 0x20(%r8),%xmm7
mulpd  %xmm7,%xmm3
subpd  %xmm3,%xmm1
mulpd  %xmm7,%xmm0
subpd  %xmm0,%xmm5
movapd %xmm13,%xmm0
unpcklpd %xmm13,%xmm0
movapd %xmm13,%xmm3
unpckhpd %xmm13,%xmm3
movhpd 0x28(%r8),%xmm6
mulpd  %xmm6,%xmm3
subpd  %xmm3,%xmm5
mulpd  %xmm6,%xmm0
subpd  %xmm0,%xmm1
movapd %xmm12,%xmm0
unpckhpd %xmm12,%xmm0
movapd %xmm12,%xmm3
unpcklpd %xmm12,%xmm3
movhpd 0x30(%r8),%xmm4
mulpd  %xmm4,%xmm3
subpd  %xmm3,%xmm1
mulpd  %xmm4,%xmm0
subpd  %xmm0,%xmm5
movapd %xmm11,%xmm0
unpcklpd %xmm11,%xmm0
movapd %xmm11,%xmm3
unpckhpd %xmm11,%xmm3
movhpd 0x38(%r8),%xmm2
mulpd  %xmm2,%xmm3
subpd  %xmm3,%xmm5
mulpd  %xmm2,%xmm0
subpd  %xmm0,%xmm1
sub    $0xffffffffffffff80,%rcx
add    $0x4,%eax
add    %r9,%r8
cmp    %r11d,%eax
jl     1140 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x40>
xorpd  %xmm14,%xmm9
pshufd $0xee,%xmm9,%xmm15
pshufd $0x44,%xmm9,%xmm5
xorpd  %xmm14,%xmm13
pshufd $0xee,%xmm13,%xmm9
movapd %xmm14,%xmm0
pshufd $0x44,%xmm13,%xmm14
xorpd  %xmm0,%xmm12
pshufd $0xee,%xmm12,%xmm13
pshufd $0x44,%xmm12,%xmm3
xorpd  %xmm0,%xmm11
pshufd $0xee,%xmm11,%xmm0
pshufd $0x44,%xmm11,%xmm1
mulpd  %xmm7,%xmm15
addpd  %xmm10,%xmm15
mulpd  %xmm7,%xmm5
addpd  %xmm8,%xmm5
mulpd  %xmm6,%xmm14
addpd  %xmm5,%xmm14
mulpd  %xmm6,%xmm9
addpd  %xmm15,%xmm9
mulpd  %xmm4,%xmm13
addpd  %xmm9,%xmm13
mulpd  %xmm4,%xmm3
addpd  %xmm14,%xmm3
mulpd  %xmm2,%xmm1
addpd  %xmm3,%xmm1
mulpd  %xmm2,%xmm0
addpd  %xmm13,%xmm0
mov    %edx,%eax
and    $0xfffffffc,%eax
cmp    %edx,%eax
jl     12f0 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x1f0>
jmp    1364 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x264>
xorpd  %xmm1,%xmm1
xorpd  %xmm0,%xmm0
jmp    1364 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x264>
xorpd  %xmm1,%xmm1
xor    %eax,%eax
xorpd  %xmm0,%xmm0
cmp    %edx,%eax
jge    1364 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x264>
sub    %eax,%edx
xor    %eax,%eax
movapd 0xd03(%rip),%xmm8
nopl   (%rax)
movapd %xmm0,%xmm2
movapd %xmm1,%xmm4
movupd (%rcx),%xmm3
movapd %xmm3,%xmm7
unpcklpd %xmm3,%xmm7
movapd %xmm3,%xmm6
movsd  (%r8,%rax,8),%xmm5
movhpd 0x20(%r8,%rax,8),%xmm5
unpckhpd %xmm3,%xmm6
mulpd  %xmm5,%xmm6
subpd  %xmm6,%xmm0
mulpd  %xmm5,%xmm7
subpd  %xmm7,%xmm1
add    $0x20,%rcx
add    $0x1,%rax
cmp    %eax,%edx
jne    1300 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x200>
xorpd  %xmm8,%xmm3
pshufd $0xee,%xmm3,%xmm0
pshufd $0x44,%xmm3,%xmm1
mulpd  %xmm5,%xmm1
addpd  %xmm4,%xmm1
mulpd  %xmm5,%xmm0
addpd  %xmm2,%xmm0
mov    0x28(%rsp),%edx
test   %r10d,%r10d
je     138d <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x28d>
mov    0x10(%rsp),%rax
movsd  (%rax),%xmm2
movsd  0x8(%rax),%xmm3
movhpd 0x20(%rax),%xmm2
movhpd 0x28(%rax),%xmm3
addpd  %xmm3,%xmm0
addpd  %xmm2,%xmm1
mov    0x20(%rsp),%rcx
mov    0x18(%rsp),%rax
test   %edx,%edx
je     13e8 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x2e8>
mov    0x30(%rsp),%rdx
movsd  (%rdx),%xmm2
movapd %xmm1,%xmm5
mulsd  %xmm2,%xmm5
mulsd  %xmm0,%xmm2
movsd  %xmm5,(%rax)
cmp    $0x2,%edi
jl     13be <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x2be>
movsd  %xmm2,0x8(%rax)
cmp    $0x2,%esi
jl     13e7 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x2e7>
movsd  0x20(%rcx),%xmm4
movsd  0x8(%rdx),%xmm3
unpckhpd %xmm1,%xmm1
mulsd  %xmm4,%xmm5
subsd  %xmm5,%xmm1
mulsd  %xmm3,%xmm1
movsd  %xmm1,0x20(%rax)
cmp    $0x1,%edi
jg     143b <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x33b>
ret
movsd  0xc20(%rip),%xmm3
movapd %xmm3,%xmm2
divsd  (%rcx),%xmm2
movapd %xmm1,%xmm5
mulsd  %xmm2,%xmm5
mulsd  %xmm0,%xmm2
movsd  %xmm5,(%rax)
cmp    $0x2,%edi
jl     1412 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x312>
movsd  %xmm2,0x8(%rax)
cmp    $0x2,%esi
jl     13e7 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x2e7>
movsd  0x20(%rcx),%xmm4
divsd  0x28(%rcx),%xmm3
unpckhpd %xmm1,%xmm1
mulsd  %xmm4,%xmm5
subsd  %xmm5,%xmm1
mulsd  %xmm3,%xmm1
movsd  %xmm1,0x20(%rax)
cmp    $0x2,%edi
jl     13e7 <kernel_dtrsm_nn_ru_2x2_vs_lib4+0x2e7>
mulsd  %xmm4,%xmm2
unpckhpd %xmm0,%xmm0
subsd  %xmm2,%xmm0
mulsd  %xmm3,%xmm0
movsd  %xmm0,0x28(%rax)
ret

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

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