void kernel_dtrsv_n_4_vs_lib4(int km, int kn, int kmax, int inverted_diag,
                              double *A, double *x, double *y) {
  __builtin_prefetch(A);
  __builtin_prefetch(A + 8);
  const int lda = 4;
  int k;
  double x_0, x_1, x_2, x_3, y_0 = 0, y_1 = 0, y_2 = 0, y_3 = 0;
  k = 0;
  for (; k < kmax - 3; k += 4) {
    __builtin_prefetch(A + 4 * lda);
    __builtin_prefetch(A + 4 * lda + 8);
    x_0 = x[0];
    x_1 = x[1];
    x_2 = x[2];
    x_3 = x[3];
    y_0 += A[0 + lda * 0] * x_0;
    y_1 += A[1 + lda * 0] * x_0;
    y_2 += A[2 + lda * 0] * x_0;
    y_3 += A[3 + lda * 0] * x_0;
    y_0 += A[0 + lda * 1] * x_1;
    y_1 += A[1 + lda * 1] * x_1;
    y_2 += A[2 + lda * 1] * x_1;
    y_3 += A[3 + lda * 1] * x_1;
    y_0 += A[0 + lda * 2] * x_2;
    y_1 += A[1 + lda * 2] * x_2;
    y_2 += A[2 + lda * 2] * x_2;
    y_3 += A[3 + lda * 2] * x_2;
    y_0 += A[0 + lda * 3] * x_3;
    y_1 += A[1 + lda * 3] * x_3;
    y_2 += A[2 + lda * 3] * x_3;
    y_3 += A[3 + lda * 3] * x_3;
    A += 4 * lda;
    x += 4;
  }
  y_0 = y[0] - y_0;
  y_1 = y[1] - y_1;
  y_2 = y[2] - y_2;
  y_3 = y[3] - y_3;
  double a_00, a_10, a_20, a_30, a_11, a_21, a_31;
  if (inverted_diag) {
    a_00 = A[0 + lda * 0];
    a_10 = A[1 + lda * 0];
    a_20 = A[2 + lda * 0];
    a_30 = A[3 + lda * 0];
    y_0 *= a_00;
    y[0] = y_0;
    y_1 -= a_10 * y_0;
    y_2 -= a_20 * y_0;
    y_3 -= a_30 * y_0;
    if (kn == 1) {
      if (km == 1)
        return;
      y[1] = y_1;
      if (km == 2)
        return;
      y[2] = y_2;
      if (km == 3)
        return;
      y[3] = y_3;
      return;
    }
    a_11 = A[1 + lda * 1];
    a_21 = A[2 + lda * 1];
    a_31 = A[3 + lda * 1];
    y_1 *= a_11;
    y[1] = y_1;
    y_2 -= a_21 * y_1;
    y_3 -= a_31 * y_1;
    if (kn == 2) {
      if (km == 2)
        return;
      y[2] = y_2;
      if (km == 3)
        return;
      y[3] = y_3;
      return;
    }
    a_00 = A[2 + lda * 2];
    a_10 = A[3 + lda * 2];
    y_2 *= a_00;
    y[2] = y_2;
    y_3 -= a_10 * y_2;
    if (kn == 3) {
      if (km == 3)
        return;
      y[3] = y_3;
      return;
    }
    a_11 = A[3 + lda * 3];
    y_3 *= a_11;
    y[3] = y_3;
  } else {
    a_00 = 1.0 / A[0 + lda * 0];
    a_10 = A[1 + lda * 0];
    a_20 = A[2 + lda * 0];
    a_30 = A[3 + lda * 0];
    y_0 *= a_00;
    y[0] = y_0;
    y_1 -= a_10 * y_0;
    y_2 -= a_20 * y_0;
    y_3 -= a_30 * y_0;
    if (kn == 1) {
      if (km == 1)
        return;
      y[1] = y_1;
      if (km == 2)
        return;
      y[2] = y_2;
      if (km == 3)
        return;
      y[3] = y_3;
      return;
    }
    a_11 = 1.0 / A[1 + lda * 1];
    a_21 = A[2 + lda * 1];
    a_31 = A[3 + lda * 1];
    y_1 *= a_11;
    y[1] = y_1;
    y_2 -= a_21 * y_1;
    y_3 -= a_31 * y_1;
    if (kn == 2) {
      if (km == 2)
        return;
      y[2] = y_2;
      if (km == 3)
        return;
      y[3] = y_3;
      return;
    }
    a_00 = 1.0 / A[2 + lda * 2];
    a_10 = A[3 + lda * 2];
    y_2 *= a_00;
    y[2] = y_2;
    y_3 -= a_10 * y_2;
    if (kn == 3) {
      if (km == 3)
        return;
      y[3] = y_3;
      return;
    }
    a_11 = 1.0 / A[3 + lda * 3];
    y_3 *= a_11;
    y[3] = y_3;
  }
}


x86 assembly (clang, -O0):
<kernel_dtrsv_n_4_vs_lib4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
prefetcht0 (%rax)
mov    -0x18(%rbp),%rax
add    $0x40,%rax
prefetcht0 (%rax)
movl   $0x4,-0x24(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    13ed <kernel_dtrsv_n_4_vs_lib4+0x2ed>
mov    -0x18(%rbp),%rax
add    $0x80,%rax
prefetcht0 (%rax)
mov    -0x18(%rbp),%rax
add    $0x80,%rax
add    $0x40,%rax
prefetcht0 (%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x38(%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x48(%rax),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x50(%rax),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x58(%rax),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x60(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x68(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x70(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x78(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x18(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x28(%rbp)
jmp    1160 <kernel_dtrsv_n_4_vs_lib4+0x60>
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
subsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1770 <kernel_dtrsv_n_4_vs_lib4+0x670>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x78(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x50(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    159a <kernel_dtrsv_n_4_vs_lib4+0x49a>
cmpl   $0x1,-0x4(%rbp)
jne    154d <kernel_dtrsv_n_4_vs_lib4+0x44d>
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
movsd  -0x58(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
cmpl   $0x2,-0x4(%rbp)
jne    156a <kernel_dtrsv_n_4_vs_lib4+0x46a>
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
movsd  -0x60(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
cmpl   $0x3,-0x4(%rbp)
jne    1587 <kernel_dtrsv_n_4_vs_lib4+0x487>
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
movsd  -0x68(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
mov    -0x18(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x18(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x18(%rbp),%rax
movsd  0x38(%rax),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x58(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x58(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    16a2 <kernel_dtrsv_n_4_vs_lib4+0x5a2>
cmpl   $0x2,-0x4(%rbp)
jne    1672 <kernel_dtrsv_n_4_vs_lib4+0x572>
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
movsd  -0x60(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
cmpl   $0x3,-0x4(%rbp)
jne    168f <kernel_dtrsv_n_4_vs_lib4+0x58f>
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
movsd  -0x68(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
mov    -0x18(%rbp),%rax
movsd  0x50(%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x58(%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x78(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    173a <kernel_dtrsv_n_4_vs_lib4+0x63a>
cmpl   $0x3,-0x4(%rbp)
jne    1727 <kernel_dtrsv_n_4_vs_lib4+0x627>
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
movsd  -0x68(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
mov    -0x18(%rbp),%rax
movsd  0x78(%rax),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
mov    -0x18(%rbp),%rax
movsd  0x884(%rip),%xmm0
divsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x78(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x50(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    18d0 <kernel_dtrsv_n_4_vs_lib4+0x7d0>
cmpl   $0x1,-0x4(%rbp)
jne    1883 <kernel_dtrsv_n_4_vs_lib4+0x783>
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
movsd  -0x58(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
cmpl   $0x2,-0x4(%rbp)
jne    18a0 <kernel_dtrsv_n_4_vs_lib4+0x7a0>
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
movsd  -0x60(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
cmpl   $0x3,-0x4(%rbp)
jne    18bd <kernel_dtrsv_n_4_vs_lib4+0x7bd>
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
movsd  -0x68(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
mov    -0x18(%rbp),%rax
movsd  0x724(%rip),%xmm0
divsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x18(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x18(%rbp),%rax
movsd  0x38(%rax),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x58(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x58(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    19e0 <kernel_dtrsv_n_4_vs_lib4+0x8e0>
cmpl   $0x2,-0x4(%rbp)
jne    19b0 <kernel_dtrsv_n_4_vs_lib4+0x8b0>
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
movsd  -0x60(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
cmpl   $0x3,-0x4(%rbp)
jne    19cd <kernel_dtrsv_n_4_vs_lib4+0x8cd>
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
movsd  -0x68(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
mov    -0x18(%rbp),%rax
movsd  0x614(%rip),%xmm0
divsd  0x50(%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x58(%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x78(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    1a80 <kernel_dtrsv_n_4_vs_lib4+0x980>
cmpl   $0x3,-0x4(%rbp)
jne    1a6d <kernel_dtrsv_n_4_vs_lib4+0x96d>
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
movsd  -0x68(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    1ab9 <kernel_dtrsv_n_4_vs_lib4+0x9b9>
mov    -0x18(%rbp),%rax
movsd  0x574(%rip),%xmm0
divsd  0x78(%rax),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dtrsv_n_4_vs_lib4>:
mov    0x8(%rsp),%r10
prefetcht0 (%r8)
prefetcht0 0x40(%r8)
xorpd  %xmm5,%xmm5
cmp    $0x4,%edx
jl     1205 <kernel_dtrsv_n_4_vs_lib4+0x105>
add    $0xfffffffd,%edx
xorpd  %xmm7,%xmm7
xor    %eax,%eax
xorpd  %xmm0,%xmm0
nopl   0x0(%rax,%rax,1)
prefetcht0 0x80(%r8)
prefetcht0 0xc0(%r8)
movupd (%r8),%xmm9
movupd 0x10(%r8),%xmm5
movupd 0x20(%r8),%xmm8
movupd 0x30(%r8),%xmm2
movsd  (%r9,%rax,8),%xmm6
unpcklpd %xmm6,%xmm6
mulpd  %xmm6,%xmm9
addpd  %xmm7,%xmm9
movupd 0x50(%r8),%xmm10
movupd 0x40(%r8),%xmm4
movupd 0x60(%r8),%xmm11
movupd 0x70(%r8),%xmm3
lea    0x80(%r8),%r8
mulpd  %xmm5,%xmm6
movsd  0x8(%r9,%rax,8),%xmm7
addpd  %xmm0,%xmm6
movsd  0x10(%r9,%rax,8),%xmm1
unpcklpd %xmm7,%xmm7
mulpd  %xmm7,%xmm2
addpd  %xmm6,%xmm2
movsd  0x18(%r9,%rax,8),%xmm5
mulpd  %xmm8,%xmm7
addpd  %xmm9,%xmm7
unpcklpd %xmm1,%xmm1
mulpd  %xmm1,%xmm4
addpd  %xmm7,%xmm4
mulpd  %xmm10,%xmm1
addpd  %xmm2,%xmm1
unpcklpd %xmm5,%xmm5
mulpd  %xmm5,%xmm3
movapd %xmm3,%xmm0
addpd  %xmm1,%xmm0
mulpd  %xmm11,%xmm5
movapd %xmm5,%xmm7
addpd  %xmm4,%xmm7
add    $0x4,%rax
cmp    %edx,%eax
jl     1130 <kernel_dtrsv_n_4_vs_lib4+0x30>
addpd  %xmm4,%xmm5
addpd  %xmm1,%xmm3
jmp    1209 <kernel_dtrsv_n_4_vs_lib4+0x109>
xorpd  %xmm3,%xmm3
movsd  (%r10),%xmm4
movsd  0x8(%r10),%xmm2
subsd  %xmm5,%xmm4
unpckhpd %xmm5,%xmm5
subsd  %xmm5,%xmm2
movsd  0x10(%r10),%xmm1
subsd  %xmm3,%xmm1
movsd  0x18(%r10),%xmm0
unpckhpd %xmm3,%xmm3
subsd  %xmm3,%xmm0
movsd  (%r8),%xmm5
test   %ecx,%ecx
je     12e0 <kernel_dtrsv_n_4_vs_lib4+0x1e0>
mulsd  %xmm5,%xmm4
movsd  0x8(%r8),%xmm3
mulsd  %xmm4,%xmm3
movsd  0x10(%r8),%xmm5
mulsd  %xmm4,%xmm5
movsd  0x18(%r8),%xmm6
mulsd  %xmm4,%xmm6
movsd  %xmm4,(%r10)
subsd  %xmm3,%xmm2
subsd  %xmm5,%xmm1
subsd  %xmm6,%xmm0
cmp    $0x1,%esi
je     1328 <kernel_dtrsv_n_4_vs_lib4+0x228>
mulsd  0x28(%r8),%xmm2
movsd  0x30(%r8),%xmm3
mulsd  %xmm2,%xmm3
movsd  0x38(%r8),%xmm4
mulsd  %xmm2,%xmm4
movsd  %xmm2,0x8(%r10)
subsd  %xmm3,%xmm1
subsd  %xmm4,%xmm0
cmp    $0x2,%esi
je     136a <kernel_dtrsv_n_4_vs_lib4+0x26a>
mulsd  0x50(%r8),%xmm1
movsd  0x58(%r8),%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm1,0x10(%r10)
subsd  %xmm2,%xmm0
cmp    $0x3,%esi
je     1375 <kernel_dtrsv_n_4_vs_lib4+0x275>
mulsd  0x78(%r8),%xmm0
jmp    137a <kernel_dtrsv_n_4_vs_lib4+0x27a>
movsd  0xd18(%rip),%xmm3
movapd %xmm3,%xmm6
divsd  %xmm5,%xmm6
mulsd  %xmm6,%xmm4
movsd  0x8(%r8),%xmm5
mulsd  %xmm4,%xmm5
movsd  0x10(%r8),%xmm6
mulsd  %xmm4,%xmm6
movsd  0x18(%r8),%xmm7
mulsd  %xmm4,%xmm7
movsd  %xmm4,(%r10)
subsd  %xmm5,%xmm2
subsd  %xmm6,%xmm1
subsd  %xmm7,%xmm0
cmp    $0x1,%esi
jne    1335 <kernel_dtrsv_n_4_vs_lib4+0x235>
cmp    $0x1,%edi
je     1380 <kernel_dtrsv_n_4_vs_lib4+0x280>
movsd  %xmm2,0x8(%r10)
jmp    136a <kernel_dtrsv_n_4_vs_lib4+0x26a>
movapd %xmm3,%xmm4
divsd  0x28(%r8),%xmm4
mulsd  %xmm4,%xmm2
movsd  0x30(%r8),%xmm4
mulsd  %xmm2,%xmm4
movsd  0x38(%r8),%xmm5
mulsd  %xmm2,%xmm5
movsd  %xmm2,0x8(%r10)
subsd  %xmm4,%xmm1
subsd  %xmm5,%xmm0
cmp    $0x2,%esi
jne    1381 <kernel_dtrsv_n_4_vs_lib4+0x281>
cmp    $0x2,%edi
je     1380 <kernel_dtrsv_n_4_vs_lib4+0x280>
movsd  %xmm1,0x10(%r10)
cmp    $0x3,%edi
je     1380 <kernel_dtrsv_n_4_vs_lib4+0x280>
movsd  %xmm0,0x18(%r10)
ret
movapd %xmm3,%xmm2
divsd  0x50(%r8),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x58(%r8),%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm1,0x10(%r10)
subsd  %xmm2,%xmm0
cmp    $0x3,%esi
je     1375 <kernel_dtrsv_n_4_vs_lib4+0x275>
divsd  0x78(%r8),%xmm3
mulsd  %xmm3,%xmm0
jmp    137a <kernel_dtrsv_n_4_vs_lib4+0x27a>

LLVM IR (-O0):
define void @kernel_dtrsv_n_4_vs_lib4(i32 %0, i32 %1, i32 %2, i32 %3, double* %4, double* %5, double* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca i32
%16 = alloca i32
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
store double* %6, double** %14
%32 = load double*, double** %12
%33 = bitcast double* %32 to i8*
%34 = load double*, double** %12
%35 = getelementptr inbounds double, double* %34, i64 8
%36 = bitcast double* %35 to i8*
store i32 4, i32* %15
store double 0.000000e+00, double* %21
store double 0.000000e+00, double* %22
store double 0.000000e+00, double* %23
store double 0.000000e+00, double* %24
store i32 0, i32* %16
br label %37
37: ; preds = %162, %7
%38 = load i32, i32* %16
%39 = load i32, i32* %10
%40 = sub nsw i32 %39, 3
%41 = icmp slt i32 %38, %40
br i1 %41, label %42, label %165
42: ; preds = %37
%43 = load double*, double** %12
%44 = getelementptr inbounds double, double* %43, i64 16
%45 = bitcast double* %44 to i8*
%46 = load double*, double** %12
%47 = getelementptr inbounds double, double* %46, i64 16
%48 = getelementptr inbounds double, double* %47, i64 8
%49 = bitcast double* %48 to i8*
%50 = load double*, double** %13
%51 = getelementptr inbounds double, double* %50, i64 0
%52 = load double, double* %51
store double %52, double* %17
%53 = load double*, double** %13
%54 = getelementptr inbounds double, double* %53, i64 1
%55 = load double, double* %54
store double %55, double* %18
%56 = load double*, double** %13
%57 = getelementptr inbounds double, double* %56, i64 2
%58 = load double, double* %57
store double %58, double* %19
%59 = load double*, double** %13
%60 = getelementptr inbounds double, double* %59, i64 3
%61 = load double, double* %60
store double %61, double* %20
%62 = load double*, double** %12
%63 = getelementptr inbounds double, double* %62, i64 0
%64 = load double, double* %63
%65 = load double, double* %17
%66 = load double, double* %21
%67 = call double @llvm.fmuladd.f64(double %64, double %65, double %66)
store double %67, double* %21
%68 = load double*, double** %12
%69 = getelementptr inbounds double, double* %68, i64 1
%70 = load double, double* %69
%71 = load double, double* %17
%72 = load double, double* %22
%73 = call double @llvm.fmuladd.f64(double %70, double %71, double %72)
store double %73, double* %22
%74 = load double*, double** %12
%75 = getelementptr inbounds double, double* %74, i64 2
%76 = load double, double* %75
%77 = load double, double* %17
%78 = load double, double* %23
%79 = call double @llvm.fmuladd.f64(double %76, double %77, double %78)
store double %79, double* %23
%80 = load double*, double** %12
%81 = getelementptr inbounds double, double* %80, i64 3
%82 = load double, double* %81
%83 = load double, double* %17
%84 = load double, double* %24
%85 = call double @llvm.fmuladd.f64(double %82, double %83, double %84)
store double %85, double* %24
%86 = load double*, double** %12
%87 = getelementptr inbounds double, double* %86, i64 4
%88 = load double, double* %87
%89 = load double, double* %18
%90 = load double, double* %21
%91 = call double @llvm.fmuladd.f64(double %88, double %89, double %90)
store double %91, double* %21
%92 = load double*, double** %12
%93 = getelementptr inbounds double, double* %92, i64 5
%94 = load double, double* %93
%95 = load double, double* %18
%96 = load double, double* %22
%97 = call double @llvm.fmuladd.f64(double %94, double %95, double %96)
store double %97, double* %22
%98 = load double*, double** %12
%99 = getelementptr inbounds double, double* %98, i64 6
%100 = load double, double* %99
%101 = load double, double* %18
%102 = load double, double* %23
%103 = call double @llvm.fmuladd.f64(double %100, double %101, double %102)
store double %103, double* %23
%104 = load double*, double** %12
%105 = getelementptr inbounds double, double* %104, i64 7
%106 = load double, double* %105
%107 = load double, double* %18
%108 = load double, double* %24
%109 = call double @llvm.fmuladd.f64(double %106, double %107, double %108)
store double %109, double* %24
%110 = load double*, double** %12
%111 = getelementptr inbounds double, double* %110, i64 8
%112 = load double, double* %111
%113 = load double, double* %19
%114 = load double, double* %21
%115 = call double @llvm.fmuladd.f64(double %112, double %113, double %114)
store double %115, double* %21
%116 = load double*, double** %12
%117 = getelementptr inbounds double, double* %116, i64 9
%118 = load double, double* %117
%119 = load double, double* %19
%120 = load double, double* %22
%121 = call double @llvm.fmuladd.f64(double %118, double %119, double %120)
store double %121, double* %22
%122 = load double*, double** %12
%123 = getelementptr inbounds double, double* %122, i64 10
%124 = load double, double* %123
%125 = load double, double* %19
%126 = load double, double* %23
%127 = call double @llvm.fmuladd.f64(double %124, double %125, double %126)
store double %127, double* %23
%128 = load double*, double** %12
%129 = getelementptr inbounds double, double* %128, i64 11
%130 = load double, double* %129
%131 = load double, double* %19
%132 = load double, double* %24
%133 = call double @llvm.fmuladd.f64(double %130, double %131, double %132)
store double %133, double* %24
%134 = load double*, double** %12
%135 = getelementptr inbounds double, double* %134, i64 12
%136 = load double, double* %135
%137 = load double, double* %20
%138 = load double, double* %21
%139 = call double @llvm.fmuladd.f64(double %136, double %137, double %138)
store double %139, double* %21
%140 = load double*, double** %12
%141 = getelementptr inbounds double, double* %140, i64 13
%142 = load double, double* %141
%143 = load double, double* %20
%144 = load double, double* %22
%145 = call double @llvm.fmuladd.f64(double %142, double %143, double %144)
store double %145, double* %22
%146 = load double*, double** %12
%147 = getelementptr inbounds double, double* %146, i64 14
%148 = load double, double* %147
%149 = load double, double* %20
%150 = load double, double* %23
%151 = call double @llvm.fmuladd.f64(double %148, double %149, double %150)
store double %151, double* %23
%152 = load double*, double** %12
%153 = getelementptr inbounds double, double* %152, i64 15
%154 = load double, double* %153
%155 = load double, double* %20
%156 = load double, double* %24
%157 = call double @llvm.fmuladd.f64(double %154, double %155, double %156)
store double %157, double* %24
%158 = load double*, double** %12
%159 = getelementptr inbounds double, double* %158, i64 16
store double* %159, double** %12
%160 = load double*, double** %13
%161 = getelementptr inbounds double, double* %160, i64 4
store double* %161, double** %13
br label %162
162: ; preds = %42
%163 = load i32, i32* %16
%164 = add nsw i32 %163, 4
store i32 %164, i32* %16
br label %37
165: ; preds = %37
%166 = load double*, double** %14
%167 = getelementptr inbounds double, double* %166, i64 0
%168 = load double, double* %167
%169 = load double, double* %21
%170 = fsub double %168, %169
store double %170, double* %21
%171 = load double*, double** %14
%172 = getelementptr inbounds double, double* %171, i64 1
%173 = load double, double* %172
%174 = load double, double* %22
%175 = fsub double %173, %174
store double %175, double* %22
%176 = load double*, double** %14
%177 = getelementptr inbounds double, double* %176, i64 2
%178 = load double, double* %177
%179 = load double, double* %23
%180 = fsub double %178, %179
store double %180, double* %23
%181 = load double*, double** %14
%182 = getelementptr inbounds double, double* %181, i64 3
%183 = load double, double* %182
%184 = load double, double* %24
%185 = fsub double %183, %184
store double %185, double* %24
%186 = load i32, i32* %11
%187 = icmp ne i32 %186, 0
br i1 %187, label %188, label %327
188: ; preds = %165
%189 = load double*, double** %12
%190 = getelementptr inbounds double, double* %189, i64 0
%191 = load double, double* %190
store double %191, double* %25
%192 = load double*, double** %12
%193 = getelementptr inbounds double, double* %192, i64 1
%194 = load double, double* %193
store double %194, double* %26
%195 = load double*, double** %12
%196 = getelementptr inbounds double, double* %195, i64 2
%197 = load double, double* %196
store double %197, double* %27
%198 = load double*, double** %12
%199 = getelementptr inbounds double, double* %198, i64 3
%200 = load double, double* %199
store double %200, double* %28
%201 = load double, double* %25
%202 = load double, double* %21
%203 = fmul double %202, %201
store double %203, double* %21
%204 = load double, double* %21
%205 = load double*, double** %14
%206 = getelementptr inbounds double, double* %205, i64 0
store double %204, double* %206
%207 = load double, double* %26
%208 = load double, double* %21
%209 = load double, double* %22
%210 = fneg double %207
%211 = call double @llvm.fmuladd.f64(double %210, double %208, double %209)
store double %211, double* %22
%212 = load double, double* %27
%213 = load double, double* %21
%214 = load double, double* %23
%215 = fneg double %212
%216 = call double @llvm.fmuladd.f64(double %215, double %213, double %214)
store double %216, double* %23
%217 = load double, double* %28
%218 = load double, double* %21
%219 = load double, double* %24
%220 = fneg double %217
%221 = call double @llvm.fmuladd.f64(double %220, double %218, double %219)
store double %221, double* %24
%222 = load i32, i32* %9
%223 = icmp eq i32 %222, 1
br i1 %223, label %224, label %246
224: ; preds = %188
%225 = load i32, i32* %8
%226 = icmp eq i32 %225, 1
br i1 %226, label %227, label %228
227: ; preds = %224
br label %470
228: ; preds = %224
%229 = load double, double* %22
%230 = load double*, double** %14
%231 = getelementptr inbounds double, double* %230, i64 1
store double %229, double* %231
%232 = load i32, i32* %8
%233 = icmp eq i32 %232, 2
br i1 %233, label %234, label %235
234: ; preds = %228
br label %470
235: ; preds = %228
%236 = load double, double* %23
%237 = load double*, double** %14
%238 = getelementptr inbounds double, double* %237, i64 2
store double %236, double* %238
%239 = load i32, i32* %8
%240 = icmp eq i32 %239, 3
br i1 %240, label %241, label %242
241: ; preds = %235
br label %470
242: ; preds = %235
%243 = load double, double* %24
%244 = load double*, double** %14
%245 = getelementptr inbounds double, double* %244, i64 3
store double %243, double* %245
br label %470
246: ; preds = %188
%247 = load double*, double** %12
%248 = getelementptr inbounds double, double* %247, i64 5
%249 = load double, double* %248
store double %249, double* %29
%250 = load double*, double** %12
%251 = getelementptr inbounds double, double* %250, i64 6
%252 = load double, double* %251
store double %252, double* %30
%253 = load double*, double** %12
%254 = getelementptr inbounds double, double* %253, i64 7
%255 = load double, double* %254
store double %255, double* %31
%256 = load double, double* %29
%257 = load double, double* %22
%258 = fmul double %257, %256
store double %258, double* %22
%259 = load double, double* %22
%260 = load double*, double** %14
%261 = getelementptr inbounds double, double* %260, i64 1
store double %259, double* %261
%262 = load double, double* %30
%263 = load double, double* %22
%264 = load double, double* %23
%265 = fneg double %262
%266 = call double @llvm.fmuladd.f64(double %265, double %263, double %264)
store double %266, double* %23
%267 = load double, double* %31
%268 = load double, double* %22
%269 = load double, double* %24
%270 = fneg double %267
%271 = call double @llvm.fmuladd.f64(double %270, double %268, double %269)
store double %271, double* %24
%272 = load i32, i32* %9
%273 = icmp eq i32 %272, 2
br i1 %273, label %274, label %289
274: ; preds = %246
%275 = load i32, i32* %8
%276 = icmp eq i32 %275, 2
br i1 %276, label %277, label %278
277: ; preds = %274
br label %470
278: ; preds = %274
%279 = load double, double* %23
%280 = load double*, double** %14
%281 = getelementptr inbounds double, double* %280, i64 2
store double %279, double* %281
%282 = load i32, i32* %8
%283 = icmp eq i32 %282, 3
br i1 %283, label %284, label %285
284: ; preds = %278
br label %470
285: ; preds = %278
%286 = load double, double* %24
%287 = load double*, double** %14
%288 = getelementptr inbounds double, double* %287, i64 3
store double %286, double* %288
br label %470
289: ; preds = %246
%290 = load double*, double** %12
%291 = getelementptr inbounds double, double* %290, i64 10
%292 = load double, double* %291
store double %292, double* %25
%293 = load double*, double** %12
%294 = getelementptr inbounds double, double* %293, i64 11
%295 = load double, double* %294
store double %295, double* %26
%296 = load double, double* %25
%297 = load double, double* %23
%298 = fmul double %297, %296
store double %298, double* %23
%299 = load double, double* %23
%300 = load double*, double** %14
%301 = getelementptr inbounds double, double* %300, i64 2
store double %299, double* %301
%302 = load double, double* %26
%303 = load double, double* %23
%304 = load double, double* %24
%305 = fneg double %302
%306 = call double @llvm.fmuladd.f64(double %305, double %303, double %304)
store double %306, double* %24
%307 = load i32, i32* %9
%308 = icmp eq i32 %307, 3
br i1 %308, label %309, label %317
309: ; preds = %289
%310 = load i32, i32* %8
%311 = icmp eq i32 %310, 3
br i1 %311, label %312, label %313
312: ; preds = %309
br label %470
313: ; preds = %309
%314 = load double, double* %24
%315 = load double*, double** %14
%316 = getelementptr inbounds double, double* %315, i64 3
store double %314, double* %316
br label %470
317: ; preds = %289
%318 = load double*, double** %12
%319 = getelementptr inbounds double, double* %318, i64 15
%320 = load double, double* %319
store double %320, double* %29
%321 = load double, double* %29
%322 = load double, double* %24
%323 = fmul double %322, %321
store double %323, double* %24
%324 = load double, double* %24
%325 = load double*, double** %14
%326 = getelementptr inbounds double, double* %325, i64 3
store double %324, double* %326
br label %470
327: ; preds = %165
%328 = load double*, double** %12
%329 = getelementptr inbounds double, double* %328, i64 0
%330 = load double, double* %329
%331 = fdiv double 1.000000e+00, %330
store double %331, double* %25
%332 = load double*, double** %12
%333 = getelementptr inbounds double, double* %332, i64 1
%334 = load double, double* %333
store double %334, double* %26
%335 = load double*, double** %12
%336 = getelementptr inbounds double, double* %335, i64 2
%337 = load double, double* %336
store double %337, double* %27
%338 = load double*, double** %12
%339 = getelementptr inbounds double, double* %338, i64 3
%340 = load double, double* %339
store double %340, double* %28
%341 = load double, double* %25
%342 = load double, double* %21
%343 = fmul double %342, %341
store double %343, double* %21
%344 = load double, double* %21
%345 = load double*, double** %14
%346 = getelementptr inbounds double, double* %345, i64 0
store double %344, double* %346
%347 = load double, double* %26
%348 = load double, double* %21
%349 = load double, double* %22
%350 = fneg double %347
%351 = call double @llvm.fmuladd.f64(double %350, double %348, double %349)
store double %351, double* %22
%352 = load double, double* %27
%353 = load double, double* %21
%354 = load double, double* %23
%355 = fneg double %352
%356 = call double @llvm.fmuladd.f64(double %355, double %353, double %354)
store double %356, double* %23
%357 = load double, double* %28
%358 = load double, double* %21
%359 = load double, double* %24
%360 = fneg double %357
%361 = call double @llvm.fmuladd.f64(double %360, double %358, double %359)
store double %361, double* %24
%362 = load i32, i32* %9
%363 = icmp eq i32 %362, 1
br i1 %363, label %364, label %386
364: ; preds = %327
%365 = load i32, i32* %8
%366 = icmp eq i32 %365, 1
br i1 %366, label %367, label %368
367: ; preds = %364
br label %470
368: ; preds = %364
%369 = load double, double* %22
%370 = load double*, double** %14
%371 = getelementptr inbounds double, double* %370, i64 1
store double %369, double* %371
%372 = load i32, i32* %8
%373 = icmp eq i32 %372, 2
br i1 %373, label %374, label %375
374: ; preds = %368
br label %470
375: ; preds = %368
%376 = load double, double* %23
%377 = load double*, double** %14
%378 = getelementptr inbounds double, double* %377, i64 2
store double %376, double* %378
%379 = load i32, i32* %8
%380 = icmp eq i32 %379, 3
br i1 %380, label %381, label %382
381: ; preds = %375
br label %470
382: ; preds = %375
%383 = load double, double* %24
%384 = load double*, double** %14
%385 = getelementptr inbounds double, double* %384, i64 3
store double %383, double* %385
br label %470
386: ; preds = %327
%387 = load double*, double** %12
%388 = getelementptr inbounds double, double* %387, i64 5
%389 = load double, double* %388
%390 = fdiv double 1.000000e+00, %389
store double %390, double* %29
%391 = load double*, double** %12
%392 = getelementptr inbounds double, double* %391, i64 6
%393 = load double, double* %392
store double %393, double* %30
%394 = load double*, double** %12
%395 = getelementptr inbounds double, double* %394, i64 7
%396 = load double, double* %395
store double %396, double* %31
%397 = load double, double* %29
%398 = load double, double* %22
%399 = fmul double %398, %397
store double %399, double* %22
%400 = load double, double* %22
%401 = load double*, double** %14
%402 = getelementptr inbounds double, double* %401, i64 1
store double %400, double* %402
%403 = load double, double* %30
%404 = load double, double* %22
%405 = load double, double* %23
%406 = fneg double %403
%407 = call double @llvm.fmuladd.f64(double %406, double %404, double %405)
store double %407, double* %23
%408 = load double, double* %31
%409 = load double, double* %22
%410 = load double, double* %24
%411 = fneg double %408
%412 = call double @llvm.fmuladd.f64(double %411, double %409, double %410)
store double %412, double* %24
%413 = load i32, i32* %9
%414 = icmp eq i32 %413, 2
br i1 %414, label %415, label %430
415: ; preds = %386
%416 = load i32, i32* %8
%417 = icmp eq i32 %416, 2
br i1 %417, label %418, label %419
418: ; preds = %415
br label %470
419: ; preds = %415
%420 = load double, double* %23
%421 = load double*, double** %14
%422 = getelementptr inbounds double, double* %421, i64 2
store double %420, double* %422
%423 = load i32, i32* %8
%424 = icmp eq i32 %423, 3
br i1 %424, label %425, label %426
425: ; preds = %419
br label %470
426: ; preds = %419
%427 = load double, double* %24
%428 = load double*, double** %14
%429 = getelementptr inbounds double, double* %428, i64 3
store double %427, double* %429
br label %470
430: ; preds = %386
%431 = load double*, double** %12
%432 = getelementptr inbounds double, double* %431, i64 10
%433 = load double, double* %432
%434 = fdiv double 1.000000e+00, %433
store double %434, double* %25
%435 = load double*, double** %12
%436 = getelementptr inbounds double, double* %435, i64 11
%437 = load double, double* %436
store double %437, double* %26
%438 = load double, double* %25
%439 = load double, double* %23
%440 = fmul double %439, %438
store double %440, double* %23
%441 = load double, double* %23
%442 = load double*, double** %14
%443 = getelementptr inbounds double, double* %442, i64 2
store double %441, double* %443
%444 = load double, double* %26
%445 = load double, double* %23
%446 = load double, double* %24
%447 = fneg double %444
%448 = call double @llvm.fmuladd.f64(double %447, double %445, double %446)
store double %448, double* %24
%449 = load i32, i32* %9
%450 = icmp eq i32 %449, 3
br i1 %450, label %451, label %459
451: ; preds = %430
%452 = load i32, i32* %8
%453 = icmp eq i32 %452, 3
br i1 %453, label %454, label %455
454: ; preds = %451
br label %470
455: ; preds = %451
%456 = load double, double* %24
%457 = load double*, double** %14
%458 = getelementptr inbounds double, double* %457, i64 3
store double %456, double* %458
br label %470
459: ; preds = %430
%460 = load double*, double** %12
%461 = getelementptr inbounds double, double* %460, i64 15
%462 = load double, double* %461
%463 = fdiv double 1.000000e+00, %462
store double %463, double* %29
%464 = load double, double* %29
%465 = load double, double* %24
%466 = fmul double %465, %464
store double %466, double* %24
%467 = load double, double* %24
%468 = load double*, double** %14
%469 = getelementptr inbounds double, double* %468, i64 3
store double %467, double* %469
br label %470
470: ; preds = %227, %234, %241, %242, %277, %284, %285, %312, %313, %367, %374, %381, %382, %418, %425, %426, %454, %455, %459, %317
ret void
}

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