void kernel_dgemv_t_3_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;
  __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_0 += A[1 + lda * 0] * x_1;
    y_1 += A[1 + lda * 1] * x_1;
    y_2 += A[1 + lda * 2] * 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_0 += A[3 + lda * 0] * x_3;
    y_1 += A[3 + lda * 1] * x_3;
    y_2 += A[3 + lda * 2] * 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;
    A += 1;
    x += 1;
  }
  if (alg == 0) {
    y[0] = y_0;
    y[1] = y_1;
    y[2] = y_2;
  } else if (alg == 1) {
    z[0] = y[0] + y_0;
    z[1] = y[1] + y_1;
    z[2] = y[2] + y_2;
  } else {
    z[0] = y[0] - y_0;
    z[1] = y[1] - y_1;
    z[2] = y[2] - y_2;
  }
}


x86 assembly (clang, -O0):
<kernel_dgemv_t_3_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_3_lib4+0x2c>
jmp    1514 <kernel_dgemv_t_3_lib4+0x414>
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)
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    139f <kernel_dgemv_t_3_lib4+0x29f>
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  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  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  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    -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    1171 <kernel_dgemv_t_3_lib4+0x71>
jmp    13a4 <kernel_dgemv_t_3_lib4+0x2a4>
mov    -0x3c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1442 <kernel_dgemv_t_3_lib4+0x342>
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
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    13a4 <kernel_dgemv_t_3_lib4+0x2a4>
cmpl   $0x0,0x10(%rbp)
jne    147a <kernel_dgemv_t_3_lib4+0x37a>
movsd  -0x68(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x78(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x10(%rax)
jmp    1514 <kernel_dgemv_t_3_lib4+0x414>
cmpl   $0x1,0x10(%rbp)
jne    14cc <kernel_dgemv_t_3_lib4+0x3cc>
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)
jmp    150f <kernel_dgemv_t_3_lib4+0x40f>
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)
jmp    1514 <kernel_dgemv_t_3_lib4+0x414>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dgemv_t_3_lib4>:
test   %edi,%edi
jle    136e <kernel_dgemv_t_3_lib4+0x26e>
prefetcht0 (%rsi)
prefetcht0 0x40(%rsi)
cmp    $0x4,%edi
jb     120f <kernel_dgemv_t_3_lib4+0x10f>
lea    -0x3(%rdi),%r10d
shl    $0x2,%edx
movslq %edx,%r11
lea    0x40(,%r11,8),%rax
shl    $0x3,%r11
xorpd  %xmm2,%xmm2
xor    %edx,%edx
xorpd  %xmm0,%xmm0
nopl   0x0(%rax,%rax,1)
prefetcht0 -0x40(%rsi,%rax,1)
prefetcht0 (%rsi,%rax,1)
movsd  (%rcx),%xmm3
movsd  0x8(%rcx),%xmm1
movapd %xmm3,%xmm5
mulsd  0x40(%rsi),%xmm3
movsd  0x10(%rcx),%xmm4
addsd  %xmm0,%xmm3
movsd  0x18(%rcx),%xmm0
movsd  (%rsi),%xmm6
movsd  0x8(%rsi),%xmm7
movsd  0x10(%rsi),%xmm8
movhpd 0x20(%rsi),%xmm6
movsd  0x18(%rsi),%xmm9
unpcklpd %xmm5,%xmm5
mulpd  %xmm6,%xmm5
addpd  %xmm2,%xmm5
movhpd 0x28(%rsi),%xmm7
movapd %xmm1,%xmm2
unpcklpd %xmm1,%xmm2
mulpd  %xmm7,%xmm2
addpd  %xmm5,%xmm2
mulsd  0x48(%rsi),%xmm1
addsd  %xmm3,%xmm1
movhpd 0x30(%rsi),%xmm8
movapd %xmm4,%xmm3
unpcklpd %xmm4,%xmm3
mulpd  %xmm8,%xmm3
addpd  %xmm2,%xmm3
mulsd  0x50(%rsi),%xmm4
addsd  %xmm1,%xmm4
movhpd 0x38(%rsi),%xmm9
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
mulpd  %xmm9,%xmm1
movapd %xmm1,%xmm2
addpd  %xmm3,%xmm2
mulsd  0x58(%rsi),%xmm0
addsd  %xmm4,%xmm0
add    $0x20,%rcx
add    $0x4,%edx
add    %r11,%rsi
cmp    %r10d,%edx
jl     1140 <kernel_dgemv_t_3_lib4+0x40>
addpd  %xmm3,%xmm1
mov    %edi,%edx
and    $0xfffffffc,%edx
jmp    1219 <kernel_dgemv_t_3_lib4+0x119>
xorpd  %xmm1,%xmm1
xorpd  %xmm0,%xmm0
xor    %edx,%edx
mov    0x8(%rsp),%r10d
cmp    %edi,%edx
jge    1235 <kernel_dgemv_t_3_lib4+0x135>
mov    %edx,%eax
not    %eax
test   $0x1,%dil
jne    1242 <kernel_dgemv_t_3_lib4+0x142>
add    %edi,%eax
jne    127f <kernel_dgemv_t_3_lib4+0x17f>
jmp    12fa <kernel_dgemv_t_3_lib4+0x1fa>
movapd %xmm0,%xmm3
movapd %xmm1,%xmm2
jmp    12fa <kernel_dgemv_t_3_lib4+0x1fa>
movsd  (%rcx),%xmm3
movsd  (%rsi),%xmm4
movhpd 0x20(%rsi),%xmm4
movapd %xmm3,%xmm2
unpcklpd %xmm3,%xmm2
mulpd  %xmm4,%xmm2
addpd  %xmm1,%xmm2
mulsd  0x40(%rsi),%xmm3
addsd  %xmm0,%xmm3
add    $0x8,%rsi
add    $0x8,%rcx
or     $0x1,%edx
movapd %xmm3,%xmm0
movapd %xmm2,%xmm1
add    %edi,%eax
je     12fa <kernel_dgemv_t_3_lib4+0x1fa>
sub    %edx,%edi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%rsi,%rax,8),%xmm2
movhpd 0x20(%rsi,%rax,8),%xmm2
movsd  (%rcx,%rax,8),%xmm4
movapd %xmm4,%xmm3
mulsd  0x40(%rsi,%rax,8),%xmm4
movsd  0x8(%rsi,%rax,8),%xmm5
addsd  %xmm0,%xmm4
movsd  0x8(%rcx,%rax,8),%xmm0
unpcklpd %xmm3,%xmm3
mulpd  %xmm2,%xmm3
addpd  %xmm1,%xmm3
movhpd 0x28(%rsi,%rax,8),%xmm5
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm5,%xmm2
movapd %xmm2,%xmm1
mulsd  0x48(%rsi,%rax,8),%xmm0
addpd  %xmm3,%xmm1
addsd  %xmm4,%xmm0
add    $0x2,%rax
cmp    %eax,%edi
jne    1290 <kernel_dgemv_t_3_lib4+0x190>
addpd  %xmm3,%xmm2
movapd %xmm0,%xmm3
cmp    $0x1,%r10d
je     130c <kernel_dgemv_t_3_lib4+0x20c>
test   %r10d,%r10d
jne    1335 <kernel_dgemv_t_3_lib4+0x235>
movupd %xmm2,(%r8)
jmp    1368 <kernel_dgemv_t_3_lib4+0x268>
movsd  (%r8),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%r9)
unpckhpd %xmm2,%xmm2
addsd  0x8(%r8),%xmm2
movsd  %xmm2,0x8(%r9)
addsd  0x10(%r8),%xmm3
mov    %r9,%r8
jmp    1368 <kernel_dgemv_t_3_lib4+0x268>
movsd  (%r8),%xmm0
subsd  %xmm2,%xmm0
movsd  %xmm0,(%r9)
movsd  0x8(%r8),%xmm0
unpckhpd %xmm2,%xmm2
subsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%r9)
movsd  0x10(%r8),%xmm0
subsd  %xmm3,%xmm0
mov    %r9,%r8
movapd %xmm0,%xmm3
movsd  %xmm3,0x10(%r8)
ret

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

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