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

```asm
<kernel_dgemm_nt_2x4_vs_lib4>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%r10d
  mov    %edx,%esi
  mov    %rcx,%rdx
  mov    0x20(%rsp),%r11
  mov    0x28(%rsp),%ebx
  cmp    $0x3,%esi
  jle    L159
  lea    -0x4(%rsi),%r12d
  shr    $0x2,%r12d
  lea    0x1(%r12),%ebp
  mov    %ebp,%ebp
  shl    $0x7,%rbp
  lea    (%rcx,%rbp,1),%rcx
  mov    %r8,%rax
  pxor   %xmm0,%xmm0
  movapd %xmm0,%xmm4
  movapd %xmm0,%xmm5
  movapd %xmm0,%xmm6
  movapd %xmm0,%xmm3
  movapd %xmm0,%xmm10
  movapd %xmm0,%xmm11
  movapd %xmm0,%xmm14
L81:
  movsd  (%rdx),%xmm1
  movsd  0x8(%rdx),%xmm2
  movsd  (%rax),%xmm9
  movsd  0x8(%rax),%xmm8
  movsd  0x10(%rax),%xmm7
  movsd  0x18(%rax),%xmm15
  movapd %xmm1,%xmm12
  mulsd  %xmm9,%xmm12
  addsd  %xmm12,%xmm14
  mulsd  %xmm2,%xmm9
  addsd  %xmm6,%xmm9
  movapd %xmm1,%xmm13
  mulsd  %xmm8,%xmm13
  addsd  %xmm11,%xmm13
  mulsd  %xmm2,%xmm8
  addsd  %xmm5,%xmm8
  movapd %xmm1,%xmm12
  mulsd  %xmm7,%xmm12
  addsd  %xmm10,%xmm12
  mulsd  %xmm2,%xmm7
  addsd  %xmm4,%xmm7
  mulsd  %xmm15,%xmm1
  addsd  %xmm3,%xmm1
  mulsd  %xmm15,%xmm2
  addsd  %xmm2,%xmm0
  movsd  0x20(%rdx),%xmm3
  movsd  0x28(%rdx),%xmm2
  movsd  0x20(%rax),%xmm5
  movsd  0x28(%rax),%xmm6
  movsd  0x30(%rax),%xmm4
  movsd  0x38(%rax),%xmm11
  movapd %xmm3,%xmm10
  mulsd  %xmm5,%xmm10
  addsd  %xmm14,%xmm10
  mulsd  %xmm2,%xmm5
  addsd  %xmm9,%xmm5
  movapd %xmm3,%xmm9
  mulsd  %xmm6,%xmm9
  addsd  %xmm13,%xmm9
  mulsd  %xmm2,%xmm6
  addsd  %xmm8,%xmm6
  movapd %xmm3,%xmm13
  mulsd  %xmm4,%xmm13
  addsd  %xmm12,%xmm13
  mulsd  %xmm2,%xmm4
  addsd  %xmm7,%xmm4
  mulsd  %xmm11,%xmm3
  addsd  %xmm3,%xmm1
  mulsd  %xmm11,%xmm2
  addsd  %xmm2,%xmm0
  movsd  0x40(%rdx),%xmm3
  movsd  0x48(%rdx),%xmm2
  movsd  0x40(%rax),%xmm12
  movsd  0x48(%rax),%xmm8
  movsd  0x50(%rax),%xmm7
  movsd  0x58(%rax),%xmm14
  movapd %xmm3,%xmm11
  mulsd  %xmm12,%xmm11
  addsd  %xmm10,%xmm11
  mulsd  %xmm2,%xmm12
  addsd  %xmm5,%xmm12
  movapd %xmm3,%xmm10
  mulsd  %xmm8,%xmm10
  addsd  %xmm9,%xmm10
  mulsd  %xmm2,%xmm8
  addsd  %xmm6,%xmm8
  movapd %xmm3,%xmm9
  mulsd  %xmm7,%xmm9
  addsd  %xmm13,%xmm9
  mulsd  %xmm2,%xmm7
  addsd  %xmm4,%xmm7
  mulsd  %xmm14,%xmm3
  addsd  %xmm1,%xmm3
  mulsd  %xmm14,%xmm2
  addsd  %xmm0,%xmm2
  movsd  0x60(%rdx),%xmm1
  movsd  0x68(%rdx),%xmm0
  movsd  0x60(%rax),%xmm6
  movsd  0x68(%rax),%xmm5
  movsd  0x70(%rax),%xmm4
  movsd  0x78(%rax),%xmm13
  movapd %xmm1,%xmm14
  mulsd  %xmm6,%xmm14
  addsd  %xmm11,%xmm14
  mulsd  %xmm0,%xmm6
  addsd  %xmm12,%xmm6
  movapd %xmm1,%xmm11
  mulsd  %xmm5,%xmm11
  addsd  %xmm10,%xmm11
  mulsd  %xmm0,%xmm5
  addsd  %xmm8,%xmm5
  movapd %xmm1,%xmm10
  mulsd  %xmm4,%xmm10
  addsd  %xmm9,%xmm10
  mulsd  %xmm0,%xmm4
  addsd  %xmm7,%xmm4
  mulsd  %xmm13,%xmm1
  addsd  %xmm1,%xmm3
  mulsd  %xmm13,%xmm0
  addsd  %xmm2,%xmm0
  sub    $0xffffffffffffff80,%rdx
  sub    $0xffffffffffffff80,%rax
  cmp    %rcx,%rdx
  jne    L81
  add    %rbp,%r8
  lea    0x4(,%r12,4),%edx
L49:
  cmp    %edx,%esi
  jle    L9
  lea    -0x1(%rsi),%eax
  sub    %edx,%eax
  add    $0x1,%rax
  shl    $0x5,%rax
  add    %rcx,%rax
L182:
  movsd  (%rcx),%xmm2
  movsd  0x8(%rcx),%xmm1
  movsd  (%r8),%xmm12
  movsd  0x8(%r8),%xmm8
  movsd  0x10(%r8),%xmm7
  movsd  0x18(%r8),%xmm9
  movapd %xmm2,%xmm13
  mulsd  %xmm12,%xmm13
  addsd  %xmm13,%xmm14
  mulsd  %xmm1,%xmm12
  addsd  %xmm12,%xmm6
  movapd %xmm2,%xmm12
  mulsd  %xmm8,%xmm12
  addsd  %xmm12,%xmm11
  mulsd  %xmm1,%xmm8
  addsd  %xmm8,%xmm5
  movapd %xmm2,%xmm8
  mulsd  %xmm7,%xmm8
  addsd  %xmm8,%xmm10
  mulsd  %xmm1,%xmm7
  addsd  %xmm7,%xmm4
  mulsd  %xmm9,%xmm2
  addsd  %xmm2,%xmm3
  mulsd  %xmm9,%xmm1
  addsd  %xmm1,%xmm0
  add    $0x20,%rcx
  add    $0x20,%r8
  cmp    %rax,%rcx
  jne    L182
L9:
  test   %ebx,%ebx
  jne    L173
  cmpl   $0x0,0x38(%rsp)
  je     L149
L84:
  cmp    $0x3,%r10d
  jle    L74
  movsd  %xmm14,(%r11)
  movsd  %xmm11,0x8(%r11)
  movsd  %xmm10,0x10(%r11)
  movsd  %xmm3,0x18(%r11)
  cmp    $0x1,%edi
  jle    L12
  movsd  %xmm6,0x20(%r11)
  movsd  %xmm5,0x28(%r11)
  movsd  %xmm4,0x30(%r11)
  movsd  %xmm0,0x38(%r11)
  jmp    L12
L159:
  pxor   %xmm0,%xmm0
  movapd %xmm0,%xmm4
  movapd %xmm0,%xmm5
  movapd %xmm0,%xmm6
  movapd %xmm0,%xmm3
  movapd %xmm0,%xmm10
  movapd %xmm0,%xmm11
  movapd %xmm0,%xmm14
  mov    $0x0,%edx
  jmp    L49
L173:
  cmpl   $0x0,0x30(%rsp)
  jne    L208
  movsd  (%r9),%xmm15
  movsd  0x8(%r9),%xmm13
  movsd  0x20(%r9),%xmm12
  movsd  0x28(%r9),%xmm9
  movsd  0x40(%r9),%xmm8
  movsd  0x48(%r9),%xmm7
  movsd  0x60(%r9),%xmm2
  movsd  0x68(%r9),%xmm1
L87:
  cmp    $0x1,%ebx
  je     L132
  subsd  %xmm14,%xmm15
  movapd %xmm15,%xmm14
  subsd  %xmm6,%xmm13
  movapd %xmm13,%xmm6
  subsd  %xmm11,%xmm12
  movapd %xmm12,%xmm11
  subsd  %xmm5,%xmm9
  movapd %xmm9,%xmm5
  subsd  %xmm10,%xmm8
  movapd %xmm8,%xmm10
  subsd  %xmm4,%xmm7
  movapd %xmm7,%xmm4
  subsd  %xmm3,%xmm2
  movapd %xmm2,%xmm3
  subsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
L189:
  cmpl   $0x0,0x38(%rsp)
  jne    L84
L149:
  cmp    $0x1,%edi
  jle    L186
  movsd  %xmm14,(%r11)
  movsd  %xmm6,0x8(%r11)
  movsd  %xmm11,0x20(%r11)
  movsd  %xmm5,0x28(%r11)
  movsd  %xmm10,0x40(%r11)
  movsd  %xmm4,0x48(%r11)
  cmp    $0x3,%r10d
  jle    L12
  movsd  %xmm3,0x60(%r11)
  movsd  %xmm0,0x68(%r11)
L12:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L208:
  movsd  (%r9),%xmm15
  movsd  0x8(%r9),%xmm12
  movsd  0x10(%r9),%xmm8
  movsd  0x18(%r9),%xmm2
  movsd  0x20(%r9),%xmm13
  movsd  0x28(%r9),%xmm9
  movsd  0x30(%r9),%xmm7
  movsd  0x38(%r9),%xmm1
  jmp    L87
L132:
  addsd  %xmm15,%xmm14
  addsd  %xmm13,%xmm6
  addsd  %xmm12,%xmm11
  addsd  %xmm9,%xmm5
  addsd  %xmm8,%xmm10
  addsd  %xmm7,%xmm4
  addsd  %xmm2,%xmm3
  addsd  %xmm1,%xmm0
  jmp    L189
L186:
  movsd  %xmm14,(%r11)
  movsd  %xmm11,0x20(%r11)
  movsd  %xmm10,0x40(%r11)
  cmp    $0x3,%r10d
  jle    L12
  movsd  %xmm3,0x60(%r11)
  jmp    L12
L74:
  movsd  %xmm14,(%r11)
  movsd  %xmm11,0x8(%r11)
  movsd  %xmm10,0x10(%r11)
  cmp    $0x1,%edi
  jle    L12
  movsd  %xmm6,0x20(%r11)
  movsd  %xmm5,0x28(%r11)
  movsd  %xmm4,0x30(%r11)
  jmp    L12
```

assistant: ```c
void kernel_dgemm_nt_2x4_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, 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[1 + bs * 0];
    b_2 = B[2 + bs * 0];
    b_3 = B[3 + bs * 0];
    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[0 + bs * 1];
    b_1 = B[1 + bs * 1];
    b_2 = B[2 + bs * 1];
    b_3 = B[3 + bs * 1];
    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[0 + bs * 2];
    b_1 = B[1 + bs * 2];
    b_2 = B[2 + bs * 2];
    b_3 = B[3 + bs * 2];
    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[0 + bs * 3];
    b_1 = B[1 + bs * 3];
    b_2 = B[2 + bs * 3];
    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 += 16;
  }
  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[1 + bs * 0];
    b_2 = B[2 + bs * 0];
    b_3 = B[3 + bs * 0];
    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 += 4;
  }
  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;
}
```