user: 请将以下的汇编代码转换成C语言代码:

```asm
<kernel_dsyrk_nn_2x2_lib4>:
  endbr64
  push   %rbp
  mov    %rsi,%rax
  mov    %rdx,%r10
  push   %rbx
  mov    0x18(%rsp),%ebx
  cmp    $0x3,%edi
  jle    L22
  lea    -0x4(%rdi),%r11d
  shl    $0x2,%ecx
  pxor   %xmm0,%xmm0
  shr    $0x2,%r11d
  movapd %xmm0,%xmm3
  movapd %xmm0,%xmm4
  movslq %ecx,%rsi
  lea    0x1(%r11),%ebp
  shl    $0x3,%rsi
  mov    %rbp,%rcx
  mov    %rbp,%r11
  shl    $0x7,%rcx
  add    %rax,%rcx
  nopl   0x0(%rax,%rax,1)
L79:
  movsd  0x8(%rax),%xmm1
  movsd  (%rdx),%xmm2
  sub    $0xffffffffffffff80,%rax
  movsd  -0x80(%rax),%xmm5
  mulsd  %xmm2,%xmm5
  mulsd  %xmm1,%xmm2
  mulsd  0x20(%rdx),%xmm1
  addsd  %xmm4,%xmm5
  movsd  -0x60(%rax),%xmm4
  addsd  %xmm3,%xmm2
  movapd %xmm1,%xmm3
  movsd  0x8(%rdx),%xmm1
  addsd  %xmm0,%xmm3
  movsd  -0x58(%rax),%xmm0
  mulsd  %xmm1,%xmm4
  mulsd  %xmm0,%xmm1
  mulsd  0x28(%rdx),%xmm0
  addsd  %xmm5,%xmm4
  movsd  -0x40(%rax),%xmm5
  addsd  %xmm1,%xmm2
  movsd  0x10(%rdx),%xmm1
  addsd  %xmm0,%xmm3
  movsd  -0x38(%rax),%xmm0
  mulsd  %xmm1,%xmm5
  mulsd  %xmm0,%xmm1
  mulsd  0x30(%rdx),%xmm0
  addsd  %xmm4,%xmm5
  movsd  -0x20(%rax),%xmm4
  addsd  %xmm1,%xmm2
  addsd  %xmm3,%xmm0
  movsd  0x18(%rdx),%xmm3
  mulsd  %xmm3,%xmm4
  movapd %xmm0,%xmm1
  movsd  -0x18(%rax),%xmm0
  mulsd  %xmm0,%xmm3
  mulsd  0x38(%rdx),%xmm0
  add    %rsi,%rdx
  addsd  %xmm5,%xmm4
  addsd  %xmm2,%xmm3
  addsd  %xmm1,%xmm0
  cmp    %rcx,%rax
  jne    L79
  imul   %rbp,%rsi
  lea    0x0(,%r11,4),%eax
  add    %rsi,%r10
L36:
  cmp    %eax,%edi
  jle    L75
  sub    $0x1,%edi
  sub    %eax,%edi
  lea    0x8(%r10,%rdi,8),%rax
L35:
  movsd  0x8(%rcx),%xmm1
  movsd  (%rcx),%xmm5
  add    $0x8,%r10
  add    $0x20,%rcx
  movsd  -0x8(%r10),%xmm2
  mulsd  %xmm2,%xmm5
  mulsd  %xmm1,%xmm2
  mulsd  0x18(%r10),%xmm1
  addsd  %xmm5,%xmm4
  addsd  %xmm2,%xmm3
  addsd  %xmm1,%xmm0
  cmp    %rax,%r10
  jne    L35
L75:
  test   %ebx,%ebx
  je     L55
  movsd  (%r8),%xmm5
  movsd  0x8(%r8),%xmm2
  movsd  0x28(%r8),%xmm1
  cmp    $0x1,%ebx
  je     L62
  subsd  %xmm4,%xmm5
  subsd  %xmm3,%xmm2
  subsd  %xmm0,%xmm1
  movapd %xmm5,%xmm4
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm0
L55:
  pop    %rbx
  movsd  %xmm4,(%r9)
  pop    %rbp
  movsd  %xmm3,0x8(%r9)
  movsd  %xmm0,0x28(%r9)
  ret
L62:
  addsd  %xmm5,%xmm4
  addsd  %xmm2,%xmm3
  addsd  %xmm1,%xmm0
  jmp    L55
  xchg   %ax,%ax
L22:
  pxor   %xmm0,%xmm0
  mov    %rsi,%rcx
  xor    %eax,%eax
  movapd %xmm0,%xmm3
  movapd %xmm0,%xmm4
  jmp    L36
```

assistant: ```c
void kernel_dsyrk_nn_2x2_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, b_0, b_1, c_00 = 0, c_10 = 0, c_11 = 0;
  for (k = 0; k < kmax - 3; k += 4) {
    a_0 = A[0 + bs * 0];
    a_1 = A[1 + bs * 0];
    b_0 = B[0 + bs * 0];
    b_1 = B[0 + bs * 1];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_11 += a_1 * b_1;
    a_0 = A[0 + bs * 1];
    a_1 = A[1 + bs * 1];
    b_0 = B[1 + bs * 0];
    b_1 = B[1 + bs * 1];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_11 += a_1 * b_1;
    a_0 = A[0 + bs * 2];
    a_1 = A[1 + bs * 2];
    b_0 = B[2 + bs * 0];
    b_1 = B[2 + bs * 1];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_11 += a_1 * b_1;
    a_0 = A[0 + bs * 3];
    a_1 = A[1 + bs * 3];
    b_0 = B[3 + bs * 0];
    b_1 = B[3 + bs * 1];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_11 += a_1 * b_1;
    A += 16;
    B += 4 * sdb;
  }
  for (; k < kmax; k++) {
    a_0 = A[0 + bs * 0];
    a_1 = A[1 + bs * 0];
    b_0 = B[0 + bs * 0];
    b_1 = B[0 + bs * 1];
    c_00 += a_0 * b_0;
    c_10 += a_1 * b_0;
    c_11 += a_1 * b_1;
    A += 4;
    B += 1;
  }
  double d_00, d_10, d_11;
  if (alg == 0) {
    D[0 + bs * 0] = c_00;
    D[1 + bs * 0] = c_10;
    D[1 + bs * 1] = c_11;
  } else {
    d_00 = C[0 + bs * 0];
    d_10 = C[1 + bs * 0];
    d_11 = C[1 + bs * 1];
    if (alg == 1) {
      d_00 += c_00;
      d_10 += c_10;
      d_11 += c_11;
    } else {
      d_00 -= c_00;
      d_10 -= c_10;
      d_11 -= c_11;
    }
    D[0 + bs * 0] = d_00;
    D[1 + bs * 0] = d_10;
    D[1 + bs * 1] = d_11;
  }
}
```