void kernel_dgemv_t_4_lib4(int kmax, double *A, int sda, double *x, double *y,
                           double *z, int alg) {
  if (kmax <= 0)
    return;
  const int lda = 4;
  const int bs = 4;
  int k, ka = kmax;
  double x_0, x_1, x_2, x_3, y_0 = 0, y_1 = 0, y_2 = 0, y_3 = 0;
  __builtin_prefetch(A);
  __builtin_prefetch(A + 8);
  k = 0;
  for (; k < ka - bs + 1; k += bs) {
    __builtin_prefetch(A + sda * bs);
    __builtin_prefetch(A + sda * bs + 8);
    x_0 = x[0];
    x_1 = x[1];
    x_2 = x[2];
    x_3 = x[3];
    y_0 += A[0 + lda * 0] * x_0;
    y_1 += A[0 + lda * 1] * x_0;
    y_2 += A[0 + lda * 2] * x_0;
    y_3 += A[0 + lda * 3] * x_0;
    y_0 += A[1 + lda * 0] * x_1;
    y_1 += A[1 + lda * 1] * x_1;
    y_2 += A[1 + lda * 2] * x_1;
    y_3 += A[1 + lda * 3] * x_1;
    y_0 += A[2 + lda * 0] * x_2;
    y_1 += A[2 + lda * 1] * x_2;
    y_2 += A[2 + lda * 2] * x_2;
    y_3 += A[2 + lda * 3] * x_2;
    y_0 += A[3 + lda * 0] * x_3;
    y_1 += A[3 + lda * 1] * x_3;
    y_2 += A[3 + lda * 2] * x_3;
    y_3 += A[3 + lda * 3] * x_3;
    A += sda * bs;
    x += 4;
  }
  for (; k < ka; k++) {
    x_0 = x[0];
    y_0 += A[0 + lda * 0] * x_0;
    y_1 += A[0 + lda * 1] * x_0;
    y_2 += A[0 + lda * 2] * x_0;
    y_3 += A[0 + lda * 3] * x_0;
    A += 1;
    x += 1;
  }
  if (alg == 0) {
    z[0] = y_0;
    z[1] = y_1;
    z[2] = y_2;
    z[3] = y_3;
  } 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;
  } 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;
  }
}


x86 assembly (clang, -O0):
<kernel_dgemv_t_4_lib4>:
push   %rbp
mov    %rsp,%rbp
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     112c <kernel_dgemv_t_4_lib4+0x2c>
jmp    15f8 <kernel_dgemv_t_4_lib4+0x4f8>
movl   $0x4,-0x34(%rbp)
movl   $0x4,-0x38(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x40(%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)
mov    -0x10(%rbp),%rax
prefetcht0 (%rax)
mov    -0x10(%rbp),%rax
add    $0x40,%rax
prefetcht0 (%rax)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x40(%rbp),%ecx
sub    $0x4,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1427 <kernel_dgemv_t_4_lib4+0x327>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
prefetcht0 (%rax)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x40,%rax
prefetcht0 (%rax)
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  0x20(%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  0x40(%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  0x60(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%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  0x48(%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  0x68(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%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  0x30(%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  0x70(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%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  0x38(%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  0x58(%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    -0x14(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x20(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x3c(%rbp)
jmp    1179 <kernel_dgemv_t_4_lib4+0x79>
jmp    142c <kernel_dgemv_t_4_lib4+0x32c>
mov    -0x3c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    14ea <kernel_dgemv_t_4_lib4+0x3ea>
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  0x20(%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  0x40(%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  0x60(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    142c <kernel_dgemv_t_4_lib4+0x32c>
cmpl   $0x0,0x10(%rbp)
jne    1530 <kernel_dgemv_t_4_lib4+0x430>
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)
jmp    15f8 <kernel_dgemv_t_4_lib4+0x4f8>
cmpl   $0x1,0x10(%rbp)
jne    1599 <kernel_dgemv_t_4_lib4+0x499>
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)
jmp    15f3 <kernel_dgemv_t_4_lib4+0x4f3>
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)
jmp    15f8 <kernel_dgemv_t_4_lib4+0x4f8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dgemv_t_4_lib4>:
test   %edi,%edi
jle    1346 <kernel_dgemv_t_4_lib4+0x246>
prefetcht0 (%rsi)
prefetcht0 0x40(%rsi)
cmp    $0x4,%edi
jb     122d <kernel_dgemv_t_4_lib4+0x12d>
lea    -0x3(%rdi),%r10d
shl    $0x2,%edx
movslq %edx,%r11
lea    0x40(,%r11,8),%rax
shl    $0x3,%r11
xorpd  %xmm4,%xmm4
xor    %edx,%edx
xorpd  %xmm5,%xmm5
nopl   0x0(%rax,%rax,1)
prefetcht0 -0x40(%rsi,%rax,1)
prefetcht0 (%rsi,%rax,1)
movsd  (%rsi),%xmm7
movsd  0x8(%rsi),%xmm1
movsd  0x10(%rsi),%xmm2
movsd  0x18(%rsi),%xmm0
movhpd 0x20(%rsi),%xmm7
movsd  (%rcx),%xmm3
movsd  0x8(%rcx),%xmm6
movsd  0x10(%rcx),%xmm9
movsd  0x18(%rcx),%xmm8
unpcklpd %xmm3,%xmm3
mulpd  %xmm3,%xmm7
addpd  %xmm4,%xmm7
movsd  0x40(%rsi),%xmm4
movhpd 0x60(%rsi),%xmm4
mulpd  %xmm3,%xmm4
addpd  %xmm5,%xmm4
movhpd 0x28(%rsi),%xmm1
unpcklpd %xmm6,%xmm6
mulpd  %xmm6,%xmm1
addpd  %xmm7,%xmm1
movsd  0x48(%rsi),%xmm3
movhpd 0x68(%rsi),%xmm3
mulpd  %xmm6,%xmm3
addpd  %xmm4,%xmm3
movhpd 0x30(%rsi),%xmm2
unpcklpd %xmm9,%xmm9
mulpd  %xmm9,%xmm2
addpd  %xmm1,%xmm2
movsd  0x50(%rsi),%xmm7
movhpd 0x70(%rsi),%xmm7
mulpd  %xmm9,%xmm7
addpd  %xmm3,%xmm7
movhpd 0x38(%rsi),%xmm0
unpcklpd %xmm8,%xmm8
mulpd  %xmm8,%xmm0
movapd %xmm0,%xmm4
addpd  %xmm2,%xmm4
movsd  0x58(%rsi),%xmm1
movhpd 0x78(%rsi),%xmm1
mulpd  %xmm8,%xmm1
movapd %xmm1,%xmm5
addpd  %xmm7,%xmm5
add    $0x20,%rcx
add    $0x4,%edx
add    %r11,%rsi
cmp    %r10d,%edx
jl     1140 <kernel_dgemv_t_4_lib4+0x40>
addpd  %xmm7,%xmm1
addpd  %xmm2,%xmm0
mov    %edi,%edx
and    $0xfffffffc,%edx
jmp    1237 <kernel_dgemv_t_4_lib4+0x137>
xorpd  %xmm0,%xmm0
xor    %edx,%edx
xorpd  %xmm1,%xmm1
mov    0x8(%rsp),%eax
cmp    %edi,%edx
jge    12a8 <kernel_dgemv_t_4_lib4+0x1a8>
sub    %edx,%edi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd %xmm1,%xmm3
movapd %xmm0,%xmm2
movsd  (%rsi,%rdx,8),%xmm4
movsd  0x40(%rsi,%rdx,8),%xmm5
movhpd 0x20(%rsi,%rdx,8),%xmm4
movsd  (%rcx,%rdx,8),%xmm1
unpcklpd %xmm1,%xmm1
mulpd  %xmm1,%xmm4
movapd %xmm4,%xmm0
addpd  %xmm2,%xmm0
movhpd 0x60(%rsi,%rdx,8),%xmm5
mulpd  %xmm1,%xmm5
movapd %xmm5,%xmm1
addpd  %xmm3,%xmm1
add    $0x1,%rdx
cmp    %edx,%edi
jne    1250 <kernel_dgemv_t_4_lib4+0x150>
addpd  %xmm3,%xmm5
addpd  %xmm2,%xmm4
movapd %xmm4,%xmm0
movapd %xmm5,%xmm1
cmp    $0x1,%eax
je     12c2 <kernel_dgemv_t_4_lib4+0x1c2>
test   %eax,%eax
jne    12fc <kernel_dgemv_t_4_lib4+0x1fc>
movupd %xmm0,(%r9)
movlpd %xmm1,0x10(%r9)
unpckhpd %xmm1,%xmm1
jmp    1340 <kernel_dgemv_t_4_lib4+0x240>
movsd  (%r8),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%r9)
unpckhpd %xmm0,%xmm0
addsd  0x8(%r8),%xmm0
movsd  %xmm0,0x8(%r9)
movsd  0x10(%r8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%r9)
unpckhpd %xmm1,%xmm1
addsd  0x18(%r8),%xmm1
jmp    1340 <kernel_dgemv_t_4_lib4+0x240>
movsd  (%r8),%xmm2
subsd  %xmm0,%xmm2
movsd  %xmm2,(%r9)
movsd  0x8(%r8),%xmm2
unpckhpd %xmm0,%xmm0
subsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%r9)
movsd  0x10(%r8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%r9)
movsd  0x18(%r8),%xmm0
unpckhpd %xmm1,%xmm1
subsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
movsd  %xmm1,0x18(%r9)
ret

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

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