void _inner_mv_daxpy(double *a0, const double *x, int incX, const double *y0,
                     double alpha, int nRE) {
  register int i;
  register double cf0, cf1;
  cf0 = alpha * y0[0];
  for (i = 0; i < nRE - 3; i += 4) {
    a0[0] += x[0] * cf0;
    x += incX;
    a0[1] += x[0] * cf0;
    x += incX;
    a0[2] += x[0] * cf0;
    x += incX;
    a0[3] += x[0] * cf0;
    x += incX;
    a0 += 4;
  }
  if (i == nRE)
    return;
  if (i < nRE - 1) {
    a0[0] += x[0] * cf0;
    x += incX;
    a0[1] += x[0] * cf0;
    x += incX;
    a0 += 2;
    i += 2;
  }
  if (i < nRE) {
    a0[0] += x[0] * cf0;
    x += incX;
  }
}


x86 assembly (clang, -O0):
<_inner_mv_daxpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x2c(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    123e <_inner_mv_daxpy+0x13e>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x8(%rbp)
mov    -0x30(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x30(%rbp)
jmp    1135 <_inner_mv_daxpy+0x35>
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jne    124f <_inner_mv_daxpy+0x14f>
jmp    1325 <_inner_mv_daxpy+0x225>
mov    -0x30(%rbp),%eax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12e3 <_inner_mv_daxpy+0x1e3>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x8(%rbp)
mov    -0x30(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1325 <_inner_mv_daxpy+0x225>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_inner_mv_daxpy>:
mulsd  (%rcx),%xmm0
xor    %eax,%eax
cmp    $0x4,%r8d
jl     11a1 <_inner_mv_daxpy+0xa1>
lea    -0x3(%r8),%r10d
movslq %edx,%rax
mov    %rax,%r9
shl    $0x5,%r9
shl    $0x3,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rsi,%r11
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rdi),%xmm1
movsd  %xmm1,(%rdi)
add    %rax,%rsi
movsd  (%r11,%rax,1),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rdi),%xmm1
movsd  %xmm1,0x8(%rdi)
movsd  (%rax,%rsi,1),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rdi),%xmm1
add    %rax,%rsi
movsd  %xmm1,0x10(%rdi)
movsd  (%rax,%rsi,1),%xmm1
mulsd  %xmm0,%xmm1
add    %rax,%rsi
addsd  0x18(%rdi),%xmm1
movsd  %xmm1,0x18(%rdi)
add    $0x20,%rdi
add    $0x4,%ecx
add    %rax,%rsi
cmp    %r10d,%ecx
jl     1130 <_inner_mv_daxpy+0x30>
add    %r9,%r11
mov    %r8d,%eax
and    $0xfffffffc,%eax
mov    %r11,%rsi
cmp    %r8d,%eax
je     11f4 <_inner_mv_daxpy+0xf4>
lea    -0x1(%r8),%ecx
cmp    %ecx,%eax
jge    11e3 <_inner_mv_daxpy+0xe3>
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rdi),%xmm1
movsd  %xmm1,(%rdi)
movslq %edx,%rcx
lea    (%rsi,%rcx,8),%rdx
movsd  (%rsi,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rdi),%xmm1
movsd  %xmm1,0x8(%rdi)
lea    (%rdx,%rcx,8),%rsi
add    $0x10,%rdi
or     $0x2,%eax
cmp    %r8d,%eax
jge    11f4 <_inner_mv_daxpy+0xf4>
mulsd  (%rsi),%xmm0
addsd  (%rdi),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @_inner_mv_daxpy(double* %0, double* %1, i32 %2, double* %3, double %4, i32 %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca double*
%11 = alloca double
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
store double* %0, double** %7
store double* %1, double** %8
store i32 %2, i32* %9
store double* %3, double** %10
store double %4, double* %11
store i32 %5, i32* %12
%16 = load double, double* %11
%17 = load double*, double** %10
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
%20 = fmul double %16, %19
store double %20, double* %14
store i32 0, i32* %13
br label %21
21: ; preds = %77, %6
%22 = load i32, i32* %13
%23 = load i32, i32* %12
%24 = sub nsw i32 %23, 3
%25 = icmp slt i32 %22, %24
br i1 %25, label %26, label %80
26: ; preds = %21
%27 = load double*, double** %8
%28 = getelementptr inbounds double, double* %27, i64 0
%29 = load double, double* %28
%30 = load double, double* %14
%31 = load double*, double** %7
%32 = getelementptr inbounds double, double* %31, i64 0
%33 = load double, double* %32
%34 = call double @llvm.fmuladd.f64(double %29, double %30, double %33)
store double %34, double* %32
%35 = load i32, i32* %9
%36 = load double*, double** %8
%37 = sext i32 %35 to i64
%38 = getelementptr inbounds double, double* %36, i64 %37
store double* %38, double** %8
%39 = load double*, double** %8
%40 = getelementptr inbounds double, double* %39, i64 0
%41 = load double, double* %40
%42 = load double, double* %14
%43 = load double*, double** %7
%44 = getelementptr inbounds double, double* %43, i64 1
%45 = load double, double* %44
%46 = call double @llvm.fmuladd.f64(double %41, double %42, double %45)
store double %46, double* %44
%47 = load i32, i32* %9
%48 = load double*, double** %8
%49 = sext i32 %47 to i64
%50 = getelementptr inbounds double, double* %48, i64 %49
store double* %50, double** %8
%51 = load double*, double** %8
%52 = getelementptr inbounds double, double* %51, i64 0
%53 = load double, double* %52
%54 = load double, double* %14
%55 = load double*, double** %7
%56 = getelementptr inbounds double, double* %55, i64 2
%57 = load double, double* %56
%58 = call double @llvm.fmuladd.f64(double %53, double %54, double %57)
store double %58, double* %56
%59 = load i32, i32* %9
%60 = load double*, double** %8
%61 = sext i32 %59 to i64
%62 = getelementptr inbounds double, double* %60, i64 %61
store double* %62, double** %8
%63 = load double*, double** %8
%64 = getelementptr inbounds double, double* %63, i64 0
%65 = load double, double* %64
%66 = load double, double* %14
%67 = load double*, double** %7
%68 = getelementptr inbounds double, double* %67, i64 3
%69 = load double, double* %68
%70 = call double @llvm.fmuladd.f64(double %65, double %66, double %69)
store double %70, double* %68
%71 = load i32, i32* %9
%72 = load double*, double** %8
%73 = sext i32 %71 to i64
%74 = getelementptr inbounds double, double* %72, i64 %73
store double* %74, double** %8
%75 = load double*, double** %7
%76 = getelementptr inbounds double, double* %75, i64 4
store double* %76, double** %7
br label %77
77: ; preds = %26
%78 = load i32, i32* %13
%79 = add nsw i32 %78, 4
store i32 %79, i32* %13
br label %21
80: ; preds = %21
%81 = load i32, i32* %13
%82 = load i32, i32* %12
%83 = icmp eq i32 %81, %82
br i1 %83, label %84, label %85
84: ; preds = %80
br label %136
85: ; preds = %80
%86 = load i32, i32* %13
%87 = load i32, i32* %12
%88 = sub nsw i32 %87, 1
%89 = icmp slt i32 %86, %88
br i1 %89, label %90, label %119
90: ; preds = %85
%91 = load double*, double** %8
%92 = getelementptr inbounds double, double* %91, i64 0
%93 = load double, double* %92
%94 = load double, double* %14
%95 = load double*, double** %7
%96 = getelementptr inbounds double, double* %95, i64 0
%97 = load double, double* %96
%98 = call double @llvm.fmuladd.f64(double %93, double %94, double %97)
store double %98, double* %96
%99 = load i32, i32* %9
%100 = load double*, double** %8
%101 = sext i32 %99 to i64
%102 = getelementptr inbounds double, double* %100, i64 %101
store double* %102, double** %8
%103 = load double*, double** %8
%104 = getelementptr inbounds double, double* %103, i64 0
%105 = load double, double* %104
%106 = load double, double* %14
%107 = load double*, double** %7
%108 = getelementptr inbounds double, double* %107, i64 1
%109 = load double, double* %108
%110 = call double @llvm.fmuladd.f64(double %105, double %106, double %109)
store double %110, double* %108
%111 = load i32, i32* %9
%112 = load double*, double** %8
%113 = sext i32 %111 to i64
%114 = getelementptr inbounds double, double* %112, i64 %113
store double* %114, double** %8
%115 = load double*, double** %7
%116 = getelementptr inbounds double, double* %115, i64 2
store double* %116, double** %7
%117 = load i32, i32* %13
%118 = add nsw i32 %117, 2
store i32 %118, i32* %13
br label %119
119: ; preds = %90, %85
%120 = load i32, i32* %13
%121 = load i32, i32* %12
%122 = icmp slt i32 %120, %121
br i1 %122, label %123, label %136
123: ; preds = %119
%124 = load double*, double** %8
%125 = getelementptr inbounds double, double* %124, i64 0
%126 = load double, double* %125
%127 = load double, double* %14
%128 = load double*, double** %7
%129 = getelementptr inbounds double, double* %128, i64 0
%130 = load double, double* %129
%131 = call double @llvm.fmuladd.f64(double %126, double %127, double %130)
store double %131, double* %129
%132 = load i32, i32* %9
%133 = load double*, double** %8
%134 = sext i32 %132 to i64
%135 = getelementptr inbounds double, double* %133, i64 %134
store double* %135, double** %8
br label %136
136: ; preds = %84, %123, %119
ret void
}

LLVM IR (-O2):
define void @_inner_mv_daxpy(double* nocapture %0, double* nocapture %1, i32 %2, double* nocapture %3, double %4, i32 %5) {
%7 = load double, double* %3
%8 = fmul double %7, %4
%9 = add nsw i32 %5, -3
%10 = icmp sgt i32 %5, 3
br i1 %10, label %11, label %41
11: ; preds = %6
%12 = sext i32 %2 to i64
br label %13
13: ; preds = %11, %13
%14 = phi double* [ %0, %11 ], [ %36, %13 ]
%15 = phi double* [ %1, %11 ], [ %35, %13 ]
%16 = phi i32 [ 0, %11 ], [ %37, %13 ]
%17 = load double, double* %15
%18 = load double, double* %14
%19 = tail call double @llvm.fmuladd.f64(double %17, double %8, double %18)
store double %19, double* %14
%20 = getelementptr inbounds double, double* %15, i64 %12
%21 = load double, double* %20
%22 = getelementptr inbounds double, double* %14, i64 1
%23 = load double, double* %22
%24 = tail call double @llvm.fmuladd.f64(double %21, double %8, double %23)
store double %24, double* %22
%25 = getelementptr inbounds double, double* %20, i64 %12
%26 = load double, double* %25
%27 = getelementptr inbounds double, double* %14, i64 2
%28 = load double, double* %27
%29 = tail call double @llvm.fmuladd.f64(double %26, double %8, double %28)
store double %29, double* %27
%30 = getelementptr inbounds double, double* %25, i64 %12
%31 = load double, double* %30
%32 = getelementptr inbounds double, double* %14, i64 3
%33 = load double, double* %32
%34 = tail call double @llvm.fmuladd.f64(double %31, double %8, double %33)
store double %34, double* %32
%35 = getelementptr inbounds double, double* %30, i64 %12
%36 = getelementptr inbounds double, double* %14, i64 4
%37 = add nuw nsw i32 %16, 4
%38 = icmp slt i32 %37, %9
br i1 %38, label %13, label %39
39: ; preds = %13
%40 = and i32 %5, -4
br label %41
41: ; preds = %39, %6
%42 = phi i32 [ 0, %6 ], [ %40, %39 ]
%43 = phi double* [ %1, %6 ], [ %35, %39 ]
%44 = phi double* [ %0, %6 ], [ %36, %39 ]
%45 = icmp eq i32 %42, %5
br i1 %45, label %71, label %46
46: ; preds = %41
%47 = add nsw i32 %5, -1
%48 = icmp slt i32 %42, %47
br i1 %48, label %49, label %62
49: ; preds = %46
%50 = load double, double* %43
%51 = load double, double* %44
%52 = tail call double @llvm.fmuladd.f64(double %50, double %8, double %51)
store double %52, double* %44
%53 = sext i32 %2 to i64
%54 = getelementptr inbounds double, double* %43, i64 %53
%55 = load double, double* %54
%56 = getelementptr inbounds double, double* %44, i64 1
%57 = load double, double* %56
%58 = tail call double @llvm.fmuladd.f64(double %55, double %8, double %57)
store double %58, double* %56
%59 = getelementptr inbounds double, double* %54, i64 %53
%60 = getelementptr inbounds double, double* %44, i64 2
%61 = or i32 %42, 2
br label %62
62: ; preds = %49, %46
%63 = phi i32 [ %61, %49 ], [ %42, %46 ]
%64 = phi double* [ %59, %49 ], [ %43, %46 ]
%65 = phi double* [ %60, %49 ], [ %44, %46 ]
%66 = icmp slt i32 %63, %5
br i1 %66, label %67, label %71
67: ; preds = %62
%68 = load double, double* %64
%69 = load double, double* %65
%70 = tail call double @llvm.fmuladd.f64(double %68, double %8, double %69)
store double %70, double* %65
br label %71
71: ; preds = %62, %67, %41
ret void
}