user: Please show me the C implementation that matches the assembly code listed below:

```asm
<kernel_add_align_panel_2_0_lib4>:
  endbr64
  mov    %edi,%r8d
  mov    %rsi,%rdi
  mov    %rdx,%rsi
  test   %r8d,%r8d
  jle    L89
  cmp    $0x3,%r8d
  jle    L0
  lea    0x6f(%rdi),%rax
  lea    -0x4(%r8),%r9d
  sub    %rdx,%rax
  cmp    $0xde,%rax
  jbe    L119
  cmp    $0x3,%r9d
  jbe    L119
  mov    %r9d,%eax
  movapd %xmm0,%xmm2
  mov    %rdi,%rcx
  xor    %r10d,%r10d
  shr    $0x2,%eax
  unpcklpd %xmm2,%xmm2
  nopl   (%rax)
L51:
  movupd (%rcx),%xmm1
  movupd (%rdx),%xmm3
  add    $0x1,%r10d
  sub    $0xffffffffffffff80,%rdx
  movupd -0x60(%rdx),%xmm4
  movupd -0x40(%rdx),%xmm5
  sub    $0xffffffffffffff80,%rcx
  mulpd  %xmm2,%xmm1
  movupd -0x20(%rdx),%xmm6
  addpd  %xmm3,%xmm1
  movups %xmm1,-0x80(%rdx)
  movupd -0x60(%rcx),%xmm1
  mulpd  %xmm2,%xmm1
  addpd  %xmm4,%xmm1
  movups %xmm1,-0x60(%rdx)
  movupd -0x40(%rcx),%xmm1
  mulpd  %xmm2,%xmm1
  addpd  %xmm5,%xmm1
  movups %xmm1,-0x40(%rdx)
  movupd -0x20(%rcx),%xmm1
  mulpd  %xmm2,%xmm1
  addpd  %xmm6,%xmm1
  movups %xmm1,-0x20(%rdx)
  cmp    %eax,%r10d
  jb     L51
  shl    $0x7,%rax
  lea    (%rdi,%rax,1),%rdx
  add    %rsi,%rax
  movsd  (%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  (%rax),%xmm1
  movsd  %xmm1,(%rax)
  movsd  0x8(%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  0x8(%rax),%xmm1
  movsd  %xmm1,0x8(%rax)
  movsd  0x20(%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  0x20(%rax),%xmm1
  movsd  %xmm1,0x20(%rax)
  movsd  0x28(%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  0x28(%rax),%xmm1
  movsd  %xmm1,0x28(%rax)
  movsd  0x40(%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  0x40(%rax),%xmm1
  movsd  %xmm1,0x40(%rax)
  movsd  0x48(%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  0x48(%rax),%xmm1
  movsd  %xmm1,0x48(%rax)
  movsd  0x60(%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  0x60(%rax),%xmm1
  movsd  %xmm1,0x60(%rax)
  movsd  0x68(%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  0x68(%rax),%xmm1
  movsd  %xmm1,0x68(%rax)
L80:
  shr    $0x2,%r9d
  lea    0x1(%r9),%eax
  mov    %rax,%r9
  shl    $0x7,%rax
  shl    $0x2,%r9d
  add    %rax,%rdi
  add    %rax,%rsi
  cmp    %r9d,%r8d
  jle    L74
L107:
  lea    0xf(%rsi),%rdx
  mov    %r8d,%eax
  sub    %rdi,%rdx
  sub    %r9d,%eax
  cmp    $0x1e,%rdx
  jbe    L138
  cmp    $0x1,%eax
  setne  %cl
  cmp    %r8d,%r9d
  setl   %dl
  test   %dl,%cl
  je     L138
  movupd (%rdi),%xmm1
  movapd %xmm0,%xmm2
  movupd (%rsi),%xmm7
  cmp    %r8d,%r9d
  unpcklpd %xmm2,%xmm2
  mov    $0x1,%edx
  mulpd  %xmm2,%xmm1
  cmovge %edx,%eax
  sub    $0x1,%eax
  addpd  %xmm7,%xmm1
  movups %xmm1,(%rsi)
  cmp    $0x1,%eax
  jbe    L33
  movupd 0x20(%rdi),%xmm1
  movupd 0x20(%rsi),%xmm7
  mulpd  %xmm2,%xmm1
  addpd  %xmm7,%xmm1
  movups %xmm1,0x20(%rsi)
  cmp    $0x2,%eax
  je     L33
  movupd 0x40(%rdi),%xmm1
  movupd 0x40(%rsi),%xmm7
  mulpd  %xmm2,%xmm1
  addpd  %xmm7,%xmm1
  movups %xmm1,0x40(%rsi)
L33:
  shl    $0x5,%rax
  add    %rax,%rdi
  add    %rsi,%rax
  movsd  (%rdi),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  (%rax),%xmm1
  movsd  %xmm1,(%rax)
  mulsd  0x8(%rdi),%xmm0
  addsd  0x8(%rax),%xmm0
  movsd  %xmm0,0x8(%rax)
  ret
  nopl   (%rax)
L138:
  movsd  (%rdi),%xmm1
  lea    0x1(%r9),%eax
  mulsd  %xmm0,%xmm1
  addsd  (%rsi),%xmm1
  movsd  %xmm1,(%rsi)
  movsd  0x8(%rdi),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  0x8(%rsi),%xmm1
  movsd  %xmm1,0x8(%rsi)
  cmp    %eax,%r8d
  jle    L89
  movsd  0x20(%rdi),%xmm1
  lea    0x2(%r9),%eax
  mulsd  %xmm0,%xmm1
  addsd  0x20(%rsi),%xmm1
  movsd  %xmm1,0x20(%rsi)
  movsd  0x28(%rdi),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  0x28(%rsi),%xmm1
  movsd  %xmm1,0x28(%rsi)
  cmp    %r8d,%eax
  jge    L89
  movsd  0x40(%rdi),%xmm1
  add    $0x3,%r9d
  mulsd  %xmm0,%xmm1
  addsd  0x40(%rsi),%xmm1
  movsd  %xmm1,0x40(%rsi)
  movsd  0x48(%rdi),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  0x48(%rsi),%xmm1
  movsd  %xmm1,0x48(%rsi)
  cmp    %r8d,%r9d
  jge    L89
  movsd  0x60(%rdi),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  0x60(%rsi),%xmm1
  movsd  %xmm1,0x60(%rsi)
  mulsd  0x68(%rdi),%xmm0
  addsd  0x68(%rsi),%xmm0
  movsd  %xmm0,0x68(%rsi)
L89:
  ret
  nopl   0x0(%rax)
L74:
  ret
  nopl   0x0(%rax)
L119:
  mov    %r9d,%ecx
  mov    %rsi,%rax
  mov    %rdi,%rdx
  shr    $0x2,%ecx
  add    $0x1,%ecx
  shl    $0x7,%rcx
  add    %rdi,%rcx
  xchg   %ax,%ax
L84:
  movsd  (%rdx),%xmm1
  sub    $0xffffffffffffff80,%rdx
  sub    $0xffffffffffffff80,%rax
  mulsd  %xmm0,%xmm1
  addsd  -0x80(%rax),%xmm1
  movsd  %xmm1,-0x80(%rax)
  movsd  -0x78(%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  -0x78(%rax),%xmm1
  movsd  %xmm1,-0x78(%rax)
  movsd  -0x60(%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  -0x60(%rax),%xmm1
  movsd  %xmm1,-0x60(%rax)
  movsd  -0x58(%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  -0x58(%rax),%xmm1
  movsd  %xmm1,-0x58(%rax)
  movsd  -0x40(%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  -0x40(%rax),%xmm1
  movsd  %xmm1,-0x40(%rax)
  movsd  -0x38(%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  -0x38(%rax),%xmm1
  movsd  %xmm1,-0x38(%rax)
  movsd  -0x20(%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  -0x20(%rax),%xmm1
  movsd  %xmm1,-0x20(%rax)
  movsd  -0x18(%rdx),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  -0x18(%rax),%xmm1
  movsd  %xmm1,-0x18(%rax)
  cmp    %rdx,%rcx
  jne    L84
  jmp    L80
  nopl   (%rax)
L0:
  xor    %r9d,%r9d
  jmp    L107
```

assistant: ```c
void kernel_add_align_panel_2_0_lib4(int kmax, double alpha, double *A, double *B) {
  if (kmax <= 0)
    return;
  const int bs = 4;
  int k;
  for (k = 0; k < kmax - 3; k += 4) {
    B[0 + bs * 0] += alpha * A[0 + bs * 0];
    B[1 + bs * 0] += alpha * A[1 + bs * 0];
    B[0 + bs * 1] += alpha * A[0 + bs * 1];
    B[1 + bs * 1] += alpha * A[1 + bs * 1];
    B[0 + bs * 2] += alpha * A[0 + bs * 2];
    B[1 + bs * 2] += alpha * A[1 + bs * 2];
    B[0 + bs * 3] += alpha * A[0 + bs * 3];
    B[1 + bs * 3] += alpha * A[1 + bs * 3];
    A += 16;
    B += 16;
  }
  for (; k < kmax; k++) {
    B[0 + bs * 0] += alpha * A[0 + bs * 0];
    B[1 + bs * 0] += alpha * A[1 + bs * 0];
    A += 4;
    B += 4;
  }
}
```