user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<kernel_dgemm_nn_2x4_vs_lib4>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  mov    0x28(%rsp),%r12
  mov    0x30(%rsp),%rbp
  mov    0x38(%rsp),%r13d
  test   %edx,%edx
  jle    L98
  mov    %edi,%r10d
  mov    %esi,%r11d
  mov    %rcx,%rdx
  cmp    $0x3,%ebx
  jle    L109
  lea    -0x4(%rbx),%eax
  shl    $0x2,%r9d
  pxor   %xmm0,%xmm0
  shr    $0x2,%eax
  movapd %xmm0,%xmm2
  movapd %xmm0,%xmm3
  movslq %r9d,%rsi
  lea    0x1(%rax),%r9d
  shl    $0x3,%rsi
  movapd %xmm0,%xmm5
  mov    %r8,%rax
  mov    %r9,%rcx
  movapd %xmm0,%xmm1
  movapd %xmm0,%xmm13
  mov    %r9,%rdi
  shl    $0x7,%rcx
  movapd %xmm0,%xmm10
  movapd %xmm0,%xmm11
  add    %rdx,%rcx
  nopl   (%rax)
L184:
  movsd  (%rdx),%xmm4
  movsd  (%rax),%xmm8
  sub    $0xffffffffffffff80,%rdx
  movsd  0x20(%rax),%xmm7
  movsd  0x60(%rax),%xmm14
  movapd %xmm4,%xmm12
  movsd  -0x78(%rdx),%xmm9
  movsd  0x40(%rax),%xmm6
  mulsd  %xmm8,%xmm12
  movsd  0x78(%rax),%xmm15
  mulsd  %xmm9,%xmm8
  addsd  %xmm11,%xmm12
  movapd %xmm4,%xmm11
  mulsd  %xmm7,%xmm11
  addsd  %xmm5,%xmm8
  movsd  0x8(%rax),%xmm5
  mulsd  %xmm9,%xmm7
  addsd  %xmm10,%xmm11
  movapd %xmm4,%xmm10
  mulsd  %xmm14,%xmm4
  addsd  %xmm3,%xmm7
  movsd  0x48(%rax),%xmm3
  mulsd  %xmm6,%xmm10
  mulsd  %xmm9,%xmm6
  addsd  %xmm1,%xmm4
  movapd %xmm9,%xmm1
  mulsd  %xmm14,%xmm1
  movsd  0x28(%rax),%xmm14
  addsd  %xmm13,%xmm10
  movsd  0x68(%rax),%xmm13
  addsd  %xmm2,%xmm6
  movsd  -0x58(%rdx),%xmm2
  addsd  %xmm0,%xmm1
  movsd  -0x60(%rdx),%xmm0
  movapd %xmm0,%xmm9
  mulsd  %xmm5,%xmm9
  mulsd  %xmm2,%xmm5
  addsd  %xmm12,%xmm9
  movsd  0x10(%rax),%xmm12
  addsd  %xmm8,%xmm5
  movapd %xmm0,%xmm8
  mulsd  %xmm14,%xmm8
  mulsd  %xmm2,%xmm14
  addsd  %xmm11,%xmm8
  movapd %xmm0,%xmm11
  mulsd  %xmm3,%xmm11
  addsd  %xmm14,%xmm7
  movsd  0x30(%rax),%xmm14
  mulsd  %xmm2,%xmm3
  mulsd  %xmm13,%xmm2
  mulsd  %xmm13,%xmm0
  addsd  %xmm11,%xmm10
  movsd  0x70(%rax),%xmm11
  addsd  %xmm3,%xmm6
  addsd  %xmm1,%xmm2
  movsd  -0x40(%rdx),%xmm1
  movapd %xmm0,%xmm3
  movsd  -0x38(%rdx),%xmm0
  movapd %xmm1,%xmm13
  addsd  %xmm4,%xmm3
  movsd  0x50(%rax),%xmm4
  mulsd  %xmm12,%xmm13
  mulsd  %xmm0,%xmm12
  addsd  %xmm9,%xmm13
  movapd %xmm12,%xmm9
  movapd %xmm1,%xmm12
  mulsd  %xmm14,%xmm12
  addsd  %xmm5,%xmm9
  movsd  0x18(%rax),%xmm5
  mulsd  %xmm0,%xmm14
  addsd  %xmm8,%xmm12
  movapd %xmm1,%xmm8
  mulsd  %xmm4,%xmm8
  addsd  %xmm14,%xmm7
  mulsd  %xmm11,%xmm1
  mulsd  %xmm0,%xmm4
  mulsd  %xmm11,%xmm0
  addsd  %xmm10,%xmm8
  addsd  %xmm6,%xmm4
  movapd %xmm1,%xmm6
  movsd  -0x20(%rdx),%xmm1
  addsd  %xmm2,%xmm0
  addsd  %xmm3,%xmm6
  movsd  0x58(%rax),%xmm2
  movsd  0x38(%rax),%xmm3
  movapd %xmm1,%xmm11
  movapd %xmm1,%xmm10
  add    %rsi,%rax
  mulsd  %xmm5,%xmm11
  mulsd  %xmm3,%xmm10
  movapd %xmm0,%xmm14
  movsd  -0x18(%rdx),%xmm0
  mulsd  %xmm0,%xmm5
  mulsd  %xmm0,%xmm3
  addsd  %xmm13,%xmm11
  movapd %xmm1,%xmm13
  mulsd  %xmm2,%xmm13
  addsd  %xmm12,%xmm10
  mulsd  %xmm0,%xmm2
  mulsd  %xmm15,%xmm1
  addsd  %xmm9,%xmm5
  mulsd  %xmm15,%xmm0
  addsd  %xmm7,%xmm3
  addsd  %xmm8,%xmm13
  addsd  %xmm4,%xmm2
  addsd  %xmm6,%xmm1
  addsd  %xmm14,%xmm0
  cmp    %rcx,%rdx
  jne    L184
  imul   %r9,%rsi
  lea    0x0(,%rdi,4),%eax
  add    %rsi,%r8
  cmp    %eax,%ebx
  jle    L215
L21:
  movsd  (%rcx),%xmm6
  movsd  0x8(%rcx),%xmm4
  add    $0x1,%eax
  add    $0x20,%rcx
  movsd  (%r8),%xmm9
  movsd  0x20(%r8),%xmm8
  add    $0x8,%r8
  movapd %xmm6,%xmm14
  movsd  0x38(%r8),%xmm7
  movsd  0x58(%r8),%xmm12
  mulsd  %xmm9,%xmm14
  mulsd  %xmm4,%xmm9
  addsd  %xmm14,%xmm11
  addsd  %xmm9,%xmm5
  movapd %xmm6,%xmm9
  mulsd  %xmm8,%xmm9
  mulsd  %xmm4,%xmm8
  addsd  %xmm9,%xmm10
  addsd  %xmm8,%xmm3
  movapd %xmm6,%xmm8
  mulsd  %xmm7,%xmm8
  mulsd  %xmm12,%xmm6
  mulsd  %xmm4,%xmm7
  mulsd  %xmm12,%xmm4
  addsd  %xmm8,%xmm13
  addsd  %xmm6,%xmm1
  addsd  %xmm7,%xmm2
  addsd  %xmm4,%xmm0
  cmp    %eax,%ebx
  jg     L21
L215:
  test   %r13d,%r13d
  jne    L182
  mov    0x48(%rsp),%eax
  movsd  %xmm11,0x0(%rbp)
  test   %eax,%eax
  jne    L38
L44:
  cmp    $0x1,%r10d
  jle    L177
  movsd  %xmm5,0x8(%rbp)
  movsd  %xmm10,0x20(%rbp)
  movsd  %xmm3,0x28(%rbp)
  movsd  %xmm13,0x40(%rbp)
  movsd  %xmm2,0x48(%rbp)
  cmp    $0x3,%r11d
  jle    L98
  movsd  %xmm1,0x60(%rbp)
  movsd  %xmm0,0x68(%rbp)
L98:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  cs nopw 0x0(%rax,%rax,1)
L38:
  movsd  %xmm10,0x8(%rbp)
  movsd  %xmm13,0x10(%rbp)
  cmp    $0x3,%r11d
  jle    L152
  movsd  %xmm1,0x18(%rbp)
  cmp    $0x1,%r10d
  jle    L98
  movsd  %xmm5,0x20(%rbp)
  movsd  %xmm3,0x28(%rbp)
  movsd  %xmm2,0x30(%rbp)
  movsd  %xmm0,0x38(%rbp)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L182:
  mov    0x40(%rsp),%edx
  movsd  (%r12),%xmm8
  movsd  0x8(%r12),%xmm6
  movsd  0x20(%r12),%xmm4
  movsd  0x28(%r12),%xmm7
  test   %edx,%edx
  je     L137
  movq   %xmm4,%rax
  movsd  0x10(%r12),%xmm15
  movapd %xmm6,%xmm4
  movsd  0x18(%r12),%xmm12
  movsd  0x30(%r12),%xmm14
  movsd  0x38(%r12),%xmm9
  movq   %rax,%xmm6
  cmp    $0x1,%r13d
  je     L204
L150:
  subsd  %xmm11,%xmm8
  subsd  %xmm5,%xmm6
  mov    0x48(%rsp),%eax
  subsd  %xmm10,%xmm4
  subsd  %xmm3,%xmm7
  subsd  %xmm13,%xmm15
  subsd  %xmm2,%xmm14
  test   %eax,%eax
  subsd  %xmm1,%xmm12
  subsd  %xmm0,%xmm9
  movapd %xmm8,%xmm11
  movapd %xmm6,%xmm5
  movapd %xmm4,%xmm10
  movapd %xmm7,%xmm3
  movsd  %xmm11,0x0(%rbp)
  movapd %xmm15,%xmm13
  movapd %xmm14,%xmm2
  movapd %xmm12,%xmm1
  movapd %xmm9,%xmm0
  jne    L38
  jmp    L44
  xchg   %ax,%ax
L137:
  movsd  0x40(%r12),%xmm15
  movsd  0x48(%r12),%xmm14
  movsd  0x60(%r12),%xmm12
  movsd  0x68(%r12),%xmm9
  cmp    $0x1,%r13d
  jne    L150
L204:
  addsd  %xmm8,%xmm11
  mov    0x48(%rsp),%eax
  addsd  %xmm6,%xmm5
  addsd  %xmm4,%xmm10
  addsd  %xmm7,%xmm3
  test   %eax,%eax
  addsd  %xmm15,%xmm13
  addsd  %xmm14,%xmm2
  addsd  %xmm12,%xmm1
  addsd  %xmm9,%xmm0
  movsd  %xmm11,0x0(%rbp)
  jne    L38
  jmp    L44
  nopl   0x0(%rax,%rax,1)
L152:
  cmp    $0x1,%r10d
  jle    L98
  movsd  %xmm5,0x20(%rbp)
  movsd  %xmm3,0x28(%rbp)
  movsd  %xmm2,0x30(%rbp)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L177:
  movsd  %xmm10,0x20(%rbp)
  movsd  %xmm13,0x40(%rbp)
  cmp    $0x3,%r11d
  jle    L98
  movsd  %xmm1,0x60(%rbp)
  jmp    L98
L109:
  pxor   %xmm0,%xmm0
  xor    %eax,%eax
  movapd %xmm0,%xmm2
  movapd %xmm0,%xmm3
  movapd %xmm0,%xmm5
  movapd %xmm0,%xmm1
  movapd %xmm0,%xmm13
  movapd %xmm0,%xmm10
  movapd %xmm0,%xmm11
  jmp    L21
```

assistant: ```c
void kernel_dgemm_nn_2x4_vs_lib4(int km, int kn, int kmax, double *A, double *B, int sdb, double *C, double *D, int alg, int tc, int td) {
  if (kmax <= 0)
    return;
  const int bs = 4;
  int k;
  double a_0, a_1, b_0, b_1, b_2, b_3, c_00 = 0, c_01 = 0, c_02 = 0, c_03 = 0, c_10 = 0, c_11 = 0, c_12 = 0, c_13 = 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];
    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_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    c_02 += a_0 * b_2;
    c_12 += a_1 * b_2;
    c_03 += a_0 * b_3;
    c_13 += a_1 * b_3;
    a_0 = A[0 + bs * 1];
    a_1 = A[1 + 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_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    c_02 += a_0 * b_2;
    c_12 += a_1 * b_2;
    c_03 += a_0 * b_3;
    c_13 += a_1 * b_3;
    a_0 = A[0 + bs * 2];
    a_1 = A[1 + 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_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    c_02 += a_0 * b_2;
    c_12 += a_1 * b_2;
    c_03 += a_0 * b_3;
    c_13 += a_1 * b_3;
    a_0 = A[0 + bs * 3];
    a_1 = A[1 + 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_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    c_02 += a_0 * b_2;
    c_12 += a_1 * b_2;
    c_03 += a_0 * b_3;
    c_13 += a_1 * b_3;
    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];
    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_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    c_02 += a_0 * b_2;
    c_12 += a_1 * b_2;
    c_03 += a_0 * b_3;
    c_13 += a_1 * b_3;
    A += 4;
    B += 1;
  }
  double d_00, d_01, d_02, d_03, d_10, d_11, d_12, d_13;
  if (alg == 0) {
    if (td == 0) {
      goto store_n;
    } else {
      goto store_t;
    }
  } else {
    if (tc == 0) {
      d_00 = C[0 + bs * 0];
      d_10 = C[1 + bs * 0];
      d_01 = C[0 + bs * 1];
      d_11 = C[1 + bs * 1];
      d_02 = C[0 + bs * 2];
      d_12 = C[1 + bs * 2];
      d_03 = C[0 + bs * 3];
      d_13 = C[1 + bs * 3];
    } else {
      d_00 = C[0 + bs * 0];
      d_01 = C[1 + bs * 0];
      d_02 = C[2 + bs * 0];
      d_03 = C[3 + bs * 0];
      d_10 = C[0 + bs * 1];
      d_11 = C[1 + bs * 1];
      d_12 = C[2 + bs * 1];
      d_13 = C[3 + bs * 1];
    }
    if (alg == 1) {
      c_00 = d_00 + c_00;
      c_10 = d_10 + c_10;
      c_01 = d_01 + c_01;
      c_11 = d_11 + c_11;
      c_02 = d_02 + c_02;
      c_12 = d_12 + c_12;
      c_03 = d_03 + c_03;
      c_13 = d_13 + c_13;
    } else {
      c_00 = d_00 - c_00;
      c_10 = d_10 - c_10;
      c_01 = d_01 - c_01;
      c_11 = d_11 - c_11;
      c_02 = d_02 - c_02;
      c_12 = d_12 - c_12;
      c_03 = d_03 - c_03;
      c_13 = d_13 - c_13;
    }
    if (td == 0) {
      goto store_n;
    } else {
      goto store_t;
    }
  }
store_n:
  if (km >= 2) {
    D[0 + bs * 0] = c_00;
    D[1 + bs * 0] = c_10;
    D[0 + bs * 1] = c_01;
    D[1 + bs * 1] = c_11;
    D[0 + bs * 2] = c_02;
    D[1 + bs * 2] = c_12;
    if (kn >= 4) {
      D[0 + bs * 3] = c_03;
      D[1 + bs * 3] = c_13;
    }
  } else {
    D[0 + bs * 0] = c_00;
    D[0 + bs * 1] = c_01;
    D[0 + bs * 2] = c_02;
    if (kn >= 4) {
      D[0 + bs * 3] = c_03;
    }
  }
  return;
store_t:
  if (kn >= 4) {
    D[0 + bs * 0] = c_00;
    D[1 + bs * 0] = c_01;
    D[2 + bs * 0] = c_02;
    D[3 + bs * 0] = c_03;
    if (km >= 2) {
      D[0 + bs * 1] = c_10;
      D[1 + bs * 1] = c_11;
      D[2 + bs * 1] = c_12;
      D[3 + bs * 1] = c_13;
    }
  } else {
    D[0 + bs * 0] = c_00;
    D[1 + bs * 0] = c_01;
    D[2 + bs * 0] = c_02;
    if (km >= 2) {
      D[0 + bs * 1] = c_10;
      D[1 + bs * 1] = c_11;
      D[2 + bs * 1] = c_12;
    }
  }
  return;
}
```