void kernel_dgemv_n_8_lib4(int kmax, double *A0, int sda, double *x, double *y,
                           double *z, int alg) {
  if (kmax <= 0)
    return;
  double *A1 = A0 + 4 * sda;
  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, y_4 = 0,
                             y_5 = 0, y_6 = 0, y_7 = 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 += A0[0 + lda * 0] * x_0;
    y_1 += A0[1 + lda * 0] * x_0;
    y_2 += A0[2 + lda * 0] * x_0;
    y_3 += A0[3 + lda * 0] * x_0;
    y_4 += A1[0 + lda * 0] * x_0;
    y_5 += A1[1 + lda * 0] * x_0;
    y_6 += A1[2 + lda * 0] * x_0;
    y_7 += A1[3 + lda * 0] * x_0;
    y_0 += A0[0 + lda * 1] * x_1;
    y_1 += A0[1 + lda * 1] * x_1;
    y_2 += A0[2 + lda * 1] * x_1;
    y_3 += A0[3 + lda * 1] * x_1;
    y_4 += A1[0 + lda * 1] * x_1;
    y_5 += A1[1 + lda * 1] * x_1;
    y_6 += A1[2 + lda * 1] * x_1;
    y_7 += A1[3 + lda * 1] * x_1;
    y_0 += A0[0 + lda * 2] * x_2;
    y_1 += A0[1 + lda * 2] * x_2;
    y_2 += A0[2 + lda * 2] * x_2;
    y_3 += A0[3 + lda * 2] * x_2;
    y_4 += A1[0 + lda * 2] * x_2;
    y_5 += A1[1 + lda * 2] * x_2;
    y_6 += A1[2 + lda * 2] * x_2;
    y_7 += A1[3 + lda * 2] * x_2;
    y_0 += A0[0 + lda * 3] * x_3;
    y_1 += A0[1 + lda * 3] * x_3;
    y_2 += A0[2 + lda * 3] * x_3;
    y_3 += A0[3 + lda * 3] * x_3;
    y_4 += A1[0 + lda * 3] * x_3;
    y_5 += A1[1 + lda * 3] * x_3;
    y_6 += A1[2 + lda * 3] * x_3;
    y_7 += A1[3 + lda * 3] * x_3;
    A0 += 4 * lda;
    A1 += 4 * lda;
    x += 4;
  }
  for (; k < kmax; k++) {
    x_0 = x[0];
    y_0 += A0[0 + lda * 0] * x_0;
    y_1 += A0[1 + lda * 0] * x_0;
    y_2 += A0[2 + lda * 0] * x_0;
    y_3 += A0[3 + lda * 0] * x_0;
    y_4 += A1[0 + lda * 0] * x_0;
    y_5 += A1[1 + lda * 0] * x_0;
    y_6 += A1[2 + lda * 0] * x_0;
    y_7 += A1[3 + lda * 0] * x_0;
    A0 += 1 * lda;
    A1 += 1 * lda;
    x += 1;
  }
  if (alg == 0) {
    z[0] = y_0;
    z[1] = y_1;
    z[2] = y_2;
    z[3] = y_3;
    z[4] = y_4;
    z[5] = y_5;
    z[6] = y_6;
    z[7] = y_7;
  } else if (alg == 1) {
    z[0] = y[0] + y_0;
    z[1] = y[1] + y_1;
    z[2] = y[2] + y_2;
    z[3] = y[3] + y_3;
    z[4] = y[4] + y_4;
    z[5] = y[5] + y_5;
    z[6] = y[6] + y_6;
    z[7] = y[7] + y_7;
  } else {
    z[0] = y[0] - y_0;
    z[1] = y[1] - y_1;
    z[2] = y[2] - y_2;
    z[3] = y[3] - y_3;
    z[4] = y[4] - y_4;
    z[5] = y[5] - y_5;
    z[6] = y[6] - y_6;
    z[7] = y[7] - y_7;
  }
}


x86 assembly (clang, -O0):
<kernel_dgemv_n_8_lib4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1130 <kernel_dgemv_n_8_lib4+0x30>
jmp    1a06 <kernel_dgemv_n_8_lib4+0x906>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
movl   $0x4,-0x3c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    167e <kernel_dgemv_n_8_lib4+0x57e>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x38(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x38(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x38(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x38(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x38(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x38(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x38(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x38(%rbp),%rax
movsd  0x38(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x48(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x50(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x58(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x38(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x38(%rbp),%rax
movsd  0x48(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x38(%rbp),%rax
movsd  0x50(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x38(%rbp),%rax
movsd  0x58(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x60(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x68(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x70(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x78(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x38(%rbp),%rax
movsd  0x60(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x38(%rbp),%rax
movsd  0x68(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x38(%rbp),%rax
movsd  0x70(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x38(%rbp),%rax
movsd  0x78(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x10(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x10(%rbp)
mov    -0x38(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x20(%rbp)
mov    -0x40(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x40(%rbp)
jmp    11a2 <kernel_dgemv_n_8_lib4+0xa2>
jmp    1683 <kernel_dgemv_n_8_lib4+0x583>
mov    -0x40(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    17e4 <kernel_dgemv_n_8_lib4+0x6e4>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x38(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x38(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x38(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x10(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x10(%rbp)
mov    -0x38(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1683 <kernel_dgemv_n_8_lib4+0x583>
cmpl   $0x0,0x10(%rbp)
jne    186e <kernel_dgemv_n_8_lib4+0x76e>
movsd  -0x68(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x70(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x78(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x80(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x88(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x28(%rax)
movsd  -0x98(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x30(%rax)
movsd  -0xa0(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x38(%rax)
jmp    1a06 <kernel_dgemv_n_8_lib4+0x906>
cmpl   $0x1,0x10(%rbp)
jne    193f <kernel_dgemv_n_8_lib4+0x83f>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x68(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm0
addsd  -0x70(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm0
addsd  -0x78(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x28(%rbp),%rax
movsd  0x18(%rax),%xmm0
addsd  -0x80(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x28(%rbp),%rax
movsd  0x20(%rax),%xmm0
addsd  -0x88(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x28(%rbp),%rax
movsd  0x28(%rax),%xmm0
addsd  -0x90(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x28(%rbp),%rax
movsd  0x30(%rax),%xmm0
addsd  -0x98(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x28(%rbp),%rax
movsd  0x38(%rax),%xmm0
addsd  -0xa0(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x38(%rax)
jmp    1a01 <kernel_dgemv_n_8_lib4+0x901>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x68(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm0
subsd  -0x70(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm0
subsd  -0x78(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x28(%rbp),%rax
movsd  0x18(%rax),%xmm0
subsd  -0x80(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x28(%rbp),%rax
movsd  0x20(%rax),%xmm0
subsd  -0x88(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x28(%rbp),%rax
movsd  0x28(%rax),%xmm0
subsd  -0x90(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x28(%rbp),%rax
movsd  0x30(%rax),%xmm0
subsd  -0x98(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x28(%rbp),%rax
movsd  0x38(%rax),%xmm0
subsd  -0xa0(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x38(%rax)
jmp    1a06 <kernel_dgemv_n_8_lib4+0x906>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dgemv_n_8_lib4>:
test   %edi,%edi
jle    14a7 <kernel_dgemv_n_8_lib4+0x3a7>
shl    $0x2,%edx
movslq %edx,%rax
cmp    $0x4,%edi
jb     128e <kernel_dgemv_n_8_lib4+0x18e>
lea    -0x3(%rdi),%r10d
xorpd  %xmm12,%xmm12
xor    %edx,%edx
xorpd  %xmm2,%xmm2
xorpd  %xmm1,%xmm1
xorpd  %xmm4,%xmm4
xchg   %ax,%ax
movupd (%rsi),%xmm6
movupd 0x10(%rsi),%xmm5
movupd 0x20(%rsi),%xmm11
movupd 0x30(%rsi),%xmm9
movsd  (%rcx),%xmm7
movsd  0x8(%rcx),%xmm0
movsd  0x10(%rcx),%xmm10
movsd  0x18(%rcx),%xmm8
unpcklpd %xmm7,%xmm7
mulpd  %xmm7,%xmm6
addpd  %xmm12,%xmm6
mulpd  %xmm7,%xmm5
addpd  %xmm2,%xmm5
movupd (%rsi,%rax,8),%xmm3
movupd 0x10(%rsi,%rax,8),%xmm2
movupd 0x20(%rsi,%rax,8),%xmm12
movupd 0x30(%rsi,%rax,8),%xmm13
mulpd  %xmm7,%xmm3
addpd  %xmm1,%xmm3
mulpd  %xmm7,%xmm2
addpd  %xmm4,%xmm2
unpcklpd %xmm0,%xmm0
mulpd  %xmm0,%xmm11
addpd  %xmm6,%xmm11
mulpd  %xmm0,%xmm9
addpd  %xmm5,%xmm9
mulpd  %xmm0,%xmm12
addpd  %xmm3,%xmm12
mulpd  %xmm13,%xmm0
addpd  %xmm2,%xmm0
movupd 0x40(%rsi),%xmm5
unpcklpd %xmm10,%xmm10
mulpd  %xmm10,%xmm5
addpd  %xmm11,%xmm5
movupd 0x50(%rsi),%xmm7
mulpd  %xmm10,%xmm7
addpd  %xmm9,%xmm7
movupd 0x40(%rsi,%rax,8),%xmm3
mulpd  %xmm10,%xmm3
addpd  %xmm12,%xmm3
movupd 0x50(%rsi,%rax,8),%xmm6
mulpd  %xmm10,%xmm6
addpd  %xmm0,%xmm6
movupd 0x60(%rsi),%xmm0
unpcklpd %xmm8,%xmm8
mulpd  %xmm8,%xmm0
movapd %xmm0,%xmm12
addpd  %xmm5,%xmm12
movupd 0x70(%rsi),%xmm11
mulpd  %xmm8,%xmm11
movapd %xmm11,%xmm2
addpd  %xmm7,%xmm2
movupd 0x60(%rsi,%rax,8),%xmm10
mulpd  %xmm8,%xmm10
movapd %xmm10,%xmm1
addpd  %xmm3,%xmm1
movupd 0x70(%rsi,%rax,8),%xmm9
mulpd  %xmm8,%xmm9
movapd %xmm9,%xmm4
addpd  %xmm6,%xmm4
sub    $0xffffffffffffff80,%rsi
add    $0x20,%rcx
add    $0x4,%edx
cmp    %r10d,%edx
jl     1130 <kernel_dgemv_n_8_lib4+0x30>
addpd  %xmm6,%xmm9
addpd  %xmm3,%xmm10
addpd  %xmm7,%xmm11
addpd  %xmm5,%xmm0
mov    %edi,%edx
and    $0xfffffffc,%edx
lea    (%rsi,%rax,8),%rax
jmp    12a7 <kernel_dgemv_n_8_lib4+0x1a7>
lea    (%rsi,%rax,8),%rax
xorpd  %xmm0,%xmm0
xor    %edx,%edx
xorpd  %xmm11,%xmm11
xorpd  %xmm10,%xmm10
xorpd  %xmm9,%xmm9
mov    0x8(%rsp),%r10d
cmp    %edi,%edx
jge    1358 <kernel_dgemv_n_8_lib4+0x258>
sub    %edx,%edi
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movapd %xmm9,%xmm6
movapd %xmm10,%xmm3
movapd %xmm11,%xmm12
movapd %xmm0,%xmm8
movupd (%rsi,%rdx,4),%xmm5
movupd 0x10(%rsi,%rdx,4),%xmm4
movsd  (%rcx,%rdx,1),%xmm2
unpcklpd %xmm2,%xmm2
mulpd  %xmm2,%xmm5
movapd %xmm5,%xmm0
addpd  %xmm8,%xmm0
mulpd  %xmm2,%xmm4
movapd %xmm4,%xmm11
addpd  %xmm12,%xmm11
movupd (%rax,%rdx,4),%xmm1
movupd 0x10(%rax,%rdx,4),%xmm7
mulpd  %xmm2,%xmm1
movapd %xmm1,%xmm10
addpd  %xmm3,%xmm10
mulpd  %xmm2,%xmm7
movapd %xmm7,%xmm9
addpd  %xmm6,%xmm9
add    $0x8,%rdx
add    $0xffffffff,%edi
jne    12c0 <kernel_dgemv_n_8_lib4+0x1c0>
addpd  %xmm6,%xmm7
addpd  %xmm3,%xmm1
addpd  %xmm12,%xmm4
addpd  %xmm8,%xmm5
movapd %xmm5,%xmm0
movapd %xmm4,%xmm11
movapd %xmm1,%xmm10
movapd %xmm7,%xmm9
cmp    $0x1,%r10d
je     1388 <kernel_dgemv_n_8_lib4+0x288>
test   %r10d,%r10d
jne    140b <kernel_dgemv_n_8_lib4+0x30b>
movupd %xmm0,(%r9)
movupd %xmm11,0x10(%r9)
movupd %xmm10,0x20(%r9)
movlpd %xmm9,0x30(%r9)
unpckhpd %xmm9,%xmm9
jmp    14a1 <kernel_dgemv_n_8_lib4+0x3a1>
movsd  (%r8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r9)
unpckhpd %xmm0,%xmm0
addsd  0x8(%r8),%xmm0
movsd  %xmm0,0x8(%r9)
movsd  0x10(%r8),%xmm0
addsd  %xmm11,%xmm0
movsd  %xmm0,0x10(%r9)
unpckhpd %xmm11,%xmm11
addsd  0x18(%r8),%xmm11
movsd  %xmm11,0x18(%r9)
movsd  0x20(%r8),%xmm0
addsd  %xmm10,%xmm0
movsd  %xmm0,0x20(%r9)
unpckhpd %xmm10,%xmm10
addsd  0x28(%r8),%xmm10
movsd  %xmm10,0x28(%r9)
movsd  0x30(%r8),%xmm0
addsd  %xmm9,%xmm0
movsd  %xmm0,0x30(%r9)
unpckhpd %xmm9,%xmm9
addsd  0x38(%r8),%xmm9
jmp    14a1 <kernel_dgemv_n_8_lib4+0x3a1>
movsd  (%r8),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%r9)
movsd  0x8(%r8),%xmm1
unpckhpd %xmm0,%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r9)
movsd  0x10(%r8),%xmm0
subsd  %xmm11,%xmm0
movsd  %xmm0,0x10(%r9)
movsd  0x18(%r8),%xmm0
unpckhpd %xmm11,%xmm11
subsd  %xmm11,%xmm0
movsd  %xmm0,0x18(%r9)
movsd  0x20(%r8),%xmm0
subsd  %xmm10,%xmm0
movsd  %xmm0,0x20(%r9)
movsd  0x28(%r8),%xmm0
unpckhpd %xmm10,%xmm10
subsd  %xmm10,%xmm0
movsd  %xmm0,0x28(%r9)
movsd  0x30(%r8),%xmm0
subsd  %xmm9,%xmm0
movsd  %xmm0,0x30(%r9)
movsd  0x38(%r8),%xmm0
unpckhpd %xmm9,%xmm9
subsd  %xmm9,%xmm0
movapd %xmm0,%xmm9
movsd  %xmm9,0x38(%r9)
ret

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

LLVM IR (-O2):
define void @kernel_dgemv_n_8_lib4(i32 %0, double* nocapture %1, i32 %2, double* nocapture %3, double* nocapture %4, double* writeonly %5, i32 %6) {
%8 = icmp slt i32 %0, 1
br i1 %8, label %263, label %9
9: ; preds = %7
%10 = shl nsw i32 %2, 2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds double, double* %1, i64 %11
%13 = add nsw i32 %0, -3
%14 = icmp ugt i32 %0, 3
br i1 %14, label %43, label %33
15: ; preds = %43
%16 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %73, <2 x double> %62, <2 x double> %51)
%17 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %91, <2 x double> %79, <2 x double> %16)
%18 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %109, <2 x double> %97, <2 x double> %17)
%19 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %127, <2 x double> %115, <2 x double> %18)
%20 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %69, <2 x double> %62, <2 x double> %50)
%21 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %87, <2 x double> %79, <2 x double> %20)
%22 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %105, <2 x double> %97, <2 x double> %21)
%23 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %123, <2 x double> %115, <2 x double> %22)
%24 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %66, <2 x double> %62, <2 x double> %49)
%25 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %83, <2 x double> %79, <2 x double> %24)
%26 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %101, <2 x double> %97, <2 x double> %25)
%27 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %119, <2 x double> %115, <2 x double> %26)
%28 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %60, <2 x double> %62, <2 x double> %48)
%29 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %77, <2 x double> %79, <2 x double> %28)
%30 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %95, <2 x double> %97, <2 x double> %29)
%31 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %113, <2 x double> %115, <2 x double> %30)
%32 = and i32 %0, -4
br label %33
33: ; preds = %15, %9
%34 = phi i32 [ 0, %9 ], [ %32, %15 ]
%35 = phi double* [ %12, %9 ], [ %130, %15 ]
%36 = phi double* [ %3, %9 ], [ %131, %15 ]
%37 = phi double* [ %1, %9 ], [ %129, %15 ]
%38 = phi <2 x double> [ zeroinitializer, %9 ], [ %31, %15 ]
%39 = phi <2 x double> [ zeroinitializer, %9 ], [ %27, %15 ]
%40 = phi <2 x double> [ zeroinitializer, %9 ], [ %23, %15 ]
%41 = phi <2 x double> [ zeroinitializer, %9 ], [ %19, %15 ]
%42 = icmp slt i32 %34, %0
br i1 %42, label %134, label %170
43: ; preds = %9, %43
%44 = phi double* [ %129, %43 ], [ %1, %9 ]
%45 = phi double* [ %131, %43 ], [ %3, %9 ]
%46 = phi double* [ %130, %43 ], [ %12, %9 ]
%47 = phi i32 [ %132, %43 ], [ 0, %9 ]
%48 = phi <2 x double> [ %116, %43 ], [ zeroinitializer, %9 ]
%49 = phi <2 x double> [ %120, %43 ], [ zeroinitializer, %9 ]
%50 = phi <2 x double> [ %124, %43 ], [ zeroinitializer, %9 ]
%51 = phi <2 x double> [ %128, %43 ], [ zeroinitializer, %9 ]
%52 = load double, double* %45
%53 = getelementptr inbounds double, double* %45, i64 1
%54 = load double, double* %53
%55 = getelementptr inbounds double, double* %45, i64 2
%56 = load double, double* %55
%57 = getelementptr inbounds double, double* %45, i64 3
%58 = load double, double* %57
%59 = bitcast double* %44 to <2 x double>*
%60 = load <2 x double>, <2 x double>* %59
%61 = insertelement <2 x double> poison, double %52, i64 0
%62 = shufflevector <2 x double> %61, <2 x double> poison, <2 x i32> zeroinitializer
%63 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %60, <2 x double> %62, <2 x double> %48)
%64 = getelementptr inbounds double, double* %44, i64 2
%65 = bitcast double* %64 to <2 x double>*
%66 = load <2 x double>, <2 x double>* %65
%67 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %66, <2 x double> %62, <2 x double> %49)
%68 = bitcast double* %46 to <2 x double>*
%69 = load <2 x double>, <2 x double>* %68
%70 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %69, <2 x double> %62, <2 x double> %50)
%71 = getelementptr inbounds double, double* %46, i64 2
%72 = bitcast double* %71 to <2 x double>*
%73 = load <2 x double>, <2 x double>* %72
%74 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %73, <2 x double> %62, <2 x double> %51)
%75 = getelementptr inbounds double, double* %44, i64 4
%76 = bitcast double* %75 to <2 x double>*
%77 = load <2 x double>, <2 x double>* %76
%78 = insertelement <2 x double> poison, double %54, i64 0
%79 = shufflevector <2 x double> %78, <2 x double> poison, <2 x i32> zeroinitializer
%80 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %77, <2 x double> %79, <2 x double> %63)
%81 = getelementptr inbounds double, double* %44, i64 6
%82 = bitcast double* %81 to <2 x double>*
%83 = load <2 x double>, <2 x double>* %82
%84 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %83, <2 x double> %79, <2 x double> %67)
%85 = getelementptr inbounds double, double* %46, i64 4
%86 = bitcast double* %85 to <2 x double>*
%87 = load <2 x double>, <2 x double>* %86
%88 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %87, <2 x double> %79, <2 x double> %70)
%89 = getelementptr inbounds double, double* %46, i64 6
%90 = bitcast double* %89 to <2 x double>*
%91 = load <2 x double>, <2 x double>* %90
%92 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %91, <2 x double> %79, <2 x double> %74)
%93 = getelementptr inbounds double, double* %44, i64 8
%94 = bitcast double* %93 to <2 x double>*
%95 = load <2 x double>, <2 x double>* %94
%96 = insertelement <2 x double> poison, double %56, i64 0
%97 = shufflevector <2 x double> %96, <2 x double> poison, <2 x i32> zeroinitializer
%98 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %95, <2 x double> %97, <2 x double> %80)
%99 = getelementptr inbounds double, double* %44, i64 10
%100 = bitcast double* %99 to <2 x double>*
%101 = load <2 x double>, <2 x double>* %100
%102 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %101, <2 x double> %97, <2 x double> %84)
%103 = getelementptr inbounds double, double* %46, i64 8
%104 = bitcast double* %103 to <2 x double>*
%105 = load <2 x double>, <2 x double>* %104
%106 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %105, <2 x double> %97, <2 x double> %88)
%107 = getelementptr inbounds double, double* %46, i64 10
%108 = bitcast double* %107 to <2 x double>*
%109 = load <2 x double>, <2 x double>* %108
%110 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %109, <2 x double> %97, <2 x double> %92)
%111 = getelementptr inbounds double, double* %44, i64 12
%112 = bitcast double* %111 to <2 x double>*
%113 = load <2 x double>, <2 x double>* %112
%114 = insertelement <2 x double> poison, double %58, i64 0
%115 = shufflevector <2 x double> %114, <2 x double> poison, <2 x i32> zeroinitializer
%116 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %113, <2 x double> %115, <2 x double> %98)
%117 = getelementptr inbounds double, double* %44, i64 14
%118 = bitcast double* %117 to <2 x double>*
%119 = load <2 x double>, <2 x double>* %118
%120 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %119, <2 x double> %115, <2 x double> %102)
%121 = getelementptr inbounds double, double* %46, i64 12
%122 = bitcast double* %121 to <2 x double>*
%123 = load <2 x double>, <2 x double>* %122
%124 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %123, <2 x double> %115, <2 x double> %106)
%125 = getelementptr inbounds double, double* %46, i64 14
%126 = bitcast double* %125 to <2 x double>*
%127 = load <2 x double>, <2 x double>* %126
%128 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %127, <2 x double> %115, <2 x double> %110)
%129 = getelementptr inbounds double, double* %44, i64 16
%130 = getelementptr inbounds double, double* %46, i64 16
%131 = getelementptr inbounds double, double* %45, i64 4
%132 = add nuw nsw i32 %47, 4
%133 = icmp slt i32 %132, %13
br i1 %133, label %43, label %15
134: ; preds = %33, %134
%135 = phi double* [ %160, %134 ], [ %37, %33 ]
%136 = phi double* [ %162, %134 ], [ %36, %33 ]
%137 = phi double* [ %161, %134 ], [ %35, %33 ]
%138 = phi i32 [ %163, %134 ], [ %34, %33 ]
%139 = phi <2 x double> [ %148, %134 ], [ %38, %33 ]
%140 = phi <2 x double> [ %152, %134 ], [ %39, %33 ]
%141 = phi <2 x double> [ %155, %134 ], [ %40, %33 ]
%142 = phi <2 x double> [ %159, %134 ], [ %41, %33 ]
%143 = load double, double* %136
%144 = bitcast double* %135 to <2 x double>*
%145 = load <2 x double>, <2 x double>* %144
%146 = insertelement <2 x double> poison, double %143, i64 0
%147 = shufflevector <2 x double> %146, <2 x double> poison, <2 x i32> zeroinitializer
%148 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %145, <2 x double> %147, <2 x double> %139)
%149 = getelementptr inbounds double, double* %135, i64 2
%150 = bitcast double* %149 to <2 x double>*
%151 = load <2 x double>, <2 x double>* %150
%152 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %151, <2 x double> %147, <2 x double> %140)
%153 = bitcast double* %137 to <2 x double>*
%154 = load <2 x double>, <2 x double>* %153
%155 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %154, <2 x double> %147, <2 x double> %141)
%156 = getelementptr inbounds double, double* %137, i64 2
%157 = bitcast double* %156 to <2 x double>*
%158 = load <2 x double>, <2 x double>* %157
%159 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %158, <2 x double> %147, <2 x double> %142)
%160 = getelementptr inbounds double, double* %135, i64 4
%161 = getelementptr inbounds double, double* %137, i64 4
%162 = getelementptr inbounds double, double* %136, i64 1
%163 = add nuw nsw i32 %138, 1
%164 = icmp eq i32 %163, %0
br i1 %164, label %165, label %134
165: ; preds = %134
%166 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %158, <2 x double> %147, <2 x double> %142)
%167 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %154, <2 x double> %147, <2 x double> %141)
%168 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %151, <2 x double> %147, <2 x double> %140)
%169 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %145, <2 x double> %147, <2 x double> %139)
br label %170
170: ; preds = %165, %33
%171 = phi <2 x double> [ %38, %33 ], [ %169, %165 ]
%172 = phi <2 x double> [ %39, %33 ], [ %168, %165 ]
%173 = phi <2 x double> [ %40, %33 ], [ %167, %165 ]
%174 = phi <2 x double> [ %41, %33 ], [ %166, %165 ]
switch i32 %6, label %222 [
i32 0, label %175
i32 1, label %184
]
175: ; preds = %170
%176 = bitcast double* %5 to <2 x double>*
store <2 x double> %171, <2 x double>* %176
%177 = getelementptr inbounds double, double* %5, i64 2
%178 = bitcast double* %177 to <2 x double>*
store <2 x double> %172, <2 x double>* %178
%179 = getelementptr inbounds double, double* %5, i64 4
%180 = bitcast double* %179 to <2 x double>*
store <2 x double> %173, <2 x double>* %180
%181 = getelementptr inbounds double, double* %5, i64 6
%182 = extractelement <2 x double> %174, i64 0
store double %182, double* %181
%183 = extractelement <2 x double> %174, i64 1
br label %260
184: ; preds = %170
%185 = load double, double* %4
%186 = extractelement <2 x double> %171, i64 0
%187 = fadd double %186, %185
store double %187, double* %5
%188 = getelementptr inbounds double, double* %4, i64 1
%189 = load double, double* %188
%190 = extractelement <2 x double> %171, i64 1
%191 = fadd double %190, %189
%192 = getelementptr inbounds double, double* %5, i64 1
store double %191, double* %192
%193 = getelementptr inbounds double, double* %4, i64 2
%194 = load double, double* %193
%195 = extractelement <2 x double> %172, i64 0
%196 = fadd double %195, %194
%197 = getelementptr inbounds double, double* %5, i64 2
store double %196, double* %197
%198 = getelementptr inbounds double, double* %4, i64 3
%199 = load double, double* %198
%200 = extractelement <2 x double> %172, i64 1
%201 = fadd double %200, %199
%202 = getelementptr inbounds double, double* %5, i64 3
store double %201, double* %202
%203 = getelementptr inbounds double, double* %4, i64 4
%204 = load double, double* %203
%205 = extractelement <2 x double> %173, i64 0
%206 = fadd double %205, %204
%207 = getelementptr inbounds double, double* %5, i64 4
store double %206, double* %207
%208 = getelementptr inbounds double, double* %4, i64 5
%209 = load double, double* %208
%210 = extractelement <2 x double> %173, i64 1
%211 = fadd double %210, %209
%212 = getelementptr inbounds double, double* %5, i64 5
store double %211, double* %212
%213 = getelementptr inbounds double, double* %4, i64 6
%214 = load double, double* %213
%215 = extractelement <2 x double> %174, i64 0
%216 = fadd double %215, %214
%217 = getelementptr inbounds double, double* %5, i64 6
store double %216, double* %217
%218 = getelementptr inbounds double, double* %4, i64 7
%219 = load double, double* %218
%220 = extractelement <2 x double> %174, i64 1
%221 = fadd double %220, %219
br label %260
222: ; preds = %170
%223 = load double, double* %4
%224 = extractelement <2 x double> %171, i64 0
%225 = fsub double %223, %224
store double %225, double* %5
%226 = getelementptr inbounds double, double* %4, i64 1
%227 = load double, double* %226
%228 = extractelement <2 x double> %171, i64 1
%229 = fsub double %227, %228
%230 = getelementptr inbounds double, double* %5, i64 1
store double %229, double* %230
%231 = getelementptr inbounds double, double* %4, i64 2
%232 = load double, double* %231
%233 = extractelement <2 x double> %172, i64 0
%234 = fsub double %232, %233
%235 = getelementptr inbounds double, double* %5, i64 2
store double %234, double* %235
%236 = getelementptr inbounds double, double* %4, i64 3
%237 = load double, double* %236
%238 = extractelement <2 x double> %172, i64 1
%239 = fsub double %237, %238
%240 = getelementptr inbounds double, double* %5, i64 3
store double %239, double* %240
%241 = getelementptr inbounds double, double* %4, i64 4
%242 = load double, double* %241
%243 = extractelement <2 x double> %173, i64 0
%244 = fsub double %242, %243
%245 = getelementptr inbounds double, double* %5, i64 4
store double %244, double* %245
%246 = getelementptr inbounds double, double* %4, i64 5
%247 = load double, double* %246
%248 = extractelement <2 x double> %173, i64 1
%249 = fsub double %247, %248
%250 = getelementptr inbounds double, double* %5, i64 5
store double %249, double* %250
%251 = getelementptr inbounds double, double* %4, i64 6
%252 = load double, double* %251
%253 = extractelement <2 x double> %174, i64 0
%254 = fsub double %252, %253
%255 = getelementptr inbounds double, double* %5, i64 6
store double %254, double* %255
%256 = getelementptr inbounds double, double* %4, i64 7
%257 = load double, double* %256
%258 = extractelement <2 x double> %174, i64 1
%259 = fsub double %257, %258
br label %260
260: ; preds = %184, %222, %175
%261 = phi double [ %183, %175 ], [ %259, %222 ], [ %221, %184 ]
%262 = getelementptr inbounds double, double* %5, i64 7
store double %261, double* %262
br label %263
263: ; preds = %260, %7
ret void
}