void kernel_dtrsv_n_4_vs_lib4(int km, int kn, int kmax, int inverted_diag,
                              double *A, double *x, double *y) {
  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) {
    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)
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    13bd <kernel_dtrsv_n_4_vs_lib4+0x2bd>
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    114e <kernel_dtrsv_n_4_vs_lib4+0x4e>
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     1740 <kernel_dtrsv_n_4_vs_lib4+0x640>
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    156a <kernel_dtrsv_n_4_vs_lib4+0x46a>
cmpl   $0x1,-0x4(%rbp)
jne    151d <kernel_dtrsv_n_4_vs_lib4+0x41d>
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
movsd  -0x58(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
cmpl   $0x2,-0x4(%rbp)
jne    153a <kernel_dtrsv_n_4_vs_lib4+0x43a>
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
movsd  -0x60(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
cmpl   $0x3,-0x4(%rbp)
jne    1557 <kernel_dtrsv_n_4_vs_lib4+0x457>
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
movsd  -0x68(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
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    1672 <kernel_dtrsv_n_4_vs_lib4+0x572>
cmpl   $0x2,-0x4(%rbp)
jne    1642 <kernel_dtrsv_n_4_vs_lib4+0x542>
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
movsd  -0x60(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
cmpl   $0x3,-0x4(%rbp)
jne    165f <kernel_dtrsv_n_4_vs_lib4+0x55f>
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
movsd  -0x68(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
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    170a <kernel_dtrsv_n_4_vs_lib4+0x60a>
cmpl   $0x3,-0x4(%rbp)
jne    16f7 <kernel_dtrsv_n_4_vs_lib4+0x5f7>
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
movsd  -0x68(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
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    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
mov    -0x18(%rbp),%rax
movsd  0x8b4(%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    18a0 <kernel_dtrsv_n_4_vs_lib4+0x7a0>
cmpl   $0x1,-0x4(%rbp)
jne    1853 <kernel_dtrsv_n_4_vs_lib4+0x753>
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
movsd  -0x58(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
cmpl   $0x2,-0x4(%rbp)
jne    1870 <kernel_dtrsv_n_4_vs_lib4+0x770>
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
movsd  -0x60(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
cmpl   $0x3,-0x4(%rbp)
jne    188d <kernel_dtrsv_n_4_vs_lib4+0x78d>
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
movsd  -0x68(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
mov    -0x18(%rbp),%rax
movsd  0x754(%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    19b0 <kernel_dtrsv_n_4_vs_lib4+0x8b0>
cmpl   $0x2,-0x4(%rbp)
jne    1980 <kernel_dtrsv_n_4_vs_lib4+0x880>
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
movsd  -0x60(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
cmpl   $0x3,-0x4(%rbp)
jne    199d <kernel_dtrsv_n_4_vs_lib4+0x89d>
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
movsd  -0x68(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
mov    -0x18(%rbp),%rax
movsd  0x644(%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    1a50 <kernel_dtrsv_n_4_vs_lib4+0x950>
cmpl   $0x3,-0x4(%rbp)
jne    1a3d <kernel_dtrsv_n_4_vs_lib4+0x93d>
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
movsd  -0x68(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    1a89 <kernel_dtrsv_n_4_vs_lib4+0x989>
mov    -0x18(%rbp),%rax
movsd  0x5a4(%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
xorpd  %xmm0,%xmm0
cmp    $0x4,%edx
jl     11de <kernel_dtrsv_n_4_vs_lib4+0xde>
add    $0xfffffffd,%edx
xorpd  %xmm4,%xmm4
xor    %eax,%eax
xorpd  %xmm2,%xmm2
nop
movupd (%r8),%xmm5
movupd 0x10(%r8),%xmm9
movupd 0x20(%r8),%xmm8
movupd 0x30(%r8),%xmm3
movsd  (%r9,%rax,8),%xmm7
movsd  0x8(%r9,%rax,8),%xmm6
movsd  0x10(%r9,%rax,8),%xmm1
movsd  0x18(%r9,%rax,8),%xmm0
unpcklpd %xmm7,%xmm7
mulpd  %xmm7,%xmm5
addpd  %xmm4,%xmm5
mulpd  %xmm9,%xmm7
addpd  %xmm2,%xmm7
unpcklpd %xmm6,%xmm6
mulpd  %xmm6,%xmm3
addpd  %xmm7,%xmm3
mulpd  %xmm8,%xmm6
addpd  %xmm5,%xmm6
movupd 0x50(%r8),%xmm2
movupd 0x40(%r8),%xmm5
unpcklpd %xmm1,%xmm1
mulpd  %xmm1,%xmm5
addpd  %xmm6,%xmm5
mulpd  %xmm2,%xmm1
addpd  %xmm3,%xmm1
movupd 0x60(%r8),%xmm4
movupd 0x70(%r8),%xmm3
unpcklpd %xmm0,%xmm0
mulpd  %xmm0,%xmm3
movapd %xmm3,%xmm2
addpd  %xmm1,%xmm2
mulpd  %xmm4,%xmm0
movapd %xmm0,%xmm4
addpd  %xmm5,%xmm4
sub    $0xffffffffffffff80,%r8
add    $0x4,%rax
cmp    %edx,%eax
jl     1120 <kernel_dtrsv_n_4_vs_lib4+0x20>
addpd  %xmm5,%xmm0
addpd  %xmm1,%xmm3
jmp    11e2 <kernel_dtrsv_n_4_vs_lib4+0xe2>
xorpd  %xmm3,%xmm3
movsd  (%r10),%xmm4
movsd  0x8(%r10),%xmm2
subsd  %xmm0,%xmm4
unpckhpd %xmm0,%xmm0
subsd  %xmm0,%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     12b9 <kernel_dtrsv_n_4_vs_lib4+0x1b9>
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     1301 <kernel_dtrsv_n_4_vs_lib4+0x201>
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     1343 <kernel_dtrsv_n_4_vs_lib4+0x243>
mulsd  0x50(%r8),%xmm1
movsd  0x58(%r8),%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm1,0x10(%r10)
subsd  %xmm2,%xmm0
cmp    $0x3,%esi
je     134e <kernel_dtrsv_n_4_vs_lib4+0x24e>
mulsd  0x78(%r8),%xmm0
jmp    1353 <kernel_dtrsv_n_4_vs_lib4+0x253>
movsd  0xd3f(%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    130e <kernel_dtrsv_n_4_vs_lib4+0x20e>
cmp    $0x1,%edi
je     1359 <kernel_dtrsv_n_4_vs_lib4+0x259>
movsd  %xmm2,0x8(%r10)
jmp    1343 <kernel_dtrsv_n_4_vs_lib4+0x243>
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    135a <kernel_dtrsv_n_4_vs_lib4+0x25a>
cmp    $0x2,%edi
je     1359 <kernel_dtrsv_n_4_vs_lib4+0x259>
movsd  %xmm1,0x10(%r10)
cmp    $0x3,%edi
je     1359 <kernel_dtrsv_n_4_vs_lib4+0x259>
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     134e <kernel_dtrsv_n_4_vs_lib4+0x24e>
divsd  0x78(%r8),%xmm3
mulsd  %xmm3,%xmm0
jmp    1353 <kernel_dtrsv_n_4_vs_lib4+0x253>

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