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

```asm
<kernel_dtrsm_nn_ll_diag_2x2_vs_lib4>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%r10d
  mov    %esi,%r11d
  mov    0x28(%rsp),%r12
  mov    0x30(%rsp),%rbx
  test   %edx,%edx
  jle    L107
  mov    %edx,%edi
  mov    %rcx,%rax
  cmp    $0x3,%edx
  jle    L11
  shl    $0x2,%r9d
  movslq %r9d,%rsi
  shl    $0x3,%rsi
  lea    -0x4(%rdx),%r9d
  shr    $0x2,%r9d
  lea    0x1(%r9),%ebp
  mov    %ebp,%ebp
  mov    %rbp,%rcx
  shl    $0x7,%rcx
  add    %rax,%rcx
  mov    %r8,%rdx
  pxor   %xmm0,%xmm0
  movapd %xmm0,%xmm2
  movapd %xmm0,%xmm1
  movapd %xmm0,%xmm6
L52:
  movsd  (%rax),%xmm4
  movsd  0x8(%rax),%xmm3
  movsd  (%rdx),%xmm5
  movsd  0x20(%rdx),%xmm7
  movapd %xmm4,%xmm8
  mulsd  %xmm5,%xmm8
  subsd  %xmm8,%xmm6
  mulsd  %xmm3,%xmm5
  subsd  %xmm5,%xmm2
  mulsd  %xmm7,%xmm4
  subsd  %xmm4,%xmm1
  mulsd  %xmm7,%xmm3
  subsd  %xmm3,%xmm0
  movsd  0x20(%rax),%xmm4
  movsd  0x28(%rax),%xmm3
  movsd  0x8(%rdx),%xmm5
  movsd  0x28(%rdx),%xmm7
  movapd %xmm4,%xmm8
  mulsd  %xmm5,%xmm8
  subsd  %xmm8,%xmm6
  mulsd  %xmm3,%xmm5
  subsd  %xmm5,%xmm2
  mulsd  %xmm7,%xmm4
  subsd  %xmm4,%xmm1
  mulsd  %xmm7,%xmm3
  subsd  %xmm3,%xmm0
  movsd  0x40(%rax),%xmm4
  movsd  0x48(%rax),%xmm3
  movsd  0x10(%rdx),%xmm5
  movsd  0x30(%rdx),%xmm7
  movapd %xmm4,%xmm8
  mulsd  %xmm5,%xmm8
  subsd  %xmm8,%xmm6
  mulsd  %xmm3,%xmm5
  subsd  %xmm5,%xmm2
  mulsd  %xmm7,%xmm4
  subsd  %xmm4,%xmm1
  mulsd  %xmm7,%xmm3
  subsd  %xmm3,%xmm0
  movsd  0x60(%rax),%xmm4
  movsd  0x68(%rax),%xmm3
  movsd  0x18(%rdx),%xmm5
  movsd  0x38(%rdx),%xmm7
  movapd %xmm4,%xmm8
  mulsd  %xmm5,%xmm8
  subsd  %xmm8,%xmm6
  mulsd  %xmm3,%xmm5
  subsd  %xmm5,%xmm2
  mulsd  %xmm7,%xmm4
  subsd  %xmm4,%xmm1
  mulsd  %xmm7,%xmm3
  subsd  %xmm3,%xmm0
  sub    $0xffffffffffffff80,%rax
  add    %rsi,%rdx
  cmp    %rcx,%rax
  jne    L52
  imul   %rbp,%rsi
  add    %rsi,%r8
  lea    0x4(,%r9,4),%eax
  cmp    %eax,%edi
  jle    L79
L0:
  movsd  (%rcx),%xmm4
  movsd  0x8(%rcx),%xmm3
  movsd  (%r8),%xmm5
  movsd  0x20(%r8),%xmm7
  movapd %xmm4,%xmm8
  mulsd  %xmm5,%xmm8
  subsd  %xmm8,%xmm6
  mulsd  %xmm3,%xmm5
  subsd  %xmm5,%xmm2
  mulsd  %xmm7,%xmm4
  subsd  %xmm4,%xmm1
  mulsd  %xmm7,%xmm3
  subsd  %xmm3,%xmm0
  add    $0x20,%rcx
  add    $0x8,%r8
  add    $0x1,%eax
  cmp    %eax,%edi
  jg     L0
L79:
  cmpl   $0x0,0x20(%rsp)
  je     L53
  addsd  (%r12),%xmm6
  addsd  0x8(%r12),%xmm2
  addsd  0x20(%r12),%xmm1
  addsd  0x28(%r12),%xmm0
L53:
  movsd  %xmm6,(%rbx)
  cmp    $0x1,%r11d
  jle    L110
  movsd  %xmm1,0x20(%rbx)
  cmp    $0x1,%r10d
  jle    L5
  mov    0x38(%rsp),%rax
  movsd  0x8(%rax),%xmm4
  mulsd  %xmm4,%xmm6
  subsd  %xmm6,%xmm2
  movsd  %xmm2,0x8(%rbx)
  mulsd  %xmm4,%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,0x28(%rbx)
L5:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L11:
  pxor   %xmm0,%xmm0
  movapd %xmm0,%xmm2
  movapd %xmm0,%xmm1
  movapd %xmm0,%xmm6
  mov    $0x0,%eax
  jmp    L0
L107:
  pxor   %xmm0,%xmm0
  movapd %xmm0,%xmm2
  movapd %xmm0,%xmm1
  movapd %xmm0,%xmm6
  jmp    L79
L110:
  cmp    $0x1,%r10d
  jle    L5
  mov    0x38(%rsp),%rax
  mulsd  0x8(%rax),%xmm6
  subsd  %xmm6,%xmm2
  movsd  %xmm2,0x8(%rbx)
  jmp    L5
```

assistant: ```c
void kernel_dtrsm_nn_ll_diag_2x2_vs_lib4(int km, int kn, int kmax, double *A, double *B, int sdb, int alg, double *C, double *D, double *E) {
  const int bs = 4;
  int k;
  double tmp, a_0, a_1, b_0, b_1, e_1, e_2, e_3, d_00 = 0, d_01 = 0, d_10 = 0, d_11 = 0;
  if (kmax <= 0)
    goto add;
  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[0 + bs * 1];
    d_00 -= a_0 * b_0;
    d_10 -= a_1 * b_0;
    d_01 -= a_0 * b_1;
    d_11 -= a_1 * b_1;
    a_0 = A[0 + bs * 1];
    a_1 = A[1 + bs * 1];
    b_0 = B[1 + bs * 0];
    b_1 = B[1 + bs * 1];
    d_00 -= a_0 * b_0;
    d_10 -= a_1 * b_0;
    d_01 -= a_0 * b_1;
    d_11 -= a_1 * b_1;
    a_0 = A[0 + bs * 2];
    a_1 = A[1 + bs * 2];
    b_0 = B[2 + bs * 0];
    b_1 = B[2 + bs * 1];
    d_00 -= a_0 * b_0;
    d_10 -= a_1 * b_0;
    d_01 -= a_0 * b_1;
    d_11 -= a_1 * b_1;
    a_0 = A[0 + bs * 3];
    a_1 = A[1 + bs * 3];
    b_0 = B[3 + bs * 0];
    b_1 = B[3 + bs * 1];
    d_00 -= a_0 * b_0;
    d_10 -= a_1 * b_0;
    d_01 -= a_0 * b_1;
    d_11 -= a_1 * b_1;
    A += 16;
    B += 4 * sdb;
  }
  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[0 + bs * 1];
    d_00 -= a_0 * b_0;
    d_10 -= a_1 * b_0;
    d_01 -= a_0 * b_1;
    d_11 -= a_1 * b_1;
    A += 4;
    B += 1;
  }
add:
  if (alg != 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[0 + bs * 0] = d_00;
  if (kn >= 2)
    D[0 + bs * 1] = d_01;
  if (km < 2)
    return;
  e_1 = E[1 + bs * 0];
  d_10 -= e_1 * d_00;
  d_11 -= e_1 * d_01;
  D[1 + bs * 0] = d_10;
  if (kn >= 2)
    D[1 + bs * 1] = d_11;
  return;
}
```