void _inner_daxpy(double *Cr, const double *Ar, const double *Br, double alpha,
                  int m) {
  register int i, k;
  register double cf;
  cf = Br[0] * alpha;
  for (i = m - 3; i > 0; i -= 4) {
    Cr[0] += Ar[0] * cf;
    Cr[1] += Ar[1] * cf;
    Cr[2] += Ar[2] * cf;
    Cr[3] += Ar[3] * cf;
    Cr += 4;
    Ar += 4;
  }
  i += 3;
  k = 0;
  switch (i) {
  case 3:
    Cr[k] += Ar[k] * cf;
    k++;
  case 2:
    Cr[k] += Ar[k] * cf;
    k++;
  case 1:
    Cr[k] += Ar[k] * cf;
  }
}


x86 assembly (clang, -O0):
<_inner_daxpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x24(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jle    11f0 <_inner_daxpy+0xf0>
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    -0x10(%rbp),%rax
movsd  0x8(%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    -0x10(%rbp),%rax
movsd  0x10(%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    -0x10(%rbp),%rax
movsd  0x18(%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    -0x8(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x28(%rbp)
jmp    1133 <_inner_daxpy+0x33>
mov    -0x28(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x3c(%rbp)
sub    $0x1,%eax
je     12a0 <_inner_daxpy+0x1a0>
jmp    1214 <_inner_daxpy+0x114>
mov    -0x3c(%rbp),%eax
sub    $0x2,%eax
je     126b <_inner_daxpy+0x16b>
jmp    1225 <_inner_daxpy+0x125>
mov    -0x3c(%rbp),%eax
sub    $0x3,%eax
jne    12cc <_inner_daxpy+0x1cc>
jmp    1236 <_inner_daxpy+0x136>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x38(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x38(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x38(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_inner_daxpy>:
mulsd  (%rdx),%xmm0
lea    -0x3(%rcx),%r10d
cmp    $0x4,%ecx
jl     11cf <_inner_daxpy+0xcf>
cmp    $0x4,%r10d
mov    $0x4,%eax
mov    $0x4,%edx
cmovb  %r10d,%edx
mov    %ecx,%r8d
sub    %edx,%r8d
cmp    $0x4,%r8d
jb     115e <_inner_daxpy+0x5e>
cmp    $0x4,%r10d
cmovb  %r10d,%eax
sub    %eax,%ecx
and    $0xfffffffc,%ecx
lea    (%rsi,%rcx,8),%rax
add    $0x20,%rax
cmp    %rdi,%rax
jbe    1225 <_inner_daxpy+0x125>
lea    (%rdi,%rcx,8),%rax
add    $0x20,%rax
cmp    %rsi,%rax
jbe    1225 <_inner_daxpy+0x125>
mov    %rdi,%rax
mov    %rsi,%rcx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rcx),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rax),%xmm1
movsd  %xmm1,(%rax)
movsd  0x8(%rcx),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rax),%xmm1
mov    %r10d,%edx
movsd  %xmm1,0x8(%rax)
movsd  0x10(%rcx),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rax),%xmm1
movsd  %xmm1,0x10(%rax)
movsd  0x18(%rcx),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x18(%rax),%xmm1
movsd  %xmm1,0x18(%rax)
add    $0x20,%rax
add    $0x20,%rcx
lea    -0x4(%rdx),%r10d
cmp    $0x4,%edx
ja     1170 <_inner_daxpy+0x70>
jmp    11d5 <_inner_daxpy+0xd5>
mov    %rsi,%rcx
mov    %rdi,%rax
xor    %edx,%edx
cmp    $0xfffffffe,%r10d
je     1215 <_inner_daxpy+0x115>
cmp    $0xffffffff,%r10d
je     11fd <_inner_daxpy+0xfd>
test   %r10d,%r10d
jne    1224 <_inner_daxpy+0x124>
movsd  (%rcx),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rax),%xmm1
movsd  %xmm1,(%rax)
mov    $0x1,%edx
mov    %edx,%esi
movsd  (%rcx,%rsi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rax,%rsi,8),%xmm1
movsd  %xmm1,(%rax,%rsi,8)
add    $0x1,%edx
mulsd  (%rcx,%rdx,8),%xmm0
addsd  (%rax,%rdx,8),%xmm0
movsd  %xmm0,(%rax,%rdx,8)
ret
shr    $0x2,%r8d
add    $0x1,%r8d
mov    %r8d,%r9d
and    $0xfffffffe,%r9d
mov    %r9,%rcx
shl    $0x5,%rcx
lea    (%rdi,%rcx,1),%rax
lea    0x0(,%r9,4),%edx
sub    %edx,%r10d
add    %rsi,%rcx
movapd %xmm0,%xmm8
unpcklpd %xmm0,%xmm8
xor    %edx,%edx
mov    %r9,%r11
nopl   0x0(%rax)
movupd (%rsi,%rdx,1),%xmm2
movupd 0x10(%rsi,%rdx,1),%xmm3
movupd 0x20(%rsi,%rdx,1),%xmm5
movupd 0x30(%rsi,%rdx,1),%xmm6
movapd %xmm2,%xmm4
unpcklpd %xmm5,%xmm4
unpckhpd %xmm5,%xmm2
movapd %xmm3,%xmm5
unpcklpd %xmm6,%xmm5
unpckhpd %xmm6,%xmm3
movupd (%rdi,%rdx,1),%xmm6
movupd 0x10(%rdi,%rdx,1),%xmm10
movupd 0x20(%rdi,%rdx,1),%xmm1
movupd 0x30(%rdi,%rdx,1),%xmm9
movapd %xmm6,%xmm7
unpcklpd %xmm1,%xmm7
unpckhpd %xmm1,%xmm6
movapd %xmm10,%xmm1
unpcklpd %xmm9,%xmm1
unpckhpd %xmm9,%xmm10
mulpd  %xmm8,%xmm4
addpd  %xmm7,%xmm4
mulpd  %xmm8,%xmm2
addpd  %xmm6,%xmm2
mulpd  %xmm8,%xmm5
addpd  %xmm1,%xmm5
mulpd  %xmm8,%xmm3
addpd  %xmm10,%xmm3
movapd %xmm5,%xmm1
unpcklpd %xmm3,%xmm1
movapd %xmm4,%xmm6
unpcklpd %xmm2,%xmm6
movhlps %xmm5,%xmm3
movhlps %xmm4,%xmm2
movups %xmm2,0x20(%rdi,%rdx,1)
movups %xmm3,0x30(%rdi,%rdx,1)
movupd %xmm6,(%rdi,%rdx,1)
movupd %xmm1,0x10(%rdi,%rdx,1)
add    $0x40,%rdx
add    $0xfffffffffffffffe,%r11
jne    1260 <_inner_daxpy+0x160>
cmp    %r8,%r9
jne    1170 <_inner_daxpy+0x70>
jmp    11d5 <_inner_daxpy+0xd5>

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

LLVM IR (-O2):
define void @_inner_daxpy(double* nocapture %0, double* nocapture %1, double* nocapture %2, double %3, i32 %4) {
%6 = load double, double* %2
%7 = fmul double %6, %3
%8 = add i32 %4, -3
%9 = icmp sgt i32 %4, 3
br i1 %9, label %10, label %101
10: ; preds = %5
%11 = call i32 @llvm.umin.i32(i32 %8, i32 4)
%12 = sub i32 %4, %11
%13 = lshr i32 %12, 2
%14 = add nuw nsw i32 %13, 1
%15 = zext i32 %14 to i64
%16 = icmp ult i32 %12, 4
br i1 %16, label %71, label %17
17: ; preds = %10
%18 = call i32 @llvm.umin.i32(i32 %8, i32 4)
%19 = sub i32 %4, %18
%20 = and i32 %19, -4
%21 = zext i32 %20 to i64
%22 = add nuw nsw i64 %21, 4
%23 = getelementptr double, double* %0, i64 %22
%24 = getelementptr double, double* %1, i64 %22
%25 = icmp ugt double* %24, %0
%26 = icmp ugt double* %23, %1
%27 = and i1 %25, %26
br i1 %27, label %71, label %28
28: ; preds = %17
%29 = and i64 %15, 2147483646
%30 = shl nuw nsw i64 %29, 2
%31 = getelementptr double, double* %0, i64 %30
%32 = trunc i64 %29 to i32
%33 = mul i32 %32, -4
%34 = add i32 %8, %33
%35 = shl nuw nsw i64 %29, 2
%36 = getelementptr double, double* %1, i64 %35
%37 = insertelement <2 x double> poison, double %7, i64 0
%38 = shufflevector <2 x double> %37, <2 x double> poison, <2 x i32> zeroinitializer
br label %39
39: ; preds = %39, %28
%40 = phi i64 [ 0, %28 ], [ %67, %39 ]
%41 = shl i64 %40, 2
%42 = getelementptr double, double* %0, i64 %41
%43 = shl i64 %40, 2
%44 = getelementptr double, double* %1, i64 %43
%45 = bitcast double* %44 to <8 x double>*
%46 = load <8 x double>, <8 x double>* %45
%47 = shufflevector <8 x double> %46, <8 x double> poison, <2 x i32> <i32 0, i32 4>
%48 = shufflevector <8 x double> %46, <8 x double> poison, <2 x i32> <i32 1, i32 5>
%49 = shufflevector <8 x double> %46, <8 x double> poison, <2 x i32> <i32 2, i32 6>
%50 = shufflevector <8 x double> %46, <8 x double> poison, <2 x i32> <i32 3, i32 7>
%51 = bitcast double* %42 to <8 x double>*
%52 = load <8 x double>, <8 x double>* %51
%53 = shufflevector <8 x double> %52, <8 x double> poison, <2 x i32> <i32 0, i32 4>
%54 = shufflevector <8 x double> %52, <8 x double> poison, <2 x i32> <i32 1, i32 5>
%55 = shufflevector <8 x double> %52, <8 x double> poison, <2 x i32> <i32 2, i32 6>
%56 = shufflevector <8 x double> %52, <8 x double> poison, <2 x i32> <i32 3, i32 7>
%57 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %47, <2 x double> %38, <2 x double> %53)
%58 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %48, <2 x double> %38, <2 x double> %54)
%59 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %49, <2 x double> %38, <2 x double> %55)
%60 = getelementptr inbounds double, double* %42, i64 3
%61 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %50, <2 x double> %38, <2 x double> %56)
%62 = getelementptr inbounds double, double* %60, i64 -3
%63 = bitcast double* %62 to <8 x double>*
%64 = shufflevector <2 x double> %57, <2 x double> %58, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%65 = shufflevector <2 x double> %59, <2 x double> %61, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%66 = shufflevector <4 x double> %64, <4 x double> %65, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 1, i32 3, i32 5, i32 7>
store <8 x double> %66, <8 x double>* %63
%67 = add nuw i64 %40, 2
%68 = icmp eq i64 %67, %29
br i1 %68, label %69, label %39
69: ; preds = %39
%70 = icmp eq i64 %29, %15
br i1 %70, label %101, label %71
71: ; preds = %17, %10, %69
%72 = phi double* [ %0, %17 ], [ %0, %10 ], [ %31, %69 ]
%73 = phi i32 [ %8, %17 ], [ %8, %10 ], [ %34, %69 ]
%74 = phi double* [ %1, %17 ], [ %1, %10 ], [ %36, %69 ]
br label %75
75: ; preds = %71, %75
%76 = phi double* [ %97, %75 ], [ %72, %71 ]
%77 = phi i32 [ %99, %75 ], [ %73, %71 ]
%78 = phi double* [ %98, %75 ], [ %74, %71 ]
%79 = load double, double* %78
%80 = load double, double* %76
%81 = tail call double @llvm.fmuladd.f64(double %79, double %7, double %80)
store double %81, double* %76
%82 = getelementptr inbounds double, double* %78, i64 1
%83 = load double, double* %82
%84 = getelementptr inbounds double, double* %76, i64 1
%85 = load double, double* %84
%86 = tail call double @llvm.fmuladd.f64(double %83, double %7, double %85)
store double %86, double* %84
%87 = getelementptr inbounds double, double* %78, i64 2
%88 = load double, double* %87
%89 = getelementptr inbounds double, double* %76, i64 2
%90 = load double, double* %89
%91 = tail call double @llvm.fmuladd.f64(double %88, double %7, double %90)
store double %91, double* %89
%92 = getelementptr inbounds double, double* %78, i64 3
%93 = load double, double* %92
%94 = getelementptr inbounds double, double* %76, i64 3
%95 = load double, double* %94
%96 = tail call double @llvm.fmuladd.f64(double %93, double %7, double %95)
store double %96, double* %94
%97 = getelementptr inbounds double, double* %76, i64 4
%98 = getelementptr inbounds double, double* %78, i64 4
%99 = add nsw i32 %77, -4
%100 = icmp ugt i32 %77, 4
br i1 %100, label %75, label %101
101: ; preds = %75, %69, %5
%102 = phi double* [ %1, %5 ], [ %36, %69 ], [ %98, %75 ]
%103 = phi i32 [ %8, %5 ], [ %34, %69 ], [ %99, %75 ]
%104 = phi double* [ %0, %5 ], [ %31, %69 ], [ %97, %75 ]
switch i32 %103, label %126 [
i32 0, label %105
i32 -1, label %109
i32 -2, label %119
]
105: ; preds = %101
%106 = load double, double* %102
%107 = load double, double* %104
%108 = tail call double @llvm.fmuladd.f64(double %106, double %7, double %107)
store double %108, double* %104
br label %109
109: ; preds = %101, %105
%110 = phi i32 [ 0, %101 ], [ 1, %105 ]
%111 = zext i32 %110 to i64
%112 = getelementptr inbounds double, double* %102, i64 %111
%113 = load double, double* %112
%114 = getelementptr inbounds double, double* %104, i64 %111
%115 = load double, double* %114
%116 = tail call double @llvm.fmuladd.f64(double %113, double %7, double %115)
store double %116, double* %114
%117 = add nuw nsw i32 %110, 1
%118 = zext i32 %117 to i64
br label %119
119: ; preds = %101, %109
%120 = phi i64 [ 0, %101 ], [ %118, %109 ]
%121 = getelementptr inbounds double, double* %102, i64 %120
%122 = load double, double* %121
%123 = getelementptr inbounds double, double* %104, i64 %120
%124 = load double, double* %123
%125 = tail call double @llvm.fmuladd.f64(double %122, double %7, double %124)
store double %125, double* %123
br label %126
126: ; preds = %119, %101
ret void
}