user: Converte this assembly snippet into its equivalent C code:

```asm
<kernel_dgemm_nt_4x2_vs_lib4>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%r10d
  mov    %esi,%r11d
  mov    %edx,%edi
  mov    %rcx,%rax
  mov    0x28(%rsp),%rbx
  mov    0x30(%rsp),%ebp
  cmp    $0x3,%edx
  jle    L184
  lea    -0x4(%rdx),%r13d
  shr    $0x2,%r13d
  lea    0x1(%r13),%r12d
  mov    %r12d,%r12d
  shl    $0x7,%r12
  lea    (%rcx,%r12,1),%rsi
  mov    %r8,%rdx
  mov    D19(%rip),%rcx
  movq   %rcx,%xmm0
  movq   %rcx,%xmm3
  movq   %rcx,%xmm10
  movq   %rcx,%xmm4
  movq   %rcx,%xmm11
  movq   %rcx,%xmm5
  movq   %rcx,%xmm12
L209:
  movsd  (%rax),%xmm9
  movsd  0x8(%rax),%xmm8
  movsd  0x10(%rax),%xmm7
  movsd  0x18(%rax),%xmm6
  movsd  (%rdx),%xmm1
  movsd  0x8(%rdx),%xmm2
  movapd %xmm9,%xmm15
  mulsd  %xmm1,%xmm15
  addsd  %xmm12,%xmm15
  movapd %xmm8,%xmm14
  mulsd  %xmm1,%xmm14
  addsd  %xmm11,%xmm14
  movapd %xmm7,%xmm13
  mulsd  %xmm1,%xmm13
  addsd  %xmm10,%xmm13
  mulsd  %xmm6,%xmm1
  addsd  %xmm0,%xmm1
  mulsd  %xmm2,%xmm9
  addsd  %xmm5,%xmm9
  mulsd  %xmm2,%xmm8
  addsd  %xmm4,%xmm8
  mulsd  %xmm2,%xmm7
  addsd  %xmm3,%xmm7
  mulsd  %xmm2,%xmm6
  movq   %rcx,%xmm3
  addsd  %xmm3,%xmm6
  movsd  0x20(%rax),%xmm5
  movsd  0x28(%rax),%xmm4
  movsd  0x30(%rax),%xmm3
  movsd  0x38(%rax),%xmm2
  movsd  0x20(%rdx),%xmm0
  movsd  0x28(%rdx),%xmm12
  movapd %xmm5,%xmm11
  mulsd  %xmm0,%xmm11
  addsd  %xmm15,%xmm11
  movapd %xmm4,%xmm10
  mulsd  %xmm0,%xmm10
  addsd  %xmm14,%xmm10
  movapd %xmm3,%xmm14
  mulsd  %xmm0,%xmm14
  addsd  %xmm13,%xmm14
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  mulsd  %xmm12,%xmm5
  addsd  %xmm9,%xmm5
  mulsd  %xmm12,%xmm4
  addsd  %xmm8,%xmm4
  mulsd  %xmm12,%xmm3
  addsd  %xmm7,%xmm3
  mulsd  %xmm12,%xmm2
  addsd  %xmm6,%xmm2
  movsd  0x40(%rax),%xmm9
  movsd  0x48(%rax),%xmm8
  movsd  0x50(%rax),%xmm7
  movsd  0x58(%rax),%xmm6
  movsd  0x40(%rdx),%xmm1
  movsd  0x48(%rdx),%xmm13
  movapd %xmm9,%xmm12
  mulsd  %xmm1,%xmm12
  addsd  %xmm11,%xmm12
  movapd %xmm8,%xmm11
  mulsd  %xmm1,%xmm11
  addsd  %xmm10,%xmm11
  movapd %xmm7,%xmm10
  mulsd  %xmm1,%xmm10
  addsd  %xmm14,%xmm10
  mulsd  %xmm6,%xmm1
  addsd  %xmm0,%xmm1
  mulsd  %xmm13,%xmm9
  addsd  %xmm5,%xmm9
  mulsd  %xmm13,%xmm8
  addsd  %xmm4,%xmm8
  mulsd  %xmm13,%xmm7
  addsd  %xmm3,%xmm7
  mulsd  %xmm13,%xmm6
  addsd  %xmm2,%xmm6
  movsd  0x60(%rax),%xmm5
  movsd  0x68(%rax),%xmm4
  movsd  0x70(%rax),%xmm3
  movsd  0x78(%rax),%xmm2
  movsd  0x60(%rdx),%xmm0
  movsd  0x68(%rdx),%xmm13
  movapd %xmm5,%xmm14
  mulsd  %xmm0,%xmm14
  addsd  %xmm14,%xmm12
  movapd %xmm4,%xmm14
  mulsd  %xmm0,%xmm14
  addsd  %xmm14,%xmm11
  movapd %xmm3,%xmm14
  mulsd  %xmm0,%xmm14
  addsd  %xmm14,%xmm10
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  mulsd  %xmm13,%xmm5
  addsd  %xmm9,%xmm5
  mulsd  %xmm13,%xmm4
  addsd  %xmm8,%xmm4
  mulsd  %xmm13,%xmm3
  addsd  %xmm7,%xmm3
  mulsd  %xmm13,%xmm2
  addsd  %xmm6,%xmm2
  movq   %xmm2,%rcx
  sub    $0xffffffffffffff80,%rax
  sub    $0xffffffffffffff80,%rdx
  cmp    %rsi,%rax
  jne    L209
  add    %r12,%r8
  lea    0x4(,%r13,4),%edx
L85:
  cmp    %edx,%edi
  jle    L6
  lea    -0x1(%rdi),%eax
  sub    %edx,%eax
  add    $0x1,%rax
  shl    $0x5,%rax
  add    %rsi,%rax
L175:
  movsd  (%rsi),%xmm9
  movsd  0x8(%rsi),%xmm8
  movsd  0x10(%rsi),%xmm7
  movsd  0x18(%rsi),%xmm2
  movsd  (%r8),%xmm1
  movsd  0x8(%r8),%xmm6
  movapd %xmm9,%xmm13
  mulsd  %xmm1,%xmm13
  addsd  %xmm13,%xmm12
  movapd %xmm8,%xmm13
  mulsd  %xmm1,%xmm13
  addsd  %xmm13,%xmm11
  movapd %xmm7,%xmm13
  mulsd  %xmm1,%xmm13
  addsd  %xmm13,%xmm10
  mulsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm0
  mulsd  %xmm6,%xmm9
  addsd  %xmm9,%xmm5
  mulsd  %xmm6,%xmm8
  addsd  %xmm8,%xmm4
  mulsd  %xmm6,%xmm7
  addsd  %xmm7,%xmm3
  mulsd  %xmm6,%xmm2
  movq   %rcx,%xmm6
  addsd  %xmm2,%xmm6
  movq   %xmm6,%rcx
  add    $0x20,%rsi
  add    $0x20,%r8
  cmp    %rax,%rsi
  jne    L175
L6:
  test   %ebp,%ebp
  jne    L79
  cmpl   $0x0,0x40(%rsp)
  je     L143
L203:
  cmp    $0x1,%r11d
  jle    L112
  movsd  %xmm12,(%rbx)
  movsd  %xmm5,0x8(%rbx)
  movsd  %xmm11,0x20(%rbx)
  movsd  %xmm4,0x28(%rbx)
  movsd  %xmm10,0x40(%rbx)
  movsd  %xmm3,0x48(%rbx)
  cmp    $0x3,%r10d
  jle    L10
  movsd  %xmm0,0x60(%rbx)
  mov    %rcx,0x68(%rbx)
  jmp    L10
L184:
  mov    %rcx,%rsi
  mov    D19(%rip),%rcx
  movq   %rcx,%xmm0
  movq   %rcx,%xmm3
  movq   %rcx,%xmm10
  movq   %rcx,%xmm4
  movq   %rcx,%xmm11
  movq   %rcx,%xmm5
  movq   %rcx,%xmm12
  mov    $0x0,%edx
  jmp    L85
L79:
  cmpl   $0x0,0x38(%rsp)
  jne    L29
  movsd  (%r9),%xmm14
  movsd  0x8(%r9),%xmm13
  movsd  0x10(%r9),%xmm9
  movsd  0x18(%r9),%xmm8
  movsd  0x20(%r9),%xmm7
  movsd  0x28(%r9),%xmm6
  movsd  0x30(%r9),%xmm2
  movsd  0x38(%r9),%xmm1
L165:
  cmp    $0x1,%ebp
  je     L124
  subsd  %xmm12,%xmm14
  movapd %xmm14,%xmm12
  subsd  %xmm11,%xmm13
  movapd %xmm13,%xmm11
  subsd  %xmm10,%xmm9
  movapd %xmm9,%xmm10
  subsd  %xmm0,%xmm8
  movapd %xmm8,%xmm0
  subsd  %xmm5,%xmm7
  movapd %xmm7,%xmm5
  subsd  %xmm4,%xmm6
  movapd %xmm6,%xmm4
  subsd  %xmm3,%xmm2
  movapd %xmm2,%xmm3
  movq   %rcx,%xmm7
  subsd  %xmm7,%xmm1
  movq   %xmm1,%rcx
L16:
  cmpl   $0x0,0x40(%rsp)
  jne    L203
L143:
  cmp    $0x3,%r10d
  jle    L45
  movsd  %xmm12,(%rbx)
  movsd  %xmm11,0x8(%rbx)
  movsd  %xmm10,0x10(%rbx)
  movsd  %xmm0,0x18(%rbx)
  cmp    $0x1,%r11d
  jle    L10
  movsd  %xmm5,0x20(%rbx)
  movsd  %xmm4,0x28(%rbx)
  movsd  %xmm3,0x30(%rbx)
  mov    %rcx,0x38(%rbx)
L10:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L29:
  movsd  (%r9),%xmm14
  movsd  0x8(%r9),%xmm7
  movsd  0x20(%r9),%xmm13
  movsd  0x28(%r9),%xmm6
  movsd  0x40(%r9),%xmm9
  movsd  0x48(%r9),%xmm2
  movsd  0x60(%r9),%xmm8
  movsd  0x68(%r9),%xmm1
  jmp    L165
L124:
  addsd  %xmm14,%xmm12
  addsd  %xmm13,%xmm11
  addsd  %xmm9,%xmm10
  addsd  %xmm8,%xmm0
  addsd  %xmm7,%xmm5
  addsd  %xmm6,%xmm4
  addsd  %xmm2,%xmm3
  movq   %rcx,%xmm7
  addsd  %xmm1,%xmm7
  movq   %xmm7,%rcx
  jmp    L16
L45:
  movsd  %xmm12,(%rbx)
  movsd  %xmm11,0x8(%rbx)
  movsd  %xmm10,0x10(%rbx)
  cmp    $0x1,%r11d
  jle    L10
  movsd  %xmm5,0x20(%rbx)
  movsd  %xmm4,0x28(%rbx)
  movsd  %xmm3,0x30(%rbx)
  jmp    L10
L112:
  movsd  %xmm12,(%rbx)
  movsd  %xmm11,0x20(%rbx)
  movsd  %xmm10,0x40(%rbx)
  cmp    $0x3,%r10d
  jle    L10
  movsd  %xmm0,0x60(%rbx)
  jmp    L10
```

tool_calls: name: extract_symbolic_data
arguments: label: D19
datatype: f64

tool: D19: 0

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;
}
```