void kernel_strmv_ut_4_vs_lib4(int kmax, float *A, int sda, float *x, int alg,
                               float *y, float *z, int km) {
  const int bs = 4;
  int k;
  float x_0, x_1, x_2, x_3, y_0 = 0, y_1 = 0, y_2 = 0, y_3 = 0;
  k = 0;
  for (; k < kmax - 4; k += 4) {
    x_0 = x[0];
    x_1 = x[1];
    x_2 = x[2];
    x_3 = x[3];
    y_0 += A[0 + bs * 0] * x_0;
    y_1 += A[0 + bs * 1] * x_0;
    y_2 += A[0 + bs * 2] * x_0;
    y_3 += A[0 + bs * 3] * x_0;
    y_0 += A[1 + bs * 0] * x_1;
    y_1 += A[1 + bs * 1] * x_1;
    y_2 += A[1 + bs * 2] * x_1;
    y_3 += A[1 + bs * 3] * x_1;
    y_0 += A[2 + bs * 0] * x_2;
    y_1 += A[2 + bs * 1] * x_2;
    y_2 += A[2 + bs * 2] * x_2;
    y_3 += A[2 + bs * 3] * x_2;
    y_0 += A[3 + bs * 0] * x_3;
    y_1 += A[3 + bs * 1] * x_3;
    y_2 += A[3 + bs * 2] * x_3;
    y_3 += A[3 + bs * 3] * x_3;
    A += sda * bs;
    x += 4;
  }
  x_0 = x[0];
  x_1 = x[1];
  x_2 = x[2];
  x_3 = x[3];
  y_0 += A[0 + bs * 0] * x_0;
  y_1 += A[0 + bs * 1] * x_0;
  y_2 += A[0 + bs * 2] * x_0;
  y_3 += A[0 + bs * 3] * x_0;
  y_1 += A[1 + bs * 1] * x_1;
  y_2 += A[1 + bs * 2] * x_1;
  y_3 += A[1 + bs * 3] * x_1;
  y_2 += A[2 + bs * 2] * x_2;
  y_3 += A[2 + bs * 3] * x_2;
  y_3 += A[3 + bs * 3] * x_3;
  if (alg == 0) {
    goto store;
  } else if (alg == 1) {
    y_0 += y[0];
    y_1 += y[1];
    y_2 += y[2];
    y_3 += y[3];
    goto store;
  } else {
    y_0 = y[0] - y_0;
    y_1 = y[1] - y_1;
    y_2 = y[2] - y_2;
    y_3 = y[3] - y_3;
    goto store;
  }
store:
  if (km >= 4) {
    z[0] = y_0;
    z[1] = y_1;
    z[2] = y_2;
    z[3] = y_3;
  } else {
    z[0] = y_0;
    if (km >= 2) {
      z[1] = y_1;
      if (km > 2) {
        z[2] = y_2;
      }
    }
  }
}


x86 assembly (clang, -O0):
<kernel_strmv_ut_4_vs_lib4>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x4,-0x34(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x54(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x58(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x4,%ecx
cmp    %ecx,%eax
jge    13c8 <kernel_strmv_ut_4_vs_lib4+0x2c8>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x20(%rbp),%rax
movss  0xc(%rax),%xmm0
movss  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  -0x3c(%rbp),%xmm2
movss  -0x4c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
movss  0x10(%rax),%xmm0
movss  -0x3c(%rbp),%xmm2
movss  -0x50(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movss  0x20(%rax),%xmm0
movss  -0x3c(%rbp),%xmm2
movss  -0x54(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x54(%rbp)
mov    -0x10(%rbp),%rax
movss  0x30(%rax),%xmm0
movss  -0x3c(%rbp),%xmm2
movss  -0x58(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  -0x40(%rbp),%xmm2
movss  -0x4c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
movss  0x14(%rax),%xmm0
movss  -0x40(%rbp),%xmm2
movss  -0x50(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movss  0x24(%rax),%xmm0
movss  -0x40(%rbp),%xmm2
movss  -0x54(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x54(%rbp)
mov    -0x10(%rbp),%rax
movss  0x34(%rax),%xmm0
movss  -0x40(%rbp),%xmm2
movss  -0x58(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  -0x44(%rbp),%xmm2
movss  -0x4c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
movss  0x18(%rax),%xmm0
movss  -0x44(%rbp),%xmm2
movss  -0x50(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movss  0x28(%rax),%xmm0
movss  -0x44(%rbp),%xmm2
movss  -0x54(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x54(%rbp)
mov    -0x10(%rbp),%rax
movss  0x38(%rax),%xmm0
movss  -0x44(%rbp),%xmm2
movss  -0x58(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
movss  -0x48(%rbp),%xmm2
movss  -0x4c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
movss  0x1c(%rax),%xmm0
movss  -0x48(%rbp),%xmm2
movss  -0x50(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movss  0x2c(%rax),%xmm0
movss  -0x48(%rbp),%xmm2
movss  -0x54(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x54(%rbp)
mov    -0x10(%rbp),%rax
movss  0x3c(%rax),%xmm0
movss  -0x48(%rbp),%xmm2
movss  -0x58(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x20(%rbp)
mov    -0x38(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x38(%rbp)
jmp    114f <kernel_strmv_ut_4_vs_lib4+0x4f>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x20(%rbp),%rax
movss  0xc(%rax),%xmm0
movss  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  -0x3c(%rbp),%xmm2
movss  -0x4c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
movss  0x10(%rax),%xmm0
movss  -0x3c(%rbp),%xmm2
movss  -0x50(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movss  0x20(%rax),%xmm0
movss  -0x3c(%rbp),%xmm2
movss  -0x54(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x54(%rbp)
mov    -0x10(%rbp),%rax
movss  0x30(%rax),%xmm0
movss  -0x3c(%rbp),%xmm2
movss  -0x58(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movss  0x14(%rax),%xmm0
movss  -0x40(%rbp),%xmm2
movss  -0x50(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movss  0x24(%rax),%xmm0
movss  -0x40(%rbp),%xmm2
movss  -0x54(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x54(%rbp)
mov    -0x10(%rbp),%rax
movss  0x34(%rax),%xmm0
movss  -0x40(%rbp),%xmm2
movss  -0x58(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movss  0x28(%rax),%xmm0
movss  -0x44(%rbp),%xmm2
movss  -0x54(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x54(%rbp)
mov    -0x10(%rbp),%rax
movss  0x38(%rax),%xmm0
movss  -0x44(%rbp),%xmm2
movss  -0x58(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movss  0x3c(%rax),%xmm0
movss  -0x48(%rbp),%xmm2
movss  -0x58(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x58(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    154d <kernel_strmv_ut_4_vs_lib4+0x44d>
jmp    15f2 <kernel_strmv_ut_4_vs_lib4+0x4f2>
cmpl   $0x1,-0x24(%rbp)
jne    15a7 <kernel_strmv_ut_4_vs_lib4+0x4a7>
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm0
addss  -0x4c(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x30(%rbp),%rax
movss  0x4(%rax),%xmm0
addss  -0x50(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x30(%rbp),%rax
movss  0x8(%rax),%xmm0
addss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x54(%rbp)
mov    -0x30(%rbp),%rax
movss  0xc(%rax),%xmm0
addss  -0x58(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
jmp    15f2 <kernel_strmv_ut_4_vs_lib4+0x4f2>
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm0
subss  -0x4c(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x30(%rbp),%rax
movss  0x4(%rax),%xmm0
subss  -0x50(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x30(%rbp),%rax
movss  0x8(%rax),%xmm0
subss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x54(%rbp)
mov    -0x30(%rbp),%rax
movss  0xc(%rax),%xmm0
subss  -0x58(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
cmpl   $0x4,0x18(%rbp)
jl     1638 <kernel_strmv_ut_4_vs_lib4+0x538>
movss  -0x4c(%rbp),%xmm0
mov    0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x50(%rbp),%xmm0
mov    0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x54(%rbp),%xmm0
mov    0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x58(%rbp),%xmm0
mov    0x10(%rbp),%rax
movss  %xmm0,0xc(%rax)
jmp    167f <kernel_strmv_ut_4_vs_lib4+0x57f>
movss  -0x4c(%rbp),%xmm0
mov    0x10(%rbp),%rax
movss  %xmm0,(%rax)
cmpl   $0x2,0x18(%rbp)
jl     167a <kernel_strmv_ut_4_vs_lib4+0x57a>
movss  -0x50(%rbp),%xmm0
mov    0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
cmpl   $0x2,0x18(%rbp)
jle    1675 <kernel_strmv_ut_4_vs_lib4+0x575>
movss  -0x54(%rbp),%xmm0
mov    0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
jmp    167a <kernel_strmv_ut_4_vs_lib4+0x57a>
jmp    167f <kernel_strmv_ut_4_vs_lib4+0x57f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_strmv_ut_4_vs_lib4>:
xorps  %xmm0,%xmm0
cmp    $0x5,%edi
jl     11ea <kernel_strmv_ut_4_vs_lib4+0xea>
add    $0xfffffffc,%edi
shl    $0x2,%edx
movslq %edx,%rax
shl    $0x2,%rax
xorps  %xmm3,%xmm3
xor    %edx,%edx
xchg   %ax,%ax
movss  0x30(%rsi),%xmm0
movss  0x20(%rsi),%xmm1
unpcklps %xmm0,%xmm1
movss  0x10(%rsi),%xmm0
movss  (%rsi),%xmm6
unpcklps %xmm0,%xmm6
movlhps %xmm1,%xmm6
movss  0x4(%rsi),%xmm7
movss  0x8(%rsi),%xmm4
movss  0xc(%rsi),%xmm8
movss  (%rcx),%xmm2
movss  0x4(%rcx),%xmm5
movss  0x8(%rcx),%xmm1
movss  0xc(%rcx),%xmm0
shufps $0x0,%xmm2,%xmm2
mulps  %xmm6,%xmm2
addps  %xmm3,%xmm2
movss  0x34(%rsi),%xmm3
movss  0x24(%rsi),%xmm6
unpcklps %xmm3,%xmm6
movss  0x14(%rsi),%xmm3
unpcklps %xmm3,%xmm7
movlhps %xmm6,%xmm7
shufps $0x0,%xmm5,%xmm5
mulps  %xmm7,%xmm5
addps  %xmm2,%xmm5
movss  0x38(%rsi),%xmm2
movss  0x28(%rsi),%xmm3
unpcklps %xmm2,%xmm3
movss  0x18(%rsi),%xmm2
unpcklps %xmm2,%xmm4
movlhps %xmm3,%xmm4
shufps $0x0,%xmm1,%xmm1
mulps  %xmm4,%xmm1
addps  %xmm5,%xmm1
movss  0x3c(%rsi),%xmm2
movss  0x2c(%rsi),%xmm3
unpcklps %xmm2,%xmm3
movss  0x1c(%rsi),%xmm2
unpcklps %xmm2,%xmm8
movlhps %xmm3,%xmm8
shufps $0x0,%xmm0,%xmm0
mulps  %xmm8,%xmm0
movaps %xmm0,%xmm3
addps  %xmm1,%xmm3
add    $0x10,%rcx
add    $0x4,%edx
add    %rax,%rsi
cmp    %edi,%edx
jl     1120 <kernel_strmv_ut_4_vs_lib4+0x20>
addps  %xmm1,%xmm0
mov    0x10(%rsp),%edx
mov    0x8(%rsp),%rax
movups (%rcx),%xmm2
movaps %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm1
movss  0x10(%rsi),%xmm3
mulss  %xmm2,%xmm3
addss  %xmm1,%xmm3
movaps %xmm0,%xmm1
shufps $0xff,%xmm0,%xmm1
movss  0x30(%rsi),%xmm5
mulss  %xmm2,%xmm5
addss  %xmm1,%xmm5
movss  0x34(%rsi),%xmm6
movss  (%rsi),%xmm1
movss  0x14(%rsi),%xmm4
unpcklps %xmm4,%xmm1
movss  0x20(%rsi),%xmm4
unpcklps %xmm6,%xmm4
movss  0x24(%rsi),%xmm6
movaps %xmm0,%xmm7
unpckhpd %xmm0,%xmm7
unpcklps %xmm5,%xmm7
mulps  %xmm2,%xmm4
addps  %xmm7,%xmm4
movss  0x38(%rsi),%xmm5
unpcklps %xmm5,%xmm6
movss  0x3c(%rsi),%xmm5
movss  0x28(%rsi),%xmm7
unpcklps %xmm5,%xmm7
movlhps %xmm7,%xmm1
mulps  %xmm2,%xmm1
shufps $0xe9,%xmm2,%xmm2
mulps  %xmm6,%xmm2
addps  %xmm4,%xmm2
movlhps %xmm0,%xmm3
shufps $0x42,%xmm2,%xmm3
addps  %xmm3,%xmm1
test   %r8d,%r8d
je     1299 <kernel_strmv_ut_4_vs_lib4+0x199>
cmp    $0x1,%r8d
jne    128f <kernel_strmv_ut_4_vs_lib4+0x18f>
movups (%r9),%xmm0
addps  %xmm0,%xmm1
jmp    1299 <kernel_strmv_ut_4_vs_lib4+0x199>
movups (%r9),%xmm0
subps  %xmm1,%xmm0
movaps %xmm0,%xmm1
movss  %xmm1,(%rax)
cmp    $0x4,%edx
jl     12c5 <kernel_strmv_ut_4_vs_lib4+0x1c5>
movaps %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm0
movss  %xmm0,0x4(%rax)
movaps %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
movss  %xmm0,0x8(%rax)
shufps $0xff,%xmm1,%xmm1
mov    $0x3,%ecx
jmp    12e0 <kernel_strmv_ut_4_vs_lib4+0x1e0>
cmp    $0x2,%edx
jl     12e5 <kernel_strmv_ut_4_vs_lib4+0x1e5>
movaps %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm0
movss  %xmm0,0x4(%rax)
je     12e5 <kernel_strmv_ut_4_vs_lib4+0x1e5>
movhlps %xmm1,%xmm1
mov    $0x2,%ecx
movss  %xmm1,(%rax,%rcx,4)
ret

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

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