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

```asm
<kernel_dgemm_nt_4x2_vs_lib4>:
  endbr64
  push   %r12
  mov    %esi,%r10d
  mov    %edx,%esi
  push   %rbp
  push   %rbx
  mov    0x20(%rsp),%r11
  mov    0x28(%rsp),%ebx
  cmp    $0x3,%edx
  jle    L6
  lea    -0x4(%rdx),%ebp
  pxor   %xmm1,%xmm1
  mov    %rcx,%rax
  movapd %xmm1,%xmm0
  shr    $0x2,%ebp
  movapd %xmm1,%xmm2
  movapd %xmm1,%xmm13
  lea    0x1(%rbp),%r12d
  movapd %xmm1,%xmm3
  movapd %xmm1,%xmm8
  mov    %r12,%rbp
  shl    $0x7,%r12
  movapd %xmm1,%xmm4
  movapd %xmm1,%xmm9
  lea    (%r8,%r12,1),%rdx
  nopw   0x0(%rax,%rax,1)
L90:
  movsd  (%rax),%xmm11
  movsd  (%r8),%xmm5
  sub    $0xffffffffffffff80,%r8
  sub    $0xffffffffffffff80,%rax
  movsd  -0x78(%rax),%xmm12
  movsd  -0x70(%rax),%xmm7
  movapd %xmm11,%xmm10
  movsd  -0x68(%rax),%xmm6
  movsd  -0x78(%r8),%xmm14
  mulsd  %xmm5,%xmm10
  mulsd  %xmm14,%xmm11
  addsd  %xmm9,%xmm10
  movapd %xmm12,%xmm9
  mulsd  %xmm5,%xmm9
  addsd  %xmm4,%xmm11
  movsd  -0x58(%rax),%xmm4
  mulsd  %xmm14,%xmm12
  addsd  %xmm8,%xmm9
  movapd %xmm7,%xmm8
  mulsd  %xmm5,%xmm8
  addsd  %xmm3,%xmm12
  movsd  -0x50(%rax),%xmm3
  mulsd  %xmm6,%xmm5
  mulsd  %xmm14,%xmm6
  mulsd  %xmm14,%xmm7
  addsd  %xmm13,%xmm8
  movsd  -0x58(%r8),%xmm13
  addsd  %xmm5,%xmm0
  movsd  -0x60(%rax),%xmm5
  addsd  %xmm1,%xmm6
  movsd  -0x60(%r8),%xmm1
  movapd %xmm5,%xmm14
  addsd  %xmm2,%xmm7
  movsd  -0x48(%rax),%xmm2
  mulsd  %xmm1,%xmm14
  mulsd  %xmm13,%xmm5
  addsd  %xmm14,%xmm10
  movapd %xmm4,%xmm14
  mulsd  %xmm1,%xmm14
  addsd  %xmm11,%xmm5
  movsd  -0x38(%rax),%xmm11
  mulsd  %xmm13,%xmm4
  addsd  %xmm14,%xmm9
  movapd %xmm3,%xmm14
  mulsd  %xmm1,%xmm14
  addsd  %xmm12,%xmm4
  movsd  -0x40(%rax),%xmm12
  mulsd  %xmm2,%xmm1
  mulsd  %xmm13,%xmm3
  movapd %xmm12,%xmm15
  mulsd  %xmm13,%xmm2
  movsd  -0x38(%r8),%xmm13
  addsd  %xmm14,%xmm8
  mulsd  %xmm13,%xmm12
  movapd %xmm11,%xmm14
  addsd  %xmm0,%xmm1
  movsd  -0x40(%r8),%xmm0
  mulsd  %xmm13,%xmm11
  addsd  %xmm7,%xmm3
  movsd  -0x30(%rax),%xmm7
  mulsd  %xmm0,%xmm15
  addsd  %xmm6,%xmm2
  movsd  -0x28(%rax),%xmm6
  mulsd  %xmm0,%xmm14
  addsd  %xmm5,%xmm12
  movsd  -0x18(%r8),%xmm5
  addsd  %xmm4,%xmm11
  movsd  -0x20(%rax),%xmm4
  addsd  %xmm10,%xmm15
  movapd %xmm7,%xmm10
  mulsd  %xmm0,%xmm10
  addsd  %xmm9,%xmm14
  movapd %xmm4,%xmm9
  mulsd  %xmm6,%xmm0
  mulsd  %xmm13,%xmm7
  mulsd  %xmm13,%xmm6
  mulsd  %xmm5,%xmm4
  addsd  %xmm8,%xmm10
  addsd  %xmm0,%xmm1
  movsd  -0x20(%r8),%xmm0
  addsd  %xmm3,%xmm7
  movsd  -0x18(%rax),%xmm3
  addsd  %xmm2,%xmm6
  movsd  -0x10(%rax),%xmm2
  mulsd  %xmm0,%xmm9
  movapd %xmm3,%xmm8
  addsd  %xmm12,%xmm4
  mulsd  %xmm0,%xmm8
  movapd %xmm2,%xmm13
  mulsd  %xmm0,%xmm13
  mulsd  -0x8(%rax),%xmm0
  mulsd  %xmm5,%xmm3
  addsd  %xmm15,%xmm9
  mulsd  %xmm5,%xmm2
  addsd  %xmm14,%xmm8
  addsd  %xmm10,%xmm13
  addsd  %xmm1,%xmm0
  movsd  -0x8(%rax),%xmm1
  addsd  %xmm11,%xmm3
  mulsd  %xmm5,%xmm1
  addsd  %xmm7,%xmm2
  addsd  %xmm6,%xmm1
  cmp    %rdx,%r8
  jne    L90
  add    %r12,%rcx
  lea    0x0(,%rbp,4),%r8d
L15:
  cmp    %r8d,%esi
  jle    L133
  lea    -0x1(%rsi),%eax
  sub    %r8d,%eax
  add    $0x1,%rax
  shl    $0x5,%rax
  add    %rdx,%rax
L110:
  movsd  (%rcx),%xmm12
  movsd  (%rdx),%xmm5
  add    $0x20,%rdx
  add    $0x20,%rcx
  movsd  -0x18(%rcx),%xmm11
  movsd  -0x10(%rcx),%xmm10
  movapd %xmm12,%xmm14
  movsd  -0x18(%rdx),%xmm7
  movsd  -0x8(%rcx),%xmm6
  mulsd  %xmm5,%xmm14
  mulsd  %xmm7,%xmm12
  addsd  %xmm14,%xmm9
  movapd %xmm11,%xmm14
  mulsd  %xmm5,%xmm14
  addsd  %xmm12,%xmm4
  mulsd  %xmm7,%xmm11
  addsd  %xmm14,%xmm8
  movapd %xmm10,%xmm14
  mulsd  %xmm5,%xmm14
  addsd  %xmm11,%xmm3
  mulsd  %xmm6,%xmm5
  mulsd  %xmm7,%xmm10
  mulsd  %xmm7,%xmm6
  addsd  %xmm14,%xmm13
  addsd  %xmm5,%xmm0
  addsd  %xmm10,%xmm2
  addsd  %xmm6,%xmm1
  cmp    %rax,%rdx
  jne    L110
L133:
  test   %ebx,%ebx
  je     L116
  mov    0x30(%rsp),%edx
  movsd  (%r9),%xmm10
  movsd  0x8(%r9),%xmm6
  movsd  0x20(%r9),%xmm5
  movsd  0x28(%r9),%xmm7
  test   %edx,%edx
  je     L3
  movq   %xmm5,%rax
  movsd  0x40(%r9),%xmm15
  movapd %xmm6,%xmm5
  movsd  0x48(%r9),%xmm12
  movsd  0x60(%r9),%xmm14
  movsd  0x68(%r9),%xmm11
  movq   %rax,%xmm6
  cmp    $0x1,%ebx
  je     L97
L141:
  subsd  %xmm9,%xmm10
  subsd  %xmm8,%xmm6
  subsd  %xmm13,%xmm15
  subsd  %xmm0,%xmm14
  subsd  %xmm4,%xmm5
  subsd  %xmm3,%xmm7
  subsd  %xmm2,%xmm12
  subsd  %xmm1,%xmm11
  movapd %xmm10,%xmm9
  movapd %xmm6,%xmm8
  movapd %xmm15,%xmm13
  movapd %xmm14,%xmm0
  movapd %xmm5,%xmm4
  movapd %xmm7,%xmm3
  movapd %xmm12,%xmm2
  movapd %xmm11,%xmm1
L116:
  mov    0x38(%rsp),%eax
  movsd  %xmm9,(%r11)
  test   %eax,%eax
  jne    L69
  movsd  %xmm8,0x8(%r11)
  movsd  %xmm13,0x10(%r11)
  cmp    $0x3,%edi
  jle    L138
  movsd  %xmm0,0x18(%r11)
  cmp    $0x1,%r10d
  jle    L91
  movsd  %xmm4,0x20(%r11)
  movsd  %xmm3,0x28(%r11)
  movsd  %xmm2,0x30(%r11)
  movsd  %xmm1,0x38(%r11)
L91:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L69:
  cmp    $0x1,%r10d
  jle    L56
  movsd  %xmm4,0x8(%r11)
  movsd  %xmm8,0x20(%r11)
  movsd  %xmm3,0x28(%r11)
  movsd  %xmm13,0x40(%r11)
  movsd  %xmm2,0x48(%r11)
  cmp    $0x3,%edi
  jle    L91
  movsd  %xmm0,0x60(%r11)
  movsd  %xmm1,0x68(%r11)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L138:
  cmp    $0x1,%r10d
  jle    L91
  movsd  %xmm4,0x20(%r11)
  movsd  %xmm3,0x28(%r11)
  movsd  %xmm2,0x30(%r11)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   (%rax)
L3:
  movsd  0x10(%r9),%xmm15
  movsd  0x18(%r9),%xmm14
  movsd  0x30(%r9),%xmm12
  movsd  0x38(%r9),%xmm11
  cmp    $0x1,%ebx
  jne    L141
L97:
  addsd  %xmm10,%xmm9
  addsd  %xmm6,%xmm8
  addsd  %xmm15,%xmm13
  addsd  %xmm14,%xmm0
  addsd  %xmm5,%xmm4
  addsd  %xmm7,%xmm3
  addsd  %xmm12,%xmm2
  addsd  %xmm11,%xmm1
  jmp    L116
  nopl   0x0(%rax)
L56:
  movsd  %xmm8,0x20(%r11)
  movsd  %xmm13,0x40(%r11)
  cmp    $0x3,%edi
  jle    L91
  movsd  %xmm0,0x60(%r11)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L6:
  pxor   %xmm1,%xmm1
  mov    %r8,%rdx
  xor    %r8d,%r8d
  movapd %xmm1,%xmm0
  movapd %xmm1,%xmm2
  movapd %xmm1,%xmm13
  movapd %xmm1,%xmm3
  movapd %xmm1,%xmm8
  movapd %xmm1,%xmm4
  movapd %xmm1,%xmm9
  jmp    L15
```

assistant: ```c
void kernel_dgemm_nt_4x2_vs_lib4(int km, int kn, int kmax, double *A, double *B, double *C, double *D, int alg, int tc, int td) {
  const int bs = 4;
  int k;
  double a_0, a_1, a_2, a_3, b_0, b_1, c_00 = 0, c_01 = 0, c_10 = 0, c_11 = 0, c_20 = 0, c_21 = 0, c_30 = 0, c_31 = 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[1 + bs * 0];
    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_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    c_21 += a_2 * b_1;
    c_31 += a_3 * b_1;
    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[0 + bs * 1];
    b_1 = B[1 + bs * 1];
    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_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    c_21 += a_2 * b_1;
    c_31 += a_3 * b_1;
    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[0 + bs * 2];
    b_1 = B[1 + bs * 2];
    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_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    c_21 += a_2 * b_1;
    c_31 += a_3 * b_1;
    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[0 + bs * 3];
    b_1 = 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_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    c_21 += a_2 * b_1;
    c_31 += a_3 * b_1;
    A += 16;
    B += 16;
  }
  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[1 + bs * 0];
    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_01 += a_0 * b_1;
    c_11 += a_1 * b_1;
    c_21 += a_2 * b_1;
    c_31 += a_3 * b_1;
    A += 4;
    B += 4;
  }
  double d_00, d_01, d_10, d_11, d_20, d_21, d_30, d_31;
  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_20 = C[2 + bs * 0];
      d_30 = C[3 + bs * 0];
      d_01 = C[0 + bs * 1];
      d_11 = C[1 + bs * 1];
      d_21 = C[2 + bs * 1];
      d_31 = C[3 + bs * 1];
    } else {
      d_00 = C[0 + bs * 0];
      d_01 = C[1 + bs * 0];
      d_10 = C[0 + bs * 1];
      d_11 = C[1 + bs * 1];
      d_20 = C[0 + bs * 2];
      d_21 = C[1 + bs * 2];
      d_30 = C[0 + bs * 3];
      d_31 = C[1 + bs * 3];
    }
    if (alg == 1) {
      c_00 = d_00 + c_00;
      c_10 = d_10 + c_10;
      c_20 = d_20 + c_20;
      c_30 = d_30 + c_30;
      c_01 = d_01 + c_01;
      c_11 = d_11 + c_11;
      c_21 = d_21 + c_21;
      c_31 = d_31 + c_31;
    } else {
      c_00 = d_00 - c_00;
      c_10 = d_10 - c_10;
      c_20 = d_20 - c_20;
      c_30 = d_30 - c_30;
      c_01 = d_01 - c_01;
      c_11 = d_11 - c_11;
      c_21 = d_21 - c_21;
      c_31 = d_31 - c_31;
    }
    if (td == 0) {
      goto store_n;
    } else {
      goto store_t;
    }
  }
store_n:
  if (km >= 4) {
    D[0 + bs * 0] = c_00;
    D[1 + bs * 0] = c_10;
    D[2 + bs * 0] = c_20;
    D[3 + bs * 0] = c_30;
    if (kn >= 2) {
      D[0 + bs * 1] = c_01;
      D[1 + bs * 1] = c_11;
      D[2 + bs * 1] = c_21;
      D[3 + bs * 1] = c_31;
    }
  } else {
    D[0 + bs * 0] = c_00;
    D[1 + bs * 0] = c_10;
    D[2 + bs * 0] = c_20;
    if (kn >= 2) {
      D[0 + bs * 1] = c_01;
      D[1 + bs * 1] = c_11;
      D[2 + bs * 1] = c_21;
    }
  }
  return;
store_t:
  if (kn >= 2) {
    D[0 + bs * 0] = c_00;
    D[1 + bs * 0] = c_01;
    D[0 + bs * 1] = c_10;
    D[1 + bs * 1] = c_11;
    D[0 + bs * 2] = c_20;
    D[1 + bs * 2] = c_21;
    if (km >= 4) {
      D[0 + bs * 3] = c_30;
      D[1 + bs * 3] = c_31;
    }
  } else {
    D[0 + bs * 0] = c_00;
    D[0 + bs * 1] = c_10;
    D[0 + bs * 2] = c_20;
    if (km >= 4) {
      D[0 + bs * 3] = c_30;
    }
  }
  return;
}
```