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;
  k = 0;
  for (; k < ka - bs + 1; k += bs) {
    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    14d0 <kernel_dgemv_t_3_lib4+0x3d0>
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)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x40(%rbp),%ecx
sub    $0x4,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    135b <kernel_dgemv_t_3_lib4+0x25b>
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    115f <kernel_dgemv_t_3_lib4+0x5f>
jmp    1360 <kernel_dgemv_t_3_lib4+0x260>
mov    -0x3c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    13fe <kernel_dgemv_t_3_lib4+0x2fe>
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    1360 <kernel_dgemv_t_3_lib4+0x260>
cmpl   $0x0,0x10(%rbp)
jne    1436 <kernel_dgemv_t_3_lib4+0x336>
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    14d0 <kernel_dgemv_t_3_lib4+0x3d0>
cmpl   $0x1,0x10(%rbp)
jne    1488 <kernel_dgemv_t_3_lib4+0x388>
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    14cb <kernel_dgemv_t_3_lib4+0x3cb>
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    14d0 <kernel_dgemv_t_3_lib4+0x3d0>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dgemv_t_3_lib4>:
test   %edi,%edi
jle    134e <kernel_dgemv_t_3_lib4+0x24e>
cmp    $0x4,%edi
jb     11f6 <kernel_dgemv_t_3_lib4+0xf6>
lea    -0x3(%rdi),%r10d
shl    $0x2,%edx
movslq %edx,%rdx
shl    $0x3,%rdx
xorpd  %xmm2,%xmm2
xor    %eax,%eax
xorpd  %xmm0,%xmm0
nopl   0x0(%rax)
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,%eax
add    %rdx,%rsi
cmp    %r10d,%eax
jl     1130 <kernel_dgemv_t_3_lib4+0x30>
addpd  %xmm3,%xmm1
mov    %edi,%edx
and    $0xfffffffc,%edx
jmp    1200 <kernel_dgemv_t_3_lib4+0x100>
xorpd  %xmm1,%xmm1
xorpd  %xmm0,%xmm0
xor    %edx,%edx
mov    0x8(%rsp),%r10d
cmp    %edi,%edx
jge    121c <kernel_dgemv_t_3_lib4+0x11c>
mov    %edx,%eax
not    %eax
test   $0x1,%dil
jne    1229 <kernel_dgemv_t_3_lib4+0x129>
add    %edi,%eax
jne    1266 <kernel_dgemv_t_3_lib4+0x166>
jmp    12da <kernel_dgemv_t_3_lib4+0x1da>
movapd %xmm0,%xmm3
movapd %xmm1,%xmm2
jmp    12da <kernel_dgemv_t_3_lib4+0x1da>
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     12da <kernel_dgemv_t_3_lib4+0x1da>
sub    %edx,%edi
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
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    1270 <kernel_dgemv_t_3_lib4+0x170>
addpd  %xmm3,%xmm2
movapd %xmm0,%xmm3
cmp    $0x1,%r10d
je     12ec <kernel_dgemv_t_3_lib4+0x1ec>
test   %r10d,%r10d
jne    1315 <kernel_dgemv_t_3_lib4+0x215>
movupd %xmm2,(%r8)
jmp    1348 <kernel_dgemv_t_3_lib4+0x248>
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    1348 <kernel_dgemv_t_3_lib4+0x248>
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 %227
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
store i32 0, i32* %17
br label %31
31: ; preds = %129, %29
%32 = load i32, i32* %17
%33 = load i32, i32* %18
%34 = sub nsw i32 %33, 4
%35 = add nsw i32 %34, 1
%36 = icmp slt i32 %32, %35
br i1 %36, label %37, label %132
37: ; preds = %31
%38 = load double*, double** %11
%39 = getelementptr inbounds double, double* %38, i64 0
%40 = load double, double* %39
store double %40, double* %19
%41 = load double*, double** %11
%42 = getelementptr inbounds double, double* %41, i64 1
%43 = load double, double* %42
store double %43, double* %20
%44 = load double*, double** %11
%45 = getelementptr inbounds double, double* %44, i64 2
%46 = load double, double* %45
store double %46, double* %21
%47 = load double*, double** %11
%48 = getelementptr inbounds double, double* %47, i64 3
%49 = load double, double* %48
store double %49, double* %22
%50 = load double*, double** %9
%51 = getelementptr inbounds double, double* %50, i64 0
%52 = load double, double* %51
%53 = load double, double* %19
%54 = load double, double* %23
%55 = call double @llvm.fmuladd.f64(double %52, double %53, double %54)
store double %55, double* %23
%56 = load double*, double** %9
%57 = getelementptr inbounds double, double* %56, i64 4
%58 = load double, double* %57
%59 = load double, double* %19
%60 = load double, double* %24
%61 = call double @llvm.fmuladd.f64(double %58, double %59, double %60)
store double %61, double* %24
%62 = load double*, double** %9
%63 = getelementptr inbounds double, double* %62, i64 8
%64 = load double, double* %63
%65 = load double, double* %19
%66 = load double, double* %25
%67 = call double @llvm.fmuladd.f64(double %64, double %65, double %66)
store double %67, double* %25
%68 = load double*, double** %9
%69 = getelementptr inbounds double, double* %68, i64 1
%70 = load double, double* %69
%71 = load double, double* %20
%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 5
%76 = load double, double* %75
%77 = load double, double* %20
%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 9
%82 = load double, double* %81
%83 = load double, double* %20
%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 2
%88 = load double, double* %87
%89 = load double, double* %21
%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 6
%94 = load double, double* %93
%95 = load double, double* %21
%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 10
%100 = load double, double* %99
%101 = load double, double* %21
%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 3
%106 = load double, double* %105
%107 = load double, double* %22
%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 7
%112 = load double, double* %111
%113 = load double, double* %22
%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 11
%118 = load double, double* %117
%119 = load double, double* %22
%120 = load double, double* %25
%121 = call double @llvm.fmuladd.f64(double %118, double %119, double %120)
store double %121, double* %25
%122 = load i32, i32* %10
%123 = mul nsw i32 %122, 4
%124 = load double*, double** %9
%125 = sext i32 %123 to i64
%126 = getelementptr inbounds double, double* %124, i64 %125
store double* %126, double** %9
%127 = load double*, double** %11
%128 = getelementptr inbounds double, double* %127, i64 4
store double* %128, double** %11
br label %129
129: ; preds = %37
%130 = load i32, i32* %17
%131 = add nsw i32 %130, 4
store i32 %131, i32* %17
br label %31
132: ; preds = %31
br label %133
133: ; preds = %163, %132
%134 = load i32, i32* %17
%135 = load i32, i32* %18
%136 = icmp slt i32 %134, %135
br i1 %136, label %137, label %166
137: ; preds = %133
%138 = load double*, double** %11
%139 = getelementptr inbounds double, double* %138, i64 0
%140 = load double, double* %139
store double %140, double* %19
%141 = load double*, double** %9
%142 = getelementptr inbounds double, double* %141, i64 0
%143 = load double, double* %142
%144 = load double, double* %19
%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 4
%149 = load double, double* %148
%150 = load double, double* %19
%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 8
%155 = load double, double* %154
%156 = load double, double* %19
%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 1
store double* %160, double** %9
%161 = load double*, double** %11
%162 = getelementptr inbounds double, double* %161, i64 1
store double* %162, double** %11
br label %163
163: ; preds = %137
%164 = load i32, i32* %17
%165 = add nsw i32 %164, 1
store i32 %165, i32* %17
br label %133
166: ; preds = %133
%167 = load i32, i32* %14
%168 = icmp eq i32 %167, 0
br i1 %168, label %169, label %179
169: ; preds = %166
%170 = load double, double* %23
%171 = load double*, double** %12
%172 = getelementptr inbounds double, double* %171, i64 0
store double %170, double* %172
%173 = load double, double* %24
%174 = load double*, double** %12
%175 = getelementptr inbounds double, double* %174, i64 1
store double %173, double* %175
%176 = load double, double* %25
%177 = load double*, double** %12
%178 = getelementptr inbounds double, double* %177, i64 2
store double %176, double* %178
br label %227
179: ; preds = %166
%180 = load i32, i32* %14
%181 = icmp eq i32 %180, 1
br i1 %181, label %182, label %204
182: ; preds = %179
%183 = load double*, double** %12
%184 = getelementptr inbounds double, double* %183, i64 0
%185 = load double, double* %184
%186 = load double, double* %23
%187 = fadd double %185, %186
%188 = load double*, double** %13
%189 = getelementptr inbounds double, double* %188, i64 0
store double %187, double* %189
%190 = load double*, double** %12
%191 = getelementptr inbounds double, double* %190, i64 1
%192 = load double, double* %191
%193 = load double, double* %24
%194 = fadd double %192, %193
%195 = load double*, double** %13
%196 = getelementptr inbounds double, double* %195, i64 1
store double %194, double* %196
%197 = load double*, double** %12
%198 = getelementptr inbounds double, double* %197, i64 2
%199 = load double, double* %198
%200 = load double, double* %25
%201 = fadd double %199, %200
%202 = load double*, double** %13
%203 = getelementptr inbounds double, double* %202, i64 2
store double %201, double* %203
br label %226
204: ; preds = %179
%205 = load double*, double** %12
%206 = getelementptr inbounds double, double* %205, i64 0
%207 = load double, double* %206
%208 = load double, double* %23
%209 = fsub double %207, %208
%210 = load double*, double** %13
%211 = getelementptr inbounds double, double* %210, i64 0
store double %209, double* %211
%212 = load double*, double** %12
%213 = getelementptr inbounds double, double* %212, i64 1
%214 = load double, double* %213
%215 = load double, double* %24
%216 = fsub double %214, %215
%217 = load double*, double** %13
%218 = getelementptr inbounds double, double* %217, i64 1
store double %216, double* %218
%219 = load double*, double** %12
%220 = getelementptr inbounds double, double* %219, i64 2
%221 = load double, double* %220
%222 = load double, double* %25
%223 = fsub double %221, %222
%224 = load double*, double** %13
%225 = getelementptr inbounds double, double* %224, i64 2
store double %223, double* %225
br label %226
226: ; preds = %204, %182
br label %227
227: ; preds = %28, %226, %169
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 %194, label %9
9: ; preds = %7
%10 = add nsw i32 %0, -3
%11 = icmp ugt i32 %0, 3
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = shl nsw i32 %2, 2
%14 = sext i32 %13 to i64
br label %59
15: ; preds = %59
%16 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %76, <2 x double> %78, <2 x double> %64)
%17 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %88, <2 x double> %90, <2 x double> %16)
%18 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %100, <2 x double> %102, <2 x double> %17)
%19 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %112, <2 x double> %114, <2 x double> %18)
%20 = and i32 %0, -4
br label %21
21: ; preds = %15, %9
%22 = phi i32 [ 0, %9 ], [ %20, %15 ]
%23 = phi double* [ %3, %9 ], [ %120, %15 ]
%24 = phi double* [ %1, %9 ], [ %119, %15 ]
%25 = phi double [ 0.000000e+00, %9 ], [ %118, %15 ]
%26 = phi <2 x double> [ zeroinitializer, %9 ], [ %19, %15 ]
%27 = icmp slt i32 %22, %0
br i1 %27, label %28, label %161
28: ; preds = %21
%29 = xor i32 %22, -1
%30 = and i32 %0, 1
%31 = icmp eq i32 %30, 0
br i1 %31, label %49, label %32
32: ; preds = %28
%33 = load double, double* %23
%34 = load double, double* %24
%35 = getelementptr inbounds double, double* %24, i64 4
%36 = load double, double* %35
%37 = insertelement <2 x double> poison, double %34, i64 0
%38 = insertelement <2 x double> %37, double %36, i64 1
%39 = insertelement <2 x double> poison, double %33, i64 0
%40 = shufflevector <2 x double> %39, <2 x double> poison, <2 x i32> zeroinitializer
%41 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %38, <2 x double> %40, <2 x double> %26)
%42 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %38, <2 x double> %40, <2 x double> %26)
%43 = getelementptr inbounds double, double* %24, i64 8
%44 = load double, double* %43
%45 = tail call double @llvm.fmuladd.f64(double %44, double %33, double %25)
%46 = getelementptr inbounds double, double* %24, i64 1
%47 = getelementptr inbounds double, double* %23, i64 1
%48 = or i32 %22, 1
br label %49
49: ; preds = %32, %28
%50 = phi <2 x double> [ undef, %28 ], [ %42, %32 ]
%51 = phi double [ undef, %28 ], [ %45, %32 ]
%52 = phi double [ %25, %28 ], [ %45, %32 ]
%53 = phi double* [ %24, %28 ], [ %46, %32 ]
%54 = phi double* [ %23, %28 ], [ %47, %32 ]
%55 = phi i32 [ %22, %28 ], [ %48, %32 ]
%56 = phi <2 x double> [ %26, %28 ], [ %41, %32 ]
%57 = sub i32 0, %0
%58 = icmp eq i32 %29, %57
br i1 %58, label %161, label %123
59: ; preds = %12, %59
%60 = phi double [ 0.000000e+00, %12 ], [ %118, %59 ]
%61 = phi double* [ %1, %12 ], [ %119, %59 ]
%62 = phi double* [ %3, %12 ], [ %120, %59 ]
%63 = phi i32 [ 0, %12 ], [ %121, %59 ]
%64 = phi <2 x double> [ zeroinitializer, %12 ], [ %115, %59 ]
%65 = load double, double* %62
%66 = getelementptr inbounds double, double* %62, i64 1
%67 = load double, double* %66
%68 = getelementptr inbounds double, double* %62, i64 2
%69 = load double, double* %68
%70 = getelementptr inbounds double, double* %62, i64 3
%71 = load double, double* %70
%72 = load double, double* %61
%73 = getelementptr inbounds double, double* %61, i64 4
%74 = load double, double* %73
%75 = insertelement <2 x double> poison, double %72, i64 0
%76 = insertelement <2 x double> %75, double %74, i64 1
%77 = insertelement <2 x double> poison, double %65, i64 0
%78 = shufflevector <2 x double> %77, <2 x double> poison, <2 x i32> zeroinitializer
%79 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %76, <2 x double> %78, <2 x double> %64)
%80 = getelementptr inbounds double, double* %61, i64 8
%81 = load double, double* %80
%82 = tail call double @llvm.fmuladd.f64(double %81, double %65, double %60)
%83 = getelementptr inbounds double, double* %61, i64 1
%84 = load double, double* %83
%85 = getelementptr inbounds double, double* %61, i64 5
%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 %67, 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> %79)
%92 = getelementptr inbounds double, double* %61, i64 9
%93 = load double, double* %92
%94 = tail call double @llvm.fmuladd.f64(double %93, double %67, double %82)
%95 = getelementptr inbounds double, double* %61, i64 2
%96 = load double, double* %95
%97 = getelementptr inbounds double, double* %61, i64 6
%98 = load double, double* %97
%99 = insertelement <2 x double> poison, double %96, i64 0
%100 = insertelement <2 x double> %99, double %98, i64 1
%101 = insertelement <2 x double> poison, double %69, i64 0
%102 = shufflevector <2 x double> %101, <2 x double> poison, <2 x i32> zeroinitializer
%103 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %100, <2 x double> %102, <2 x double> %91)
%104 = getelementptr inbounds double, double* %61, i64 10
%105 = load double, double* %104
%106 = tail call double @llvm.fmuladd.f64(double %105, double %69, double %94)
%107 = getelementptr inbounds double, double* %61, i64 3
%108 = load double, double* %107
%109 = getelementptr inbounds double, double* %61, i64 7
%110 = load double, double* %109
%111 = insertelement <2 x double> poison, double %108, i64 0
%112 = insertelement <2 x double> %111, double %110, i64 1
%113 = insertelement <2 x double> poison, double %71, i64 0
%114 = shufflevector <2 x double> %113, <2 x double> poison, <2 x i32> zeroinitializer
%115 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %112, <2 x double> %114, <2 x double> %103)
%116 = getelementptr inbounds double, double* %61, i64 11
%117 = load double, double* %116
%118 = tail call double @llvm.fmuladd.f64(double %117, double %71, double %106)
%119 = getelementptr inbounds double, double* %61, i64 %14
%120 = getelementptr inbounds double, double* %62, i64 4
%121 = add nuw nsw i32 %63, 4
%122 = icmp slt i32 %121, %10
br i1 %122, label %59, label %15
123: ; preds = %49, %123
%124 = phi double [ %154, %123 ], [ %52, %49 ]
%125 = phi double* [ %155, %123 ], [ %53, %49 ]
%126 = phi double* [ %156, %123 ], [ %54, %49 ]
%127 = phi i32 [ %157, %123 ], [ %55, %49 ]
%128 = phi <2 x double> [ %151, %123 ], [ %56, %49 ]
%129 = load double, double* %126
%130 = load double, double* %125
%131 = getelementptr inbounds double, double* %125, i64 4
%132 = load double, double* %131
%133 = insertelement <2 x double> poison, double %130, i64 0
%134 = insertelement <2 x double> %133, double %132, i64 1
%135 = insertelement <2 x double> poison, double %129, i64 0
%136 = shufflevector <2 x double> %135, <2 x double> poison, <2 x i32> zeroinitializer
%137 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %134, <2 x double> %136, <2 x double> %128)
%138 = getelementptr inbounds double, double* %125, i64 8
%139 = load double, double* %138
%140 = tail call double @llvm.fmuladd.f64(double %139, double %129, double %124)
%141 = getelementptr inbounds double, double* %125, i64 1
%142 = getelementptr inbounds double, double* %126, i64 1
%143 = load double, double* %142
%144 = load double, double* %141
%145 = getelementptr inbounds double, double* %125, i64 5
%146 = load double, double* %145
%147 = insertelement <2 x double> poison, double %144, i64 0
%148 = insertelement <2 x double> %147, double %146, i64 1
%149 = insertelement <2 x double> poison, double %143, i64 0
%150 = shufflevector <2 x double> %149, <2 x double> poison, <2 x i32> zeroinitializer
%151 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %148, <2 x double> %150, <2 x double> %137)
%152 = getelementptr inbounds double, double* %125, i64 9
%153 = load double, double* %152
%154 = tail call double @llvm.fmuladd.f64(double %153, double %143, double %140)
%155 = getelementptr inbounds double, double* %125, i64 2
%156 = getelementptr inbounds double, double* %126, i64 2
%157 = add nuw nsw i32 %127, 2
%158 = icmp eq i32 %157, %0
br i1 %158, label %159, label %123
159: ; preds = %123
%160 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %148, <2 x double> %150, <2 x double> %137)
br label %161
161: ; preds = %159, %49, %21
%162 = phi double [ %25, %21 ], [ %51, %49 ], [ %154, %159 ]
%163 = phi <2 x double> [ %26, %21 ], [ %50, %49 ], [ %160, %159 ]
switch i32 %6, label %178 [
i32 0, label %164
i32 1, label %166
]
164: ; preds = %161
%165 = bitcast double* %4 to <2 x double>*
store <2 x double> %163, <2 x double>* %165
br label %190
166: ; preds = %161
%167 = load double, double* %4
%168 = extractelement <2 x double> %163, i64 0
%169 = fadd double %168, %167
store double %169, double* %5
%170 = getelementptr inbounds double, double* %4, i64 1
%171 = load double, double* %170
%172 = extractelement <2 x double> %163, i64 1
%173 = fadd double %172, %171
%174 = getelementptr inbounds double, double* %5, i64 1
store double %173, double* %174
%175 = getelementptr inbounds double, double* %4, i64 2
%176 = load double, double* %175
%177 = fadd double %162, %176
br label %190
178: ; preds = %161
%179 = load double, double* %4
%180 = extractelement <2 x double> %163, i64 0
%181 = fsub double %179, %180
store double %181, double* %5
%182 = getelementptr inbounds double, double* %4, i64 1
%183 = load double, double* %182
%184 = extractelement <2 x double> %163, i64 1
%185 = fsub double %183, %184
%186 = getelementptr inbounds double, double* %5, i64 1
store double %185, double* %186
%187 = getelementptr inbounds double, double* %4, i64 2
%188 = load double, double* %187
%189 = fsub double %188, %162
br label %190
190: ; preds = %166, %178, %164
%191 = phi double* [ %4, %164 ], [ %5, %178 ], [ %5, %166 ]
%192 = phi double [ %162, %164 ], [ %189, %178 ], [ %177, %166 ]
%193 = getelementptr inbounds double, double* %191, i64 2
store double %192, double* %193
br label %194
194: ; preds = %190, %7
ret void
}