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

```asm
<kernel_dgemm_diag_left_2_lib4>:
  endbr64
  mov    %rdx,%rax
  mov    %rcx,%r10
  test   %edi,%edi
  jle    L63
  cmp    $0xffffffff,%r9d
  je     L94
  movsd  (%rsi),%xmm1
  movsd  0x8(%rsi),%xmm0
  test   %r9d,%r9d
  jne    L50
  cmp    $0x3,%edi
  jle    L27
  lea    -0x4(%rdi),%r9d
  shr    $0x2,%r9d
  lea    0x1(%r9),%esi
  mov    %esi,%esi
  shl    $0x7,%rsi
  lea    (%rdx,%rsi,1),%rcx
  mov    %r8,%rdx
L72:
  movapd %xmm0,%xmm2
  mulsd  0x8(%rax),%xmm2
  movapd %xmm1,%xmm3
  mulsd  (%rax),%xmm3
  movsd  %xmm3,(%rdx)
  movsd  %xmm2,0x8(%rdx)
  movapd %xmm0,%xmm2
  mulsd  0x28(%rax),%xmm2
  movapd %xmm1,%xmm3
  mulsd  0x20(%rax),%xmm3
  movsd  %xmm3,0x20(%rdx)
  movsd  %xmm2,0x28(%rdx)
  movapd %xmm0,%xmm2
  mulsd  0x48(%rax),%xmm2
  movapd %xmm1,%xmm3
  mulsd  0x40(%rax),%xmm3
  movsd  %xmm3,0x40(%rdx)
  movsd  %xmm2,0x48(%rdx)
  movapd %xmm0,%xmm2
  mulsd  0x68(%rax),%xmm2
  movapd %xmm1,%xmm3
  mulsd  0x60(%rax),%xmm3
  movsd  %xmm3,0x60(%rdx)
  movsd  %xmm2,0x68(%rdx)
  sub    $0xffffffffffffff80,%rax
  sub    $0xffffffffffffff80,%rdx
  cmp    %rcx,%rax
  jne    L72
  add    %rsi,%r8
  lea    0x4(,%r9,4),%r9d
  cmp    %r9d,%edi
  jle    L28
L76:
  movapd %xmm0,%xmm2
  mulsd  0x8(%rcx),%xmm2
  movapd %xmm1,%xmm3
  mulsd  (%rcx),%xmm3
  movsd  %xmm3,(%r8)
  movsd  %xmm2,0x8(%r8)
  add    $0x20,%rcx
  add    $0x20,%r8
  add    $0x1,%r9d
  cmp    %r9d,%edi
  jg     L76
  ret
L94:
  movsd  (%rsi),%xmm1
  movq   D6(%rip),%xmm2
  xorpd  %xmm2,%xmm1
  movsd  0x8(%rsi),%xmm0
  xorpd  %xmm2,%xmm0
L50:
  mov    %rax,%rsi
  mov    $0x0,%edx
  cmp    $0x3,%edi
  jle    L91
  lea    -0x4(%rdi),%r11d
  shr    $0x2,%r11d
  lea    0x1(%r11),%r9d
  mov    %r9d,%r9d
  shl    $0x7,%r9
  lea    (%rax,%r9,1),%rsi
  mov    %r8,%rcx
  mov    %r10,%rdx
L87:
  movapd %xmm0,%xmm2
  mulsd  0x8(%rax),%xmm2
  addsd  0x8(%rdx),%xmm2
  movapd %xmm1,%xmm3
  mulsd  (%rax),%xmm3
  addsd  (%rdx),%xmm3
  movsd  %xmm3,(%rcx)
  movsd  %xmm2,0x8(%rcx)
  movapd %xmm0,%xmm2
  mulsd  0x28(%rax),%xmm2
  addsd  0x28(%rdx),%xmm2
  movapd %xmm1,%xmm3
  mulsd  0x20(%rax),%xmm3
  addsd  0x20(%rdx),%xmm3
  movsd  %xmm3,0x20(%rcx)
  movsd  %xmm2,0x28(%rcx)
  movapd %xmm0,%xmm2
  mulsd  0x48(%rax),%xmm2
  addsd  0x48(%rdx),%xmm2
  movapd %xmm1,%xmm3
  mulsd  0x40(%rax),%xmm3
  addsd  0x40(%rdx),%xmm3
  movsd  %xmm3,0x40(%rcx)
  movsd  %xmm2,0x48(%rcx)
  movapd %xmm0,%xmm2
  mulsd  0x68(%rax),%xmm2
  addsd  0x68(%rdx),%xmm2
  movapd %xmm1,%xmm3
  mulsd  0x60(%rax),%xmm3
  addsd  0x60(%rdx),%xmm3
  movsd  %xmm3,0x60(%rcx)
  movsd  %xmm2,0x68(%rcx)
  sub    $0xffffffffffffff80,%rax
  sub    $0xffffffffffffff80,%rdx
  sub    $0xffffffffffffff80,%rcx
  cmp    %rsi,%rax
  jne    L87
  add    %r9,%r10
  add    %r9,%r8
  lea    0x4(,%r11,4),%edx
  cmp    %edx,%edi
  jle    L63
L91:
  mov    $0x0,%eax
L84:
  movapd %xmm0,%xmm2
  mulsd  0x8(%rsi,%rax,1),%xmm2
  addsd  0x8(%r10,%rax,1),%xmm2
  movapd %xmm1,%xmm3
  mulsd  (%rsi,%rax,1),%xmm3
  addsd  (%r10,%rax,1),%xmm3
  movsd  %xmm3,(%r8,%rax,1)
  movsd  %xmm2,0x8(%r8,%rax,1)
  add    $0x1,%edx
  add    $0x20,%rax
  cmp    %edx,%edi
  jg     L84
L63:
  ret
L28:
  ret
L27:
  mov    %rdx,%rcx
  jmp    L76
```

tool_calls: name: disassemble_data
arguments: label: D6
datatype: byte[8]

tool: {"D6": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

assistant: ```c
void kernel_dgemm_diag_left_2_lib4(int kmax, double *A, double *B, double *C, double *D, int alg) {
  if (kmax <= 0)
    return;
  const int bs = 4;
  int k;
  double a_0, a_1, b_0, b_1, c_0, c_1;
  if (alg == -1) {
    a_0 = -A[0];
    a_1 = -A[1];
  } else {
    a_0 = A[0];
    a_1 = A[1];
  }
  if (alg == 0) {
    for (k = 0; k < kmax - 3; k += 4) {
      b_0 = B[0 + bs * 0];
      b_1 = B[1 + bs * 0];
      c_0 = a_0 * b_0;
      c_1 = a_1 * b_1;
      D[0 + bs * 0] = c_0;
      D[1 + bs * 0] = c_1;
      b_0 = B[0 + bs * 1];
      b_1 = B[1 + bs * 1];
      c_0 = a_0 * b_0;
      c_1 = a_1 * b_1;
      D[0 + bs * 1] = c_0;
      D[1 + bs * 1] = c_1;
      b_0 = B[0 + bs * 2];
      b_1 = B[1 + bs * 2];
      c_0 = a_0 * b_0;
      c_1 = a_1 * b_1;
      D[0 + bs * 2] = c_0;
      D[1 + bs * 2] = c_1;
      b_0 = B[0 + bs * 3];
      b_1 = B[1 + bs * 3];
      c_0 = a_0 * b_0;
      c_1 = a_1 * b_1;
      D[0 + bs * 3] = c_0;
      D[1 + bs * 3] = c_1;
      B += 16;
      D += 16;
    }
    for (; k < kmax; k++) {
      b_0 = B[0 + bs * 0];
      b_1 = B[1 + bs * 0];
      c_0 = a_0 * b_0;
      c_1 = a_1 * b_1;
      D[0 + bs * 0] = c_0;
      D[1 + bs * 0] = c_1;
      B += 4;
      D += 4;
    }
  } else {
    for (k = 0; k < kmax - 3; k += 4) {
      b_0 = B[0 + bs * 0];
      b_1 = B[1 + bs * 0];
      c_0 = C[0 + bs * 0] + a_0 * b_0;
      c_1 = C[1 + bs * 0] + a_1 * b_1;
      D[0 + bs * 0] = c_0;
      D[1 + bs * 0] = c_1;
      b_0 = B[0 + bs * 1];
      b_1 = B[1 + bs * 1];
      c_0 = C[0 + bs * 1] + a_0 * b_0;
      c_1 = C[1 + bs * 1] + a_1 * b_1;
      D[0 + bs * 1] = c_0;
      D[1 + bs * 1] = c_1;
      b_0 = B[0 + bs * 2];
      b_1 = B[1 + bs * 2];
      c_0 = C[0 + bs * 2] + a_0 * b_0;
      c_1 = C[1 + bs * 2] + a_1 * b_1;
      D[0 + bs * 2] = c_0;
      D[1 + bs * 2] = c_1;
      b_0 = B[0 + bs * 3];
      b_1 = B[1 + bs * 3];
      c_0 = C[0 + bs * 3] + a_0 * b_0;
      c_1 = C[1 + bs * 3] + a_1 * b_1;
      D[0 + bs * 3] = c_0;
      D[1 + bs * 3] = c_1;
      B += 16;
      C += 16;
      D += 16;
    }
    for (; k < kmax; k++) {
      b_0 = B[0 + bs * 0];
      b_1 = B[1 + bs * 0];
      c_0 = C[0 + bs * 0] + a_0 * b_0;
      c_1 = C[1 + bs * 0] + a_1 * b_1;
      D[0 + bs * 0] = c_0;
      D[1 + bs * 0] = c_1;
      B += 4;
      C += 4;
      D += 4;
    }
  }
}
```