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

```asm
<kernel_dsyrk_nn_4x4_lib4>:
  endbr64
  push   %rbp
  mov    %rsi,%rax
  mov    %edi,%r10d
  mov    %rdx,%rsi
  push   %rbx
  mov    0x18(%rsp),%ebx
  cmp    $0x3,%edi
  jle    L14
  lea    -0x4(%r10),%r11d
  shl    $0x2,%ecx
  pxor   %xmm4,%xmm4
  shr    $0x2,%r11d
  movapd %xmm4,%xmm14
  movapd %xmm4,%xmm6
  movslq %ecx,%rdi
  lea    0x1(%r11),%ebp
  shl    $0x3,%rdi
  movapd %xmm4,%xmm10
  movsd  %xmm4,-0x18(%rsp)
  mov    %rbp,%rcx
  mov    %rbp,%r11
  movsd  %xmm4,-0x20(%rsp)
  movapd %xmm4,%xmm3
  shl    $0x7,%rcx
  movapd %xmm4,%xmm5
  movapd %xmm4,%xmm13
  add    %rax,%rcx
  movapd %xmm4,%xmm15
  nop
L66:
  movsd  0x8(%rax),%xmm2
  movsd  0x10(%rax),%xmm8
  sub    $0xffffffffffffff80,%rax
  movsd  (%rdx),%xmm0
  movsd  -0x68(%rax),%xmm7
  movsd  0x20(%rdx),%xmm1
  movsd  -0x80(%rax),%xmm11
  movapd %xmm2,%xmm9
  movapd %xmm8,%xmm12
  mulsd  %xmm0,%xmm9
  mulsd  %xmm0,%xmm11
  mulsd  %xmm0,%xmm12
  mulsd  %xmm1,%xmm2
  mulsd  %xmm7,%xmm0
  addsd  %xmm9,%xmm13
  movapd %xmm8,%xmm9
  addsd  %xmm15,%xmm11
  mulsd  %xmm1,%xmm9
  movsd  -0x60(%rax),%xmm15
  mulsd  %xmm7,%xmm1
  addsd  %xmm3,%xmm12
  movsd  -0x50(%rax),%xmm3
  addsd  %xmm5,%xmm2
  movsd  0x40(%rdx),%xmm5
  addsd  %xmm6,%xmm0
  movsd  0x8(%rdx),%xmm6
  mulsd  %xmm8,%xmm5
  movsd  0x40(%rdx),%xmm8
  mulsd  %xmm6,%xmm15
  addsd  %xmm10,%xmm9
  movsd  -0x58(%rax),%xmm10
  addsd  -0x20(%rsp),%xmm5
  mulsd  %xmm7,%xmm8
  addsd  %xmm14,%xmm1
  movsd  0x28(%rdx),%xmm14
  mulsd  0x60(%rdx),%xmm7
  addsd  -0x18(%rsp),%xmm8
  mulsd  %xmm6,%xmm3
  addsd  %xmm11,%xmm15
  movapd %xmm10,%xmm11
  mulsd  %xmm14,%xmm10
  addsd  %xmm4,%xmm7
  movsd  -0x48(%rax),%xmm4
  mulsd  %xmm6,%xmm11
  addsd  %xmm12,%xmm3
  movsd  -0x28(%rax),%xmm12
  mulsd  %xmm4,%xmm6
  addsd  %xmm10,%xmm2
  movsd  -0x50(%rax),%xmm10
  addsd  %xmm13,%xmm11
  movsd  -0x40(%rax),%xmm13
  mulsd  %xmm14,%xmm10
  addsd  %xmm0,%xmm6
  movsd  -0x50(%rax),%xmm0
  mulsd  0x48(%rdx),%xmm0
  mulsd  %xmm4,%xmm14
  addsd  %xmm9,%xmm10
  movsd  0x48(%rdx),%xmm9
  addsd  %xmm0,%xmm5
  movsd  0x10(%rdx),%xmm0
  mulsd  %xmm4,%xmm9
  addsd  %xmm14,%xmm1
  movsd  -0x30(%rax),%xmm14
  mulsd  0x68(%rdx),%xmm4
  mulsd  %xmm0,%xmm13
  addsd  %xmm8,%xmm9
  movsd  -0x38(%rax),%xmm8
  addsd  %xmm7,%xmm4
  movsd  0x30(%rdx),%xmm7
  addsd  %xmm15,%xmm13
  movapd %xmm8,%xmm15
  mulsd  %xmm7,%xmm8
  mulsd  %xmm0,%xmm15
  addsd  %xmm2,%xmm8
  movapd %xmm14,%xmm2
  mulsd  %xmm7,%xmm2
  addsd  %xmm15,%xmm11
  movapd %xmm14,%xmm15
  mulsd  %xmm12,%xmm7
  mulsd  %xmm0,%xmm15
  mulsd  %xmm12,%xmm0
  addsd  %xmm2,%xmm10
  movapd %xmm7,%xmm2
  movsd  0x50(%rdx),%xmm7
  addsd  %xmm1,%xmm2
  movsd  0x50(%rdx),%xmm1
  addsd  %xmm15,%xmm3
  mulsd  %xmm12,%xmm7
  addsd  %xmm6,%xmm0
  mulsd  %xmm14,%xmm1
  mulsd  0x70(%rdx),%xmm12
  addsd  %xmm9,%xmm7
  addsd  %xmm5,%xmm1
  movsd  -0x18(%rax),%xmm5
  movsd  -0x10(%rax),%xmm9
  movsd  0x18(%rdx),%xmm6
  movsd  -0x20(%rax),%xmm15
  addsd  %xmm4,%xmm12
  movsd  -0x8(%rax),%xmm4
  movsd  0x38(%rdx),%xmm14
  mulsd  %xmm6,%xmm15
  addsd  %xmm13,%xmm15
  movapd %xmm5,%xmm13
  mulsd  %xmm6,%xmm13
  mulsd  %xmm14,%xmm5
  addsd  %xmm11,%xmm13
  movapd %xmm9,%xmm11
  mulsd  %xmm6,%xmm11
  addsd  %xmm8,%xmm5
  mulsd  %xmm4,%xmm6
  addsd  %xmm11,%xmm3
  addsd  %xmm0,%xmm6
  movapd %xmm9,%xmm0
  mulsd  %xmm14,%xmm0
  mulsd  0x58(%rdx),%xmm9
  mulsd  %xmm4,%xmm14
  addsd  %xmm0,%xmm10
  movsd  0x58(%rdx),%xmm0
  addsd  %xmm1,%xmm9
  mulsd  %xmm4,%xmm0
  addsd  %xmm2,%xmm14
  mulsd  0x78(%rdx),%xmm4
  add    %rdi,%rdx
  movsd  %xmm9,-0x20(%rsp)
  addsd  %xmm7,%xmm0
  addsd  %xmm12,%xmm4
  movsd  %xmm0,-0x18(%rsp)
  cmp    %rcx,%rax
  jne    L66
  imul   %rbp,%rdi
  movsd  %xmm13,-0x10(%rsp)
  lea    0x0(,%r11,4),%eax
  add    %rdi,%rsi
L44:
  cmp    %eax,%r10d
  jle    L64
  sub    $0x1,%r10d
  movsd  -0x10(%rsp),%xmm9
  movsd  -0x20(%rsp),%xmm11
  sub    %eax,%r10d
  movsd  -0x18(%rsp),%xmm12
  lea    0x8(%rsi,%r10,8),%rax
L70:
  movsd  (%rsi),%xmm1
  movsd  (%rcx),%xmm13
  add    $0x8,%rsi
  add    $0x20,%rcx
  movsd  -0x18(%rcx),%xmm8
  movsd  -0x10(%rcx),%xmm2
  mulsd  %xmm1,%xmm13
  movsd  -0x8(%rcx),%xmm0
  movsd  0x18(%rsi),%xmm7
  addsd  %xmm13,%xmm15
  movapd %xmm8,%xmm13
  mulsd  %xmm1,%xmm13
  mulsd  %xmm7,%xmm8
  addsd  %xmm13,%xmm9
  movapd %xmm2,%xmm13
  mulsd  %xmm1,%xmm13
  addsd  %xmm8,%xmm5
  mulsd  %xmm0,%xmm1
  addsd  %xmm13,%xmm3
  addsd  %xmm1,%xmm6
  movapd %xmm2,%xmm1
  mulsd  %xmm7,%xmm1
  mulsd  0x38(%rsi),%xmm2
  mulsd  %xmm0,%xmm7
  addsd  %xmm1,%xmm10
  movsd  0x38(%rsi),%xmm1
  addsd  %xmm2,%xmm11
  mulsd  %xmm0,%xmm1
  addsd  %xmm7,%xmm14
  mulsd  0x58(%rsi),%xmm0
  addsd  %xmm1,%xmm12
  addsd  %xmm0,%xmm4
  cmp    %rax,%rsi
  jne    L70
  movsd  %xmm9,-0x10(%rsp)
  movsd  %xmm11,-0x20(%rsp)
  movsd  %xmm12,-0x18(%rsp)
L64:
  test   %ebx,%ebx
  je     L55
  movsd  0x38(%r8),%xmm2
  movsd  (%r8),%xmm9
  movsd  0x8(%r8),%xmm8
  movsd  0x10(%r8),%xmm7
  movsd  %xmm2,-0x8(%rsp)
  movsd  0x18(%r8),%xmm11
  movsd  0x28(%r8),%xmm12
  movsd  0x30(%r8),%xmm13
  movsd  0x50(%r8),%xmm2
  movsd  0x58(%r8),%xmm1
  movsd  0x78(%r8),%xmm0
  cmp    $0x1,%ebx
  je     L35
  subsd  %xmm3,%xmm7
  subsd  %xmm15,%xmm9
  subsd  -0x10(%rsp),%xmm8
  subsd  %xmm6,%xmm11
  subsd  %xmm5,%xmm12
  subsd  %xmm10,%xmm13
  movapd %xmm7,%xmm3
  movsd  -0x8(%rsp),%xmm7
  subsd  -0x20(%rsp),%xmm2
  subsd  %xmm4,%xmm0
  subsd  -0x18(%rsp),%xmm1
  movapd %xmm9,%xmm15
  movapd %xmm11,%xmm6
  movsd  %xmm8,-0x10(%rsp)
  subsd  %xmm14,%xmm7
  movapd %xmm12,%xmm5
  movapd %xmm13,%xmm10
  movsd  %xmm2,-0x20(%rsp)
  movapd %xmm0,%xmm4
  movsd  %xmm1,-0x18(%rsp)
  movapd %xmm7,%xmm14
L55:
  movsd  %xmm3,0x10(%r9)
  movsd  -0x20(%rsp),%xmm3
  movsd  -0x10(%rsp),%xmm2
  movsd  %xmm15,(%r9)
  movsd  %xmm3,0x50(%r9)
  movsd  -0x18(%rsp),%xmm3
  pop    %rbx
  movsd  %xmm2,0x8(%r9)
  pop    %rbp
  movsd  %xmm6,0x18(%r9)
  movsd  %xmm5,0x28(%r9)
  movsd  %xmm10,0x30(%r9)
  movsd  %xmm14,0x38(%r9)
  movsd  %xmm3,0x58(%r9)
  movsd  %xmm4,0x78(%r9)
  ret
  nopl   0x0(%rax,%rax,1)
L35:
  addsd  -0x10(%rsp),%xmm8
  addsd  -0x20(%rsp),%xmm2
  addsd  -0x18(%rsp),%xmm1
  addsd  %xmm9,%xmm15
  addsd  %xmm7,%xmm3
  addsd  %xmm11,%xmm6
  addsd  %xmm12,%xmm5
  addsd  %xmm13,%xmm10
  movsd  %xmm8,-0x10(%rsp)
  addsd  -0x8(%rsp),%xmm14
  addsd  %xmm0,%xmm4
  movsd  %xmm2,-0x20(%rsp)
  movsd  %xmm1,-0x18(%rsp)
  jmp    L55
  xchg   %ax,%ax
L14:
  pxor   %xmm4,%xmm4
  mov    %rax,%rcx
  xor    %eax,%eax
  movsd  %xmm4,-0x18(%rsp)
  movapd %xmm4,%xmm14
  movapd %xmm4,%xmm6
  movapd %xmm4,%xmm10
  movsd  %xmm4,-0x20(%rsp)
  movapd %xmm4,%xmm3
  movapd %xmm4,%xmm5
  movapd %xmm4,%xmm15
  movsd  %xmm4,-0x10(%rsp)
  jmp    L44
```

assistant: ```c
void kernel_dsyrk_nn_4x4_lib4(int kmax, double *A, double *B, int sdb, double *C, double *D, int alg) {
  const int bs = 4;
  int k;
  double a_0, a_1, a_2, a_3, b_0, b_1, b_2, b_3, c_00 = 0, c_10 = 0, c_11 = 0, c_20 = 0, c_21 = 0, c_22 = 0, c_30 = 0, c_31 = 0, c_32 = 0, c_33 = 0;
  for (k = 0; k < kmax - 3; k += 4) {
    a_0 = A[0 + bs * 0];
    a_1 = A[1 + bs * 0];
    a_2 = A[2 + bs * 0];
    a_3 = A[3 + bs * 0];
    b_0 = B[0 + bs * 0];
    b_1 = B[0 + bs * 1];
    b_2 = B[0 + bs * 2];
    b_3 = B[0 + bs * 3];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_20 += a_2 * b_0;
    c_30 += a_3 * b_0;
    c_11 += a_1 * b_1;
    c_21 += a_2 * b_1;
    c_31 += a_3 * b_1;
    c_22 += a_2 * b_2;
    c_32 += a_3 * b_2;
    c_33 += a_3 * b_3;
    a_0 = A[0 + bs * 1];
    a_1 = A[1 + bs * 1];
    a_2 = A[2 + bs * 1];
    a_3 = A[3 + bs * 1];
    b_0 = B[1 + bs * 0];
    b_1 = B[1 + bs * 1];
    b_2 = B[1 + bs * 2];
    b_3 = B[1 + bs * 3];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_20 += a_2 * b_0;
    c_30 += a_3 * b_0;
    c_11 += a_1 * b_1;
    c_21 += a_2 * b_1;
    c_31 += a_3 * b_1;
    c_22 += a_2 * b_2;
    c_32 += a_3 * b_2;
    c_33 += a_3 * b_3;
    a_0 = A[0 + bs * 2];
    a_1 = A[1 + bs * 2];
    a_2 = A[2 + bs * 2];
    a_3 = A[3 + bs * 2];
    b_0 = B[2 + bs * 0];
    b_1 = B[2 + bs * 1];
    b_2 = B[2 + bs * 2];
    b_3 = B[2 + bs * 3];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_20 += a_2 * b_0;
    c_30 += a_3 * b_0;
    c_11 += a_1 * b_1;
    c_21 += a_2 * b_1;
    c_31 += a_3 * b_1;
    c_22 += a_2 * b_2;
    c_32 += a_3 * b_2;
    c_33 += a_3 * b_3;
    a_0 = A[0 + bs * 3];
    a_1 = A[1 + bs * 3];
    a_2 = A[2 + bs * 3];
    a_3 = A[3 + bs * 3];
    b_0 = B[3 + bs * 0];
    b_1 = B[3 + bs * 1];
    b_2 = B[3 + bs * 2];
    b_3 = B[3 + bs * 3];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_20 += a_2 * b_0;
    c_30 += a_3 * b_0;
    c_11 += a_1 * b_1;
    c_21 += a_2 * b_1;
    c_31 += a_3 * b_1;
    c_22 += a_2 * b_2;
    c_32 += a_3 * b_2;
    c_33 += a_3 * b_3;
    A += 16;
    B += 4 * sdb;
  }
  for (; k < kmax; k++) {
    a_0 = A[0 + bs * 0];
    a_1 = A[1 + bs * 0];
    a_2 = A[2 + bs * 0];
    a_3 = A[3 + bs * 0];
    b_0 = B[0 + bs * 0];
    b_1 = B[0 + bs * 1];
    b_2 = B[0 + bs * 2];
    b_3 = B[0 + bs * 3];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_20 += a_2 * b_0;
    c_30 += a_3 * b_0;
    c_11 += a_1 * b_1;
    c_21 += a_2 * b_1;
    c_31 += a_3 * b_1;
    c_22 += a_2 * b_2;
    c_32 += a_3 * b_2;
    c_33 += a_3 * b_3;
    A += 4;
    B += 1;
  }
  double d_00, d_10, d_11, d_20, d_21, d_22, d_30, d_31, d_32, d_33;
  if (alg == 0) {
    D[0 + bs * 0] = c_00;
    D[1 + bs * 0] = c_10;
    D[2 + bs * 0] = c_20;
    D[3 + bs * 0] = c_30;
    D[1 + bs * 1] = c_11;
    D[2 + bs * 1] = c_21;
    D[3 + bs * 1] = c_31;
    D[2 + bs * 2] = c_22;
    D[3 + bs * 2] = c_32;
    D[3 + bs * 3] = c_33;
  } else {
    d_00 = C[0 + bs * 0];
    d_10 = C[1 + bs * 0];
    d_20 = C[2 + bs * 0];
    d_30 = C[3 + bs * 0];
    d_11 = C[1 + bs * 1];
    d_21 = C[2 + bs * 1];
    d_31 = C[3 + bs * 1];
    d_22 = C[2 + bs * 2];
    d_32 = C[3 + bs * 2];
    d_33 = C[3 + bs * 3];
    if (alg == 1) {
      d_00 += c_00;
      d_10 += c_10;
      d_20 += c_20;
      d_30 += c_30;
      d_11 += c_11;
      d_21 += c_21;
      d_31 += c_31;
      d_22 += c_22;
      d_32 += c_32;
      d_33 += c_33;
    } else {
      d_00 -= c_00;
      d_10 -= c_10;
      d_20 -= c_20;
      d_30 -= c_30;
      d_11 -= c_11;
      d_21 -= c_21;
      d_31 -= c_31;
      d_22 -= c_22;
      d_32 -= c_32;
      d_33 -= c_33;
    }
    D[0 + bs * 0] = d_00;
    D[1 + bs * 0] = d_10;
    D[2 + bs * 0] = d_20;
    D[3 + bs * 0] = d_30;
    D[1 + bs * 1] = d_11;
    D[2 + bs * 1] = d_21;
    D[3 + bs * 1] = d_31;
    D[2 + bs * 2] = d_22;
    D[3 + bs * 2] = d_32;
    D[3 + bs * 3] = d_33;
  }
}
```