void kernel_dgead_4_1_lib4(int kmax, double alpha, double *A0, int sda,
                           double *B) {
  if (kmax <= 0)
    return;
  const int bs = 4;
  double *A1 = A0 + bs * sda;
  int k;
  for (k = 0; k < kmax - 3; k += 4) {
    B[0 + bs * 0] += alpha * A0[1 + bs * 0];
    B[1 + bs * 0] += alpha * A0[2 + bs * 0];
    B[2 + bs * 0] += alpha * A0[3 + bs * 0];
    B[3 + bs * 0] += alpha * A1[0 + bs * 0];
    B[0 + bs * 1] += alpha * A0[1 + bs * 1];
    B[1 + bs * 1] += alpha * A0[2 + bs * 1];
    B[2 + bs * 1] += alpha * A0[3 + bs * 1];
    B[3 + bs * 1] += alpha * A1[0 + bs * 1];
    B[0 + bs * 2] += alpha * A0[1 + bs * 2];
    B[1 + bs * 2] += alpha * A0[2 + bs * 2];
    B[2 + bs * 2] += alpha * A0[3 + bs * 2];
    B[3 + bs * 2] += alpha * A1[0 + bs * 2];
    B[0 + bs * 3] += alpha * A0[1 + bs * 3];
    B[1 + bs * 3] += alpha * A0[2 + bs * 3];
    B[2 + bs * 3] += alpha * A0[3 + bs * 3];
    B[3 + bs * 3] += alpha * A1[0 + bs * 3];
    A0 += 16;
    A1 += 16;
    B += 16;
  }
  for (; k < kmax; k++) {
    B[0 + bs * 0] += alpha * A0[1 + bs * 0];
    B[1 + bs * 0] += alpha * A0[2 + bs * 0];
    B[2 + bs * 0] += alpha * A0[3 + bs * 0];
    B[3 + bs * 0] += alpha * A1[0 + bs * 0];
    A0 += 4;
    A1 += 4;
    B += 4;
  }
}


x86 assembly (clang, -O0):
<kernel_dgead_4_1_lib4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1126 <kernel_dgead_4_1_lib4+0x26>
jmp    14a2 <kernel_dgead_4_1_lib4+0x3a2>
movl   $0x4,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    13d2 <kernel_dgead_4_1_lib4+0x2d2>
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x18(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x28(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x20(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x30(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x28(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x28(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x38(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x30(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x30(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  0x20(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x38(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x38(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x48(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x40(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x40(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x50(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x48(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x48(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x58(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x50(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x50(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  0x40(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x58(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x58(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x68(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x60(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x60(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x70(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x68(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x68(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x78(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x70(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x70(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  0x60(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x78(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x78(%rax)
mov    -0x18(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x18(%rbp)
mov    -0x38(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x28(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x3c(%rbp)
jmp    114c <kernel_dgead_4_1_lib4+0x4c>
jmp    13d7 <kernel_dgead_4_1_lib4+0x2d7>
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    14a2 <kernel_dgead_4_1_lib4+0x3a2>
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x18(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x18(%rbp)
mov    -0x38(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x28(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13d7 <kernel_dgead_4_1_lib4+0x2d7>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dgead_4_1_lib4>:
push   %rbp
push   %rbx
test   %edi,%edi
jle    145e <kernel_dgead_4_1_lib4+0x35e>
shl    $0x2,%edx
movslq %edx,%rax
cmp    $0x4,%edi
jb     127a <kernel_dgead_4_1_lib4+0x17a>
lea    -0x3(%rdi),%r8d
xor    %edx,%edx
nop
movsd  0x8(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rcx),%xmm1
movsd  %xmm1,(%rcx)
movsd  0x10(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rcx),%xmm1
movsd  %xmm1,0x8(%rcx)
movsd  0x18(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rcx),%xmm1
movsd  %xmm1,0x10(%rcx)
movsd  (%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x18(%rcx),%xmm1
movsd  %xmm1,0x18(%rcx)
movsd  0x28(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x20(%rcx),%xmm1
movsd  %xmm1,0x20(%rcx)
movsd  0x30(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x28(%rcx),%xmm1
movsd  %xmm1,0x28(%rcx)
movsd  0x38(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x30(%rcx),%xmm1
movsd  %xmm1,0x30(%rcx)
movsd  0x20(%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x38(%rcx),%xmm1
movsd  %xmm1,0x38(%rcx)
movsd  0x48(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x40(%rcx),%xmm1
movsd  %xmm1,0x40(%rcx)
movsd  0x50(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x48(%rcx),%xmm1
movsd  %xmm1,0x48(%rcx)
movsd  0x58(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x50(%rcx),%xmm1
movsd  %xmm1,0x50(%rcx)
movsd  0x40(%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x58(%rcx),%xmm1
movsd  %xmm1,0x58(%rcx)
movsd  0x68(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x60(%rcx),%xmm1
movsd  %xmm1,0x60(%rcx)
movsd  0x70(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x68(%rcx),%xmm1
movsd  %xmm1,0x68(%rcx)
movsd  0x78(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x70(%rcx),%xmm1
movsd  %xmm1,0x70(%rcx)
movsd  0x60(%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x78(%rcx),%xmm1
movsd  %xmm1,0x78(%rcx)
sub    $0xffffffffffffff80,%rsi
sub    $0xffffffffffffff80,%rcx
add    $0x4,%edx
cmp    %r8d,%edx
jl     1120 <kernel_dgead_4_1_lib4+0x20>
mov    %edi,%r8d
and    $0xfffffffc,%r8d
lea    (%rsi,%rax,8),%rax
cmp    %edi,%r8d
jl     128a <kernel_dgead_4_1_lib4+0x18a>
jmp    145e <kernel_dgead_4_1_lib4+0x35e>
lea    (%rsi,%rax,8),%rax
xor    %r8d,%r8d
cmp    %edi,%r8d
jge    145e <kernel_dgead_4_1_lib4+0x35e>
mov    %r8d,%edx
not    %edx
add    %edi,%edx
cmp    $0x1,%edx
jbe    13f8 <kernel_dgead_4_1_lib4+0x2f8>
mov    %rdx,%rbx
shl    $0x5,%rbx
lea    (%rcx,%rbx,1),%r9
add    $0x20,%r9
lea    (%rax,%rbx,1),%r10
add    $0x8,%r10
lea    0x8(%rsi),%r11
add    %rsi,%rbx
add    $0x20,%rbx
cmp    %r10,%rcx
setb   %r10b
cmp    %r9,%rax
setb   %bpl
cmp    %rbx,%rcx
setb   %bl
cmp    %r9,%r11
setb   %r9b
test   %bpl,%r10b
jne    13f8 <kernel_dgead_4_1_lib4+0x2f8>
and    %r9b,%bl
jne    13f8 <kernel_dgead_4_1_lib4+0x2f8>
add    $0x1,%rdx
mov    %edx,%ebp
and    $0x1,%ebp
test   %rbp,%rbp
mov    $0x2,%ebx
cmovne %rbp,%rbx
sub    %rbx,%rdx
add    %edx,%r8d
mov    %rdx,%r9
shl    $0x5,%r9
lea    (%rax,%r9,1),%r10
lea    (%rsi,%r9,1),%r11
add    %rcx,%r9
movapd %xmm0,%xmm8
unpcklpd %xmm0,%xmm8
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  0x8(%rsi,%rbx,1),%xmm2
movsd  0x10(%rsi,%rbx,1),%xmm3
movsd  0x18(%rsi,%rbx,1),%xmm4
movhpd 0x28(%rsi,%rbx,1),%xmm2
movupd (%rcx,%rbx,1),%xmm5
movupd 0x10(%rcx,%rbx,1),%xmm9
movupd 0x20(%rcx,%rbx,1),%xmm7
movupd 0x30(%rcx,%rbx,1),%xmm1
movapd %xmm5,%xmm6
unpcklpd %xmm7,%xmm6
unpckhpd %xmm7,%xmm5
movapd %xmm9,%xmm7
unpcklpd %xmm1,%xmm7
unpckhpd %xmm1,%xmm9
mulpd  %xmm8,%xmm2
addpd  %xmm6,%xmm2
movhpd 0x30(%rsi,%rbx,1),%xmm3
mulpd  %xmm8,%xmm3
addpd  %xmm5,%xmm3
movhpd 0x38(%rsi,%rbx,1),%xmm4
mulpd  %xmm8,%xmm4
addpd  %xmm7,%xmm4
movupd (%rax,%rbx,1),%xmm1
movhpd 0x20(%rax,%rbx,1),%xmm1
mulpd  %xmm8,%xmm1
addpd  %xmm9,%xmm1
movapd %xmm4,%xmm5
unpcklpd %xmm1,%xmm5
movapd %xmm2,%xmm6
unpcklpd %xmm3,%xmm6
movhlps %xmm4,%xmm1
movhlps %xmm2,%xmm3
movups %xmm3,0x20(%rcx,%rbx,1)
movups %xmm1,0x30(%rcx,%rbx,1)
movupd %xmm6,(%rcx,%rbx,1)
movupd %xmm5,0x10(%rcx,%rbx,1)
add    $0x40,%rbx
add    $0xfffffffffffffffe,%rdx
jne    1330 <kernel_dgead_4_1_lib4+0x230>
mov    %r10,%rax
mov    %r11,%rsi
mov    %r9,%rcx
sub    %r8d,%edi
xor    %edx,%edx
nopl   (%rax)
movsd  0x8(%rsi,%rdx,1),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rcx,%rdx,1),%xmm1
movsd  %xmm1,(%rcx,%rdx,1)
movsd  0x10(%rsi,%rdx,1),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rcx,%rdx,1),%xmm1
movsd  %xmm1,0x8(%rcx,%rdx,1)
movsd  0x18(%rsi,%rdx,1),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rcx,%rdx,1),%xmm1
movsd  %xmm1,0x10(%rcx,%rdx,1)
movsd  (%rax,%rdx,1),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x18(%rcx,%rdx,1),%xmm1
movsd  %xmm1,0x18(%rcx,%rdx,1)
add    $0x20,%rdx
add    $0xffffffff,%edi
jne    1400 <kernel_dgead_4_1_lib4+0x300>
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @kernel_dgead_4_1_lib4(i32 %0, double %1, double* %2, i32 %3, double* %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca double*
%9 = alloca i32
%10 = alloca double*
%11 = alloca i32
%12 = alloca double*
%13 = alloca i32
store i32 %0, i32* %6
store double %1, double* %7
store double* %2, double** %8
store i32 %3, i32* %9
store double* %4, double** %10
%14 = load i32, i32* %6
%15 = icmp sle i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %5
br label %213
17: ; preds = %5
store i32 4, i32* %11
%18 = load double*, double** %8
%19 = load i32, i32* %9
%20 = mul nsw i32 4, %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %18, i64 %21
store double* %22, double** %12
store i32 0, i32* %13
br label %23
23: ; preds = %163, %17
%24 = load i32, i32* %13
%25 = load i32, i32* %6
%26 = sub nsw i32 %25, 3
%27 = icmp slt i32 %24, %26
br i1 %27, label %28, label %166
28: ; preds = %23
%29 = load double, double* %7
%30 = load double*, double** %8
%31 = getelementptr inbounds double, double* %30, i64 1
%32 = load double, double* %31
%33 = load double*, double** %10
%34 = getelementptr inbounds double, double* %33, i64 0
%35 = load double, double* %34
%36 = call double @llvm.fmuladd.f64(double %29, double %32, double %35)
store double %36, double* %34
%37 = load double, double* %7
%38 = load double*, double** %8
%39 = getelementptr inbounds double, double* %38, i64 2
%40 = load double, double* %39
%41 = load double*, double** %10
%42 = getelementptr inbounds double, double* %41, i64 1
%43 = load double, double* %42
%44 = call double @llvm.fmuladd.f64(double %37, double %40, double %43)
store double %44, double* %42
%45 = load double, double* %7
%46 = load double*, double** %8
%47 = getelementptr inbounds double, double* %46, i64 3
%48 = load double, double* %47
%49 = load double*, double** %10
%50 = getelementptr inbounds double, double* %49, i64 2
%51 = load double, double* %50
%52 = call double @llvm.fmuladd.f64(double %45, double %48, double %51)
store double %52, double* %50
%53 = load double, double* %7
%54 = load double*, double** %12
%55 = getelementptr inbounds double, double* %54, i64 0
%56 = load double, double* %55
%57 = load double*, double** %10
%58 = getelementptr inbounds double, double* %57, i64 3
%59 = load double, double* %58
%60 = call double @llvm.fmuladd.f64(double %53, double %56, double %59)
store double %60, double* %58
%61 = load double, double* %7
%62 = load double*, double** %8
%63 = getelementptr inbounds double, double* %62, i64 5
%64 = load double, double* %63
%65 = load double*, double** %10
%66 = getelementptr inbounds double, double* %65, i64 4
%67 = load double, double* %66
%68 = call double @llvm.fmuladd.f64(double %61, double %64, double %67)
store double %68, double* %66
%69 = load double, double* %7
%70 = load double*, double** %8
%71 = getelementptr inbounds double, double* %70, i64 6
%72 = load double, double* %71
%73 = load double*, double** %10
%74 = getelementptr inbounds double, double* %73, i64 5
%75 = load double, double* %74
%76 = call double @llvm.fmuladd.f64(double %69, double %72, double %75)
store double %76, double* %74
%77 = load double, double* %7
%78 = load double*, double** %8
%79 = getelementptr inbounds double, double* %78, i64 7
%80 = load double, double* %79
%81 = load double*, double** %10
%82 = getelementptr inbounds double, double* %81, i64 6
%83 = load double, double* %82
%84 = call double @llvm.fmuladd.f64(double %77, double %80, double %83)
store double %84, double* %82
%85 = load double, double* %7
%86 = load double*, double** %12
%87 = getelementptr inbounds double, double* %86, i64 4
%88 = load double, double* %87
%89 = load double*, double** %10
%90 = getelementptr inbounds double, double* %89, i64 7
%91 = load double, double* %90
%92 = call double @llvm.fmuladd.f64(double %85, double %88, double %91)
store double %92, double* %90
%93 = load double, double* %7
%94 = load double*, double** %8
%95 = getelementptr inbounds double, double* %94, i64 9
%96 = load double, double* %95
%97 = load double*, double** %10
%98 = getelementptr inbounds double, double* %97, i64 8
%99 = load double, double* %98
%100 = call double @llvm.fmuladd.f64(double %93, double %96, double %99)
store double %100, double* %98
%101 = load double, double* %7
%102 = load double*, double** %8
%103 = getelementptr inbounds double, double* %102, i64 10
%104 = load double, double* %103
%105 = load double*, double** %10
%106 = getelementptr inbounds double, double* %105, i64 9
%107 = load double, double* %106
%108 = call double @llvm.fmuladd.f64(double %101, double %104, double %107)
store double %108, double* %106
%109 = load double, double* %7
%110 = load double*, double** %8
%111 = getelementptr inbounds double, double* %110, i64 11
%112 = load double, double* %111
%113 = load double*, double** %10
%114 = getelementptr inbounds double, double* %113, i64 10
%115 = load double, double* %114
%116 = call double @llvm.fmuladd.f64(double %109, double %112, double %115)
store double %116, double* %114
%117 = load double, double* %7
%118 = load double*, double** %12
%119 = getelementptr inbounds double, double* %118, i64 8
%120 = load double, double* %119
%121 = load double*, double** %10
%122 = getelementptr inbounds double, double* %121, i64 11
%123 = load double, double* %122
%124 = call double @llvm.fmuladd.f64(double %117, double %120, double %123)
store double %124, double* %122
%125 = load double, double* %7
%126 = load double*, double** %8
%127 = getelementptr inbounds double, double* %126, i64 13
%128 = load double, double* %127
%129 = load double*, double** %10
%130 = getelementptr inbounds double, double* %129, i64 12
%131 = load double, double* %130
%132 = call double @llvm.fmuladd.f64(double %125, double %128, double %131)
store double %132, double* %130
%133 = load double, double* %7
%134 = load double*, double** %8
%135 = getelementptr inbounds double, double* %134, i64 14
%136 = load double, double* %135
%137 = load double*, double** %10
%138 = getelementptr inbounds double, double* %137, i64 13
%139 = load double, double* %138
%140 = call double @llvm.fmuladd.f64(double %133, double %136, double %139)
store double %140, double* %138
%141 = load double, double* %7
%142 = load double*, double** %8
%143 = getelementptr inbounds double, double* %142, i64 15
%144 = load double, double* %143
%145 = load double*, double** %10
%146 = getelementptr inbounds double, double* %145, i64 14
%147 = load double, double* %146
%148 = call double @llvm.fmuladd.f64(double %141, double %144, double %147)
store double %148, double* %146
%149 = load double, double* %7
%150 = load double*, double** %12
%151 = getelementptr inbounds double, double* %150, i64 12
%152 = load double, double* %151
%153 = load double*, double** %10
%154 = getelementptr inbounds double, double* %153, i64 15
%155 = load double, double* %154
%156 = call double @llvm.fmuladd.f64(double %149, double %152, double %155)
store double %156, double* %154
%157 = load double*, double** %8
%158 = getelementptr inbounds double, double* %157, i64 16
store double* %158, double** %8
%159 = load double*, double** %12
%160 = getelementptr inbounds double, double* %159, i64 16
store double* %160, double** %12
%161 = load double*, double** %10
%162 = getelementptr inbounds double, double* %161, i64 16
store double* %162, double** %10
br label %163
163: ; preds = %28
%164 = load i32, i32* %13
%165 = add nsw i32 %164, 4
store i32 %165, i32* %13
br label %23
166: ; preds = %23
br label %167
167: ; preds = %210, %166
%168 = load i32, i32* %13
%169 = load i32, i32* %6
%170 = icmp slt i32 %168, %169
br i1 %170, label %171, label %213
171: ; preds = %167
%172 = load double, double* %7
%173 = load double*, double** %8
%174 = getelementptr inbounds double, double* %173, i64 1
%175 = load double, double* %174
%176 = load double*, double** %10
%177 = getelementptr inbounds double, double* %176, i64 0
%178 = load double, double* %177
%179 = call double @llvm.fmuladd.f64(double %172, double %175, double %178)
store double %179, double* %177
%180 = load double, double* %7
%181 = load double*, double** %8
%182 = getelementptr inbounds double, double* %181, i64 2
%183 = load double, double* %182
%184 = load double*, double** %10
%185 = getelementptr inbounds double, double* %184, i64 1
%186 = load double, double* %185
%187 = call double @llvm.fmuladd.f64(double %180, double %183, double %186)
store double %187, double* %185
%188 = load double, double* %7
%189 = load double*, double** %8
%190 = getelementptr inbounds double, double* %189, i64 3
%191 = load double, double* %190
%192 = load double*, double** %10
%193 = getelementptr inbounds double, double* %192, i64 2
%194 = load double, double* %193
%195 = call double @llvm.fmuladd.f64(double %188, double %191, double %194)
store double %195, double* %193
%196 = load double, double* %7
%197 = load double*, double** %12
%198 = getelementptr inbounds double, double* %197, i64 0
%199 = load double, double* %198
%200 = load double*, double** %10
%201 = getelementptr inbounds double, double* %200, i64 3
%202 = load double, double* %201
%203 = call double @llvm.fmuladd.f64(double %196, double %199, double %202)
store double %203, double* %201
%204 = load double*, double** %8
%205 = getelementptr inbounds double, double* %204, i64 4
store double* %205, double** %8
%206 = load double*, double** %12
%207 = getelementptr inbounds double, double* %206, i64 4
store double* %207, double** %12
%208 = load double*, double** %10
%209 = getelementptr inbounds double, double* %208, i64 4
store double* %209, double** %10
br label %210
210: ; preds = %171
%211 = load i32, i32* %13
%212 = add nsw i32 %211, 1
store i32 %212, i32* %13
br label %167
213: ; preds = %16, %167
ret void
}

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