user: 请从给定的汇编指令推导出C源代码：

```asm
<kernel_dgemm_diag_left_2_lib4>:
  endbr64
  mov    %rdx,%r10
  mov    %rcx,%rax
  test   %edi,%edi
  jle    L114
  movsd  (%rsi),%xmm0
  movsd  0x8(%rsi),%xmm1
  lea    -0x3(%rdi),%edx
  cmp    $0xffffffff,%r9d
  je     L56
  test   %r9d,%r9d
  jne    L5
  test   %edx,%edx
  jle    L14
  lea    -0x4(%rdi),%r9d
  mov    %r10,%rax
  shr    $0x2,%r9d
  lea    0x1(%r9),%ecx
  mov    %rcx,%r9
  shl    $0x7,%rcx
  lea    (%r8,%rcx,1),%rdx
  nopl   0x0(%rax,%rax,1)
L92:
  movsd  0x8(%rax),%xmm2
  movsd  (%rax),%xmm3
  sub    $0xffffffffffffff80,%r8
  sub    $0xffffffffffffff80,%rax
  mulsd  %xmm1,%xmm2
  mulsd  %xmm0,%xmm3
  movsd  %xmm2,-0x78(%r8)
  movsd  %xmm3,-0x80(%r8)
  movsd  -0x58(%rax),%xmm2
  movsd  -0x60(%rax),%xmm3
  mulsd  %xmm1,%xmm2
  mulsd  %xmm0,%xmm3
  movsd  %xmm2,-0x58(%r8)
  movsd  %xmm3,-0x60(%r8)
  movsd  -0x38(%rax),%xmm2
  movsd  -0x40(%rax),%xmm3
  mulsd  %xmm1,%xmm2
  mulsd  %xmm0,%xmm3
  movsd  %xmm2,-0x38(%r8)
  movsd  %xmm3,-0x40(%r8)
  movsd  -0x18(%rax),%xmm2
  movsd  -0x20(%rax),%xmm3
  mulsd  %xmm1,%xmm2
  mulsd  %xmm0,%xmm3
  movsd  %xmm2,-0x18(%r8)
  movsd  %xmm3,-0x20(%r8)
  cmp    %rdx,%r8
  jne    L92
  shl    $0x2,%r9d
  add    %rcx,%r10
  cmp    %r9d,%edi
  jle    L39
L38:
  movsd  0x8(%r10),%xmm2
  add    $0x1,%r9d
  add    $0x20,%r10
  add    $0x20,%rdx
  movsd  -0x20(%r10),%xmm3
  mulsd  %xmm1,%xmm2
  mulsd  %xmm0,%xmm3
  movsd  %xmm2,-0x18(%rdx)
  movsd  %xmm3,-0x20(%rdx)
  cmp    %r9d,%edi
  jg     L38
  ret
L56:
  movq   D9(%rip),%xmm2
  xorpd  %xmm2,%xmm0
  xorpd  %xmm2,%xmm1
L5:
  mov    %rax,%r9
  xor    %esi,%esi
  test   %edx,%edx
  jle    L90
  lea    -0x4(%rdi),%esi
  mov    %r8,%rcx
  mov    %r10,%rdx
  shr    $0x2,%esi
  lea    0x1(%rsi),%r11d
  mov    %r11,%rsi
  shl    $0x7,%r11
  lea    (%rax,%r11,1),%r9
  nopl   0x0(%rax,%rax,1)
L68:
  movsd  (%rdx),%xmm3
  sub    $0xffffffffffffff80,%rax
  sub    $0xffffffffffffff80,%rdx
  sub    $0xffffffffffffff80,%rcx
  movsd  -0x78(%rdx),%xmm2
  mulsd  %xmm0,%xmm3
  mulsd  %xmm1,%xmm2
  addsd  -0x80(%rax),%xmm3
  addsd  -0x78(%rax),%xmm2
  movsd  %xmm3,-0x80(%rcx)
  movsd  %xmm2,-0x78(%rcx)
  movsd  -0x58(%rdx),%xmm2
  movsd  -0x60(%rdx),%xmm3
  mulsd  %xmm1,%xmm2
  mulsd  %xmm0,%xmm3
  addsd  -0x58(%rax),%xmm2
  addsd  -0x60(%rax),%xmm3
  movsd  %xmm2,-0x58(%rcx)
  movsd  %xmm3,-0x60(%rcx)
  movsd  -0x38(%rdx),%xmm2
  movsd  -0x40(%rdx),%xmm3
  mulsd  %xmm1,%xmm2
  mulsd  %xmm0,%xmm3
  addsd  -0x38(%rax),%xmm2
  addsd  -0x40(%rax),%xmm3
  movsd  %xmm2,-0x38(%rcx)
  movsd  %xmm3,-0x40(%rcx)
  movsd  -0x18(%rdx),%xmm2
  movsd  -0x20(%rdx),%xmm3
  mulsd  %xmm1,%xmm2
  mulsd  %xmm0,%xmm3
  addsd  -0x18(%rax),%xmm2
  addsd  -0x20(%rax),%xmm3
  movsd  %xmm2,-0x18(%rcx)
  movsd  %xmm3,-0x20(%rcx)
  cmp    %r9,%rax
  jne    L68
  shl    $0x2,%esi
  add    %r11,%r10
  add    %r11,%r8
  cmp    %esi,%edi
  jle    L114
L90:
  xor    %eax,%eax
L104:
  movsd  0x8(%r10,%rax,1),%xmm2
  movsd  (%r10,%rax,1),%xmm3
  add    $0x1,%esi
  mulsd  %xmm1,%xmm2
  mulsd  %xmm0,%xmm3
  addsd  0x8(%r9,%rax,1),%xmm2
  addsd  (%r9,%rax,1),%xmm3
  movsd  %xmm2,0x8(%r8,%rax,1)
  movsd  %xmm3,(%r8,%rax,1)
  add    $0x20,%rax
  cmp    %esi,%edi
  jg     L104
L114:
  ret
  cs nopw 0x0(%rax,%rax,1)
L39:
  ret
  nopl   0x0(%rax)
L14:
  mov    %r8,%rdx
  jmp    L38
```

tool_calls: name: unpack_data
arguments: data_label: D9
datatype: byte[8]

tool: {"D9": [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;
    }
  }
}
```