void kernel_add_align_panel_4_3_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[3 + bs * 0];
    B[1 + bs * 0] += alpha * A1[0 + bs * 0];
    B[2 + bs * 0] += alpha * A1[1 + bs * 0];
    B[3 + bs * 0] += alpha * A1[2 + bs * 0];
    B[0 + bs * 1] += alpha * A0[3 + bs * 1];
    B[1 + bs * 1] += alpha * A1[0 + bs * 1];
    B[2 + bs * 1] += alpha * A1[1 + bs * 1];
    B[3 + bs * 1] += alpha * A1[2 + bs * 1];
    B[0 + bs * 2] += alpha * A0[3 + bs * 2];
    B[1 + bs * 2] += alpha * A1[0 + bs * 2];
    B[2 + bs * 2] += alpha * A1[1 + bs * 2];
    B[3 + bs * 2] += alpha * A1[2 + bs * 2];
    B[0 + bs * 3] += alpha * A0[3 + bs * 3];
    B[1 + bs * 3] += alpha * A1[0 + bs * 3];
    B[2 + bs * 3] += alpha * A1[1 + bs * 3];
    B[3 + bs * 3] += alpha * A1[2 + bs * 3];
    A0 += 16;
    A1 += 16;
    B += 16;
  }
  for (; k < kmax; k++) {
    B[0 + bs * 0] += alpha * A0[3 + bs * 0];
    B[1 + bs * 0] += alpha * A1[0 + bs * 0];
    B[2 + bs * 0] += alpha * A1[1 + bs * 0];
    B[3 + bs * 0] += alpha * A1[2 + bs * 0];
    A0 += 4;
    A1 += 4;
    B += 4;
  }
}


x86 assembly (clang, -O0):
<kernel_add_align_panel_4_3_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_add_align_panel_4_3_lib4+0x26>
jmp    14a2 <kernel_add_align_panel_4_3_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_add_align_panel_4_3_lib4+0x2d2>
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  (%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    -0x38(%rbp),%rax
movsd  0x8(%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  0x10(%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  0x38(%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    -0x38(%rbp),%rax
movsd  0x20(%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    -0x38(%rbp),%rax
movsd  0x28(%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  0x30(%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  0x58(%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    -0x38(%rbp),%rax
movsd  0x40(%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    -0x38(%rbp),%rax
movsd  0x48(%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  0x50(%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  0x78(%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    -0x38(%rbp),%rax
movsd  0x60(%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    -0x38(%rbp),%rax
movsd  0x68(%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  0x70(%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_add_align_panel_4_3_lib4+0x4c>
jmp    13d7 <kernel_add_align_panel_4_3_lib4+0x2d7>
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    14a2 <kernel_add_align_panel_4_3_lib4+0x3a2>
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  (%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    -0x38(%rbp),%rax
movsd  0x8(%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  0x10(%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_add_align_panel_4_3_lib4+0x2d7>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_add_align_panel_4_3_lib4>:
push   %rbp
push   %rbx
test   %edi,%edi
jle    145e <kernel_add_align_panel_4_3_lib4+0x35e>
shl    $0x2,%edx
movslq %edx,%rax
cmp    $0x4,%edi
jb     1282 <kernel_add_align_panel_4_3_lib4+0x182>
lea    -0x3(%rdi),%r8d
xor    %edx,%edx
nop
movsd  0x18(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rcx),%xmm1
movsd  %xmm1,(%rcx)
movsd  (%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rcx),%xmm1
movsd  %xmm1,0x8(%rcx)
movsd  0x8(%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rcx),%xmm1
movsd  %xmm1,0x10(%rcx)
movsd  0x10(%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x18(%rcx),%xmm1
movsd  %xmm1,0x18(%rcx)
movsd  0x38(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x20(%rcx),%xmm1
movsd  %xmm1,0x20(%rcx)
movsd  0x20(%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x28(%rcx),%xmm1
movsd  %xmm1,0x28(%rcx)
movsd  0x28(%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x30(%rcx),%xmm1
movsd  %xmm1,0x30(%rcx)
movsd  0x30(%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x38(%rcx),%xmm1
movsd  %xmm1,0x38(%rcx)
movsd  0x58(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x40(%rcx),%xmm1
movsd  %xmm1,0x40(%rcx)
movsd  0x40(%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x48(%rcx),%xmm1
movsd  %xmm1,0x48(%rcx)
movsd  0x48(%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x50(%rcx),%xmm1
movsd  %xmm1,0x50(%rcx)
movsd  0x50(%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x58(%rcx),%xmm1
movsd  %xmm1,0x58(%rcx)
movsd  0x78(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x60(%rcx),%xmm1
movsd  %xmm1,0x60(%rcx)
movsd  0x60(%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x68(%rcx),%xmm1
movsd  %xmm1,0x68(%rcx)
movsd  0x68(%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x70(%rcx),%xmm1
movsd  %xmm1,0x70(%rcx)
movsd  0x70(%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_add_align_panel_4_3_lib4+0x20>
mov    %edi,%r8d
and    $0xfffffffc,%r8d
lea    (%rsi,%rax,8),%rax
cmp    %edi,%r8d
jl     1292 <kernel_add_align_panel_4_3_lib4+0x192>
jmp    145e <kernel_add_align_panel_4_3_lib4+0x35e>
lea    (%rsi,%rax,8),%rax
xor    %r8d,%r8d
cmp    %edi,%r8d
jge    145e <kernel_add_align_panel_4_3_lib4+0x35e>
mov    %r8d,%edx
not    %edx
add    %edi,%edx
cmp    $0x1,%edx
jbe    13f7 <kernel_add_align_panel_4_3_lib4+0x2f7>
mov    %rdx,%rbx
shl    $0x5,%rbx
lea    (%rcx,%rbx,1),%r9
add    $0x20,%r9
lea    (%rax,%rbx,1),%r10
add    $0x18,%r10
lea    0x18(%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    13f7 <kernel_add_align_panel_4_3_lib4+0x2f7>
and    %r9b,%bl
jne    13f7 <kernel_add_align_panel_4_3_lib4+0x2f7>
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
nopw   0x0(%rax,%rax,1)
movsd  0x18(%rsi,%rbx,1),%xmm2
movhpd 0x38(%rsi,%rbx,1),%xmm2
movupd (%rcx,%rbx,1),%xmm4
movupd 0x10(%rcx,%rbx,1),%xmm3
movupd 0x20(%rcx,%rbx,1),%xmm5
movupd 0x30(%rcx,%rbx,1),%xmm6
movapd %xmm4,%xmm7
unpcklpd %xmm5,%xmm7
unpckhpd %xmm5,%xmm4
movapd %xmm3,%xmm9
unpcklpd %xmm6,%xmm9
unpckhpd %xmm6,%xmm3
mulpd  %xmm8,%xmm2
addpd  %xmm7,%xmm2
movupd (%rax,%rbx,1),%xmm5
movupd 0x10(%rax,%rbx,1),%xmm7
movupd 0x20(%rax,%rbx,1),%xmm1
movapd %xmm5,%xmm6
unpcklpd %xmm1,%xmm6
unpckhpd %xmm1,%xmm5
movhpd 0x30(%rax,%rbx,1),%xmm7
mulpd  %xmm8,%xmm6
addpd  %xmm4,%xmm6
mulpd  %xmm8,%xmm5
addpd  %xmm9,%xmm5
mulpd  %xmm8,%xmm7
addpd  %xmm3,%xmm7
movapd %xmm5,%xmm1
unpcklpd %xmm7,%xmm1
movapd %xmm2,%xmm3
unpcklpd %xmm6,%xmm3
movhlps %xmm5,%xmm7
movhlps %xmm2,%xmm6
movups %xmm6,0x20(%rcx,%rbx,1)
movups %xmm7,0x30(%rcx,%rbx,1)
movupd %xmm3,(%rcx,%rbx,1)
movupd %xmm1,0x10(%rcx,%rbx,1)
add    $0x40,%rbx
add    $0xfffffffffffffffe,%rdx
jne    1330 <kernel_add_align_panel_4_3_lib4+0x230>
mov    %r10,%rax
mov    %r11,%rsi
mov    %r9,%rcx
sub    %r8d,%edi
xor    %edx,%edx
nopl   0x0(%rax)
movsd  0x18(%rsi,%rdx,1),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rcx,%rdx,1),%xmm1
movsd  %xmm1,(%rcx,%rdx,1)
movsd  (%rax,%rdx,1),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rcx,%rdx,1),%xmm1
movsd  %xmm1,0x8(%rcx,%rdx,1)
movsd  0x8(%rax,%rdx,1),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rcx,%rdx,1),%xmm1
movsd  %xmm1,0x10(%rcx,%rdx,1)
movsd  0x10(%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_add_align_panel_4_3_lib4+0x300>
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @kernel_add_align_panel_4_3_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 3
%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** %12
%39 = getelementptr inbounds double, double* %38, i64 0
%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** %12
%47 = getelementptr inbounds double, double* %46, i64 1
%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 2
%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 7
%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** %12
%71 = getelementptr inbounds double, double* %70, i64 4
%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** %12
%79 = getelementptr inbounds double, double* %78, i64 5
%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 6
%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 11
%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** %12
%103 = getelementptr inbounds double, double* %102, i64 8
%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** %12
%111 = getelementptr inbounds double, double* %110, i64 9
%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 10
%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 15
%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** %12
%135 = getelementptr inbounds double, double* %134, i64 12
%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** %12
%143 = getelementptr inbounds double, double* %142, i64 13
%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 14
%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 3
%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** %12
%182 = getelementptr inbounds double, double* %181, i64 0
%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** %12
%190 = getelementptr inbounds double, double* %189, i64 1
%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 2
%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_add_align_panel_4_3_lib4(i32 %0, double %1, double* nocapture %2, i32 %3, double* nocapture %4) {
%6 = icmp slt i32 %0, 1
br i1 %6, label %221, 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 %105, label %15
13: ; preds = %105
%14 = and i32 %0, -4
br label %15
15: ; preds = %13, %7
%16 = phi double* [ %4, %7 ], [ %190, %13 ]
%17 = phi double* [ %2, %7 ], [ %188, %13 ]
%18 = phi double* [ %10, %7 ], [ %189, %13 ]
%19 = phi i32 [ 0, %7 ], [ %14, %13 ]
%20 = icmp slt i32 %19, %0
br i1 %20, label %21, label %221
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 = %67, %32, %21
%28 = phi i32 [ %19, %32 ], [ %19, %21 ], [ %56, %67 ]
%29 = phi double* [ %18, %32 ], [ %18, %21 ], [ %58, %67 ]
%30 = phi double* [ %17, %32 ], [ %17, %21 ], [ %60, %67 ]
%31 = phi double* [ %16, %32 ], [ %16, %21 ], [ %62, %67 ]
br label %193
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, 3
%40 = getelementptr double, double* %18, i64 %39
%41 = getelementptr double, double* %17, i64 3
%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
%65 = getelementptr double, double* %17, i64 3
%66 = getelementptr double, double* %17, i64 3
br label %67
67: ; preds = %67, %50
%68 = phi i64 [ 0, %50 ], [ %103, %67 ]
%69 = shl i64 %68, 2
%70 = getelementptr double, double* %18, i64 %69
%71 = shl i64 %68, 2
%72 = shl i64 %68, 2
%73 = or i64 %72, 4
%74 = shl i64 %68, 2
%75 = getelementptr double, double* %16, i64 %74
%76 = getelementptr inbounds double, double* %65, i64 %71
%77 = getelementptr inbounds double, double* %66, i64 %73
%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 = bitcast double* %70 to <8 x double>*
%90 = load <8 x double>, <8 x double>* %89
%91 = shufflevector <8 x double> %90, <8 x double> poison, <2 x i32> <i32 0, i32 4>
%92 = shufflevector <8 x double> %90, <8 x double> poison, <2 x i32> <i32 1, i32 5>
%93 = shufflevector <8 x double> %90, <8 x double> poison, <2 x i32> <i32 2, i32 6>
%94 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %64, <2 x double> %91, <2 x double> %85)
%95 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %64, <2 x double> %92, <2 x double> %86)
%96 = getelementptr inbounds double, double* %75, i64 3
%97 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %64, <2 x double> %93, <2 x double> %87)
%98 = getelementptr inbounds double, double* %96, i64 -3
%99 = bitcast double* %98 to <8 x double>*
%100 = shufflevector <2 x double> %88, <2 x double> %94, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%101 = shufflevector <2 x double> %95, <2 x double> %97, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%102 = shufflevector <4 x double> %100, <4 x double> %101, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 1, i32 3, i32 5, i32 7>
store <8 x double> %102, <8 x double>* %99
%103 = add nuw i64 %68, 2
%104 = icmp eq i64 %103, %54
br i1 %104, label %27, label %67
105: ; preds = %7, %105
%106 = phi i32 [ %191, %105 ], [ 0, %7 ]
%107 = phi double* [ %189, %105 ], [ %10, %7 ]
%108 = phi double* [ %188, %105 ], [ %2, %7 ]
%109 = phi double* [ %190, %105 ], [ %4, %7 ]
%110 = getelementptr inbounds double, double* %108, i64 3
%111 = load double, double* %110
%112 = load double, double* %109
%113 = tail call double @llvm.fmuladd.f64(double %1, double %111, double %112)
store double %113, double* %109
%114 = load double, double* %107
%115 = getelementptr inbounds double, double* %109, i64 1
%116 = load double, double* %115
%117 = tail call double @llvm.fmuladd.f64(double %1, double %114, double %116)
store double %117, double* %115
%118 = getelementptr inbounds double, double* %107, i64 1
%119 = load double, double* %118
%120 = getelementptr inbounds double, double* %109, i64 2
%121 = load double, double* %120
%122 = tail call double @llvm.fmuladd.f64(double %1, double %119, double %121)
store double %122, double* %120
%123 = getelementptr inbounds double, double* %107, i64 2
%124 = load double, double* %123
%125 = getelementptr inbounds double, double* %109, i64 3
%126 = load double, double* %125
%127 = tail call double @llvm.fmuladd.f64(double %1, double %124, double %126)
store double %127, double* %125
%128 = getelementptr inbounds double, double* %108, i64 7
%129 = load double, double* %128
%130 = getelementptr inbounds double, double* %109, i64 4
%131 = load double, double* %130
%132 = tail call double @llvm.fmuladd.f64(double %1, double %129, double %131)
store double %132, double* %130
%133 = getelementptr inbounds double, double* %107, i64 4
%134 = load double, double* %133
%135 = getelementptr inbounds double, double* %109, i64 5
%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* %107, i64 5
%139 = load double, double* %138
%140 = getelementptr inbounds double, double* %109, i64 6
%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* %107, i64 6
%144 = load double, double* %143
%145 = getelementptr inbounds double, double* %109, i64 7
%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* %108, i64 11
%149 = load double, double* %148
%150 = getelementptr inbounds double, double* %109, i64 8
%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* %107, i64 8
%154 = load double, double* %153
%155 = getelementptr inbounds double, double* %109, i64 9
%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* %107, i64 9
%159 = load double, double* %158
%160 = getelementptr inbounds double, double* %109, i64 10
%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* %107, i64 10
%164 = load double, double* %163
%165 = getelementptr inbounds double, double* %109, i64 11
%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* %108, i64 15
%169 = load double, double* %168
%170 = getelementptr inbounds double, double* %109, i64 12
%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* %107, i64 12
%174 = load double, double* %173
%175 = getelementptr inbounds double, double* %109, i64 13
%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* %107, i64 13
%179 = load double, double* %178
%180 = getelementptr inbounds double, double* %109, i64 14
%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* %107, i64 14
%184 = load double, double* %183
%185 = getelementptr inbounds double, double* %109, i64 15
%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* %108, i64 16
%189 = getelementptr inbounds double, double* %107, i64 16
%190 = getelementptr inbounds double, double* %109, i64 16
%191 = add nuw nsw i32 %106, 4
%192 = icmp slt i32 %191, %11
br i1 %192, label %105, label %13
193: ; preds = %27, %193
%194 = phi i32 [ %219, %193 ], [ %28, %27 ]
%195 = phi double* [ %217, %193 ], [ %29, %27 ]
%196 = phi double* [ %216, %193 ], [ %30, %27 ]
%197 = phi double* [ %218, %193 ], [ %31, %27 ]
%198 = getelementptr inbounds double, double* %196, i64 3
%199 = load double, double* %198
%200 = load double, double* %197
%201 = tail call double @llvm.fmuladd.f64(double %1, double %199, double %200)
store double %201, double* %197
%202 = load double, double* %195
%203 = getelementptr inbounds double, double* %197, i64 1
%204 = load double, double* %203
%205 = tail call double @llvm.fmuladd.f64(double %1, double %202, double %204)
store double %205, double* %203
%206 = getelementptr inbounds double, double* %195, i64 1
%207 = load double, double* %206
%208 = getelementptr inbounds double, double* %197, i64 2
%209 = load double, double* %208
%210 = tail call double @llvm.fmuladd.f64(double %1, double %207, double %209)
store double %210, double* %208
%211 = getelementptr inbounds double, double* %195, i64 2
%212 = load double, double* %211
%213 = getelementptr inbounds double, double* %197, i64 3
%214 = load double, double* %213
%215 = tail call double @llvm.fmuladd.f64(double %1, double %212, double %214)
store double %215, double* %213
%216 = getelementptr inbounds double, double* %196, i64 4
%217 = getelementptr inbounds double, double* %195, i64 4
%218 = getelementptr inbounds double, double* %197, i64 4
%219 = add nuw nsw i32 %194, 1
%220 = icmp eq i32 %219, %0
br i1 %220, label %221, label %193
221: ; preds = %193, %15, %5
ret void
}