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

```asm
<kernel_dgemm_dtrsm_nt_2x2_vs_lib4>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%r11d
  mov    %esi,%ebx
  mov    %edx,%edi
  mov    0x38(%rsp),%r10
  mov    0x40(%rsp),%rax
  mov    0x48(%rsp),%rdx
  mov    0x50(%rsp),%r15
  mov    0x58(%rsp),%rbp
  mov    0x60(%rsp),%r13
  test   %ecx,%ecx
  jle    L108
  mov    %ecx,%esi
  cmp    $0x1,%edi
  je     L147
  pxor   %xmm0,%xmm0
  movapd %xmm0,%xmm2
  movapd %xmm0,%xmm3
  movapd %xmm0,%xmm1
  mov    $0x0,%r14d
L170:
  lea    -0x3(%rsi),%ecx
  cmp    %ecx,%r14d
  jge    L35
  lea    -0x4(%rsi),%r12d
  sub    %r14d,%r12d
  shr    $0x2,%r12d
  lea    0x1(%r12),%ecx
  mov    %ecx,%ecx
  shl    $0x7,%rcx
  mov    %rcx,-0x8(%rsp)
  lea    (%r9,%rcx,1),%rdi
  mov    %r10,%rcx
L155:
  movsd  (%r9),%xmm5
  movsd  0x8(%r9),%xmm4
  movsd  (%rcx),%xmm6
  movsd  0x8(%rcx),%xmm7
  movapd %xmm5,%xmm8
  mulsd  %xmm6,%xmm8
  addsd  %xmm8,%xmm1
  mulsd  %xmm4,%xmm6
  addsd  %xmm6,%xmm2
  mulsd  %xmm7,%xmm5
  addsd  %xmm5,%xmm3
  mulsd  %xmm7,%xmm4
  addsd  %xmm4,%xmm0
  movsd  0x20(%r9),%xmm5
  movsd  0x28(%r9),%xmm4
  movsd  0x20(%rcx),%xmm6
  movsd  0x28(%rcx),%xmm7
  movapd %xmm5,%xmm8
  mulsd  %xmm6,%xmm8
  addsd  %xmm8,%xmm1
  mulsd  %xmm4,%xmm6
  addsd  %xmm6,%xmm2
  mulsd  %xmm7,%xmm5
  addsd  %xmm5,%xmm3
  mulsd  %xmm7,%xmm4
  addsd  %xmm4,%xmm0
  movsd  0x40(%r9),%xmm5
  movsd  0x48(%r9),%xmm4
  movsd  0x40(%rcx),%xmm6
  movsd  0x48(%rcx),%xmm8
  movapd %xmm5,%xmm7
  mulsd  %xmm6,%xmm7
  addsd  %xmm1,%xmm7
  mulsd  %xmm4,%xmm6
  addsd  %xmm2,%xmm6
  mulsd  %xmm8,%xmm5
  addsd  %xmm3,%xmm5
  mulsd  %xmm8,%xmm4
  addsd  %xmm0,%xmm4
  movsd  0x60(%r9),%xmm3
  movsd  0x68(%r9),%xmm0
  movsd  0x60(%rcx),%xmm2
  movsd  0x68(%rcx),%xmm8
  movapd %xmm3,%xmm1
  mulsd  %xmm2,%xmm1
  addsd  %xmm7,%xmm1
  mulsd  %xmm0,%xmm2
  addsd  %xmm6,%xmm2
  mulsd  %xmm8,%xmm3
  addsd  %xmm5,%xmm3
  mulsd  %xmm8,%xmm0
  addsd  %xmm4,%xmm0
  sub    $0xffffffffffffff80,%r9
  sub    $0xffffffffffffff80,%rcx
  cmp    %rdi,%r9
  jne    L155
  add    -0x8(%rsp),%r10
  lea    0x4(%r14,%r12,4),%r14d
L87:
  cmp    %r14d,%esi
  jle    L86
  sub    $0x1,%esi
  sub    %r14d,%esi
  add    $0x1,%rsi
  shl    $0x5,%rsi
  mov    $0x0,%ecx
L157:
  movsd  (%rdi,%rcx,1),%xmm5
  movsd  0x8(%rdi,%rcx,1),%xmm4
  movsd  (%r10,%rcx,1),%xmm6
  movsd  0x8(%r10,%rcx,1),%xmm7
  movapd %xmm5,%xmm8
  mulsd  %xmm6,%xmm8
  addsd  %xmm8,%xmm1
  mulsd  %xmm4,%xmm6
  addsd  %xmm6,%xmm2
  mulsd  %xmm7,%xmm5
  addsd  %xmm5,%xmm3
  mulsd  %xmm7,%xmm4
  addsd  %xmm4,%xmm0
  add    $0x20,%rcx
  cmp    %rsi,%rcx
  jne    L157
L86:
  cmp    $0x3,%r8d
  jle    L99
  lea    -0x4(%r8),%ecx
  shr    $0x2,%ecx
  add    $0x1,%ecx
  mov    %ecx,%ecx
  shl    $0x7,%rcx
  add    %rax,%rcx
L84:
  movsd  (%rax),%xmm5
  movsd  0x8(%rax),%xmm4
  movsd  (%rdx),%xmm6
  movsd  0x8(%rdx),%xmm7
  movapd %xmm5,%xmm8
  mulsd  %xmm6,%xmm8
  subsd  %xmm8,%xmm1
  mulsd  %xmm4,%xmm6
  subsd  %xmm6,%xmm2
  mulsd  %xmm7,%xmm5
  subsd  %xmm5,%xmm3
  mulsd  %xmm7,%xmm4
  subsd  %xmm4,%xmm0
  movsd  0x20(%rax),%xmm5
  movsd  0x28(%rax),%xmm4
  movsd  0x20(%rdx),%xmm6
  movsd  0x28(%rdx),%xmm7
  movapd %xmm5,%xmm8
  mulsd  %xmm6,%xmm8
  subsd  %xmm8,%xmm1
  mulsd  %xmm4,%xmm6
  subsd  %xmm6,%xmm2
  mulsd  %xmm7,%xmm5
  subsd  %xmm5,%xmm3
  mulsd  %xmm7,%xmm4
  subsd  %xmm4,%xmm0
  movsd  0x40(%rax),%xmm5
  movsd  0x48(%rax),%xmm4
  movsd  0x40(%rdx),%xmm6
  movsd  0x48(%rdx),%xmm7
  movapd %xmm5,%xmm8
  mulsd  %xmm6,%xmm8
  subsd  %xmm8,%xmm1
  mulsd  %xmm4,%xmm6
  subsd  %xmm6,%xmm2
  mulsd  %xmm7,%xmm5
  subsd  %xmm5,%xmm3
  mulsd  %xmm7,%xmm4
  subsd  %xmm4,%xmm0
  movsd  0x60(%rax),%xmm5
  movsd  0x68(%rax),%xmm4
  movsd  0x60(%rdx),%xmm6
  movsd  0x68(%rdx),%xmm7
  movapd %xmm5,%xmm8
  mulsd  %xmm6,%xmm8
  subsd  %xmm8,%xmm1
  mulsd  %xmm4,%xmm6
  subsd  %xmm6,%xmm2
  mulsd  %xmm7,%xmm5
  subsd  %xmm5,%xmm3
  mulsd  %xmm7,%xmm4
  subsd  %xmm4,%xmm0
  sub    $0xffffffffffffff80,%rax
  sub    $0xffffffffffffff80,%rdx
  cmp    %rcx,%rax
  jne    L84
L99:
  cmpl   $0x0,0x68(%rsp)
  je     L12
  addsd  (%r15),%xmm1
  addsd  0x8(%r15),%xmm2
  addsd  0x20(%r15),%xmm3
  addsd  0x28(%r15),%xmm0
L12:
  movsd  0x0(%r13),%xmm4
  mulsd  %xmm4,%xmm1
  mulsd  %xmm4,%xmm2
  movsd  %xmm1,0x0(%rbp)
  cmp    $0x1,%r11d
  jle    L79
  movsd  %xmm2,0x8(%rbp)
  cmp    $0x1,%ebx
  je     L68
  movsd  0x8(%r13),%xmm5
  movsd  0x10(%r13),%xmm4
  mulsd  %xmm5,%xmm1
  subsd  %xmm1,%xmm3
  mulsd  %xmm5,%xmm2
  subsd  %xmm2,%xmm0
  mulsd  %xmm4,%xmm3
  movsd  %xmm3,0x20(%rbp)
  mulsd  %xmm4,%xmm0
  movsd  %xmm0,0x28(%rbp)
L68:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L147:
  cmp    $0x1,%ecx
  jle    L30
  movsd  (%r9),%xmm0
  movapd %xmm0,%xmm6
  mulsd  (%r10),%xmm6
  pxor   %xmm4,%xmm4
  addsd  %xmm4,%xmm6
  mulsd  0x8(%r10),%xmm0
  addsd  %xmm4,%xmm0
  movsd  0x20(%r9),%xmm3
  movsd  0x28(%r9),%xmm5
  movsd  0x20(%r10),%xmm2
  movsd  0x28(%r10),%xmm7
  movapd %xmm3,%xmm1
  mulsd  %xmm2,%xmm1
  addsd  %xmm6,%xmm1
  mulsd  %xmm5,%xmm2
  addsd  %xmm4,%xmm2
  mulsd  %xmm7,%xmm3
  addsd  %xmm0,%xmm3
  movapd %xmm5,%xmm0
  mulsd  %xmm7,%xmm0
  addsd  %xmm4,%xmm0
  add    $0x40,%r9
  add    $0x40,%r10
  mov    $0x2,%r14d
  jmp    L170
L30:
  movsd  (%r9),%xmm3
  movapd %xmm3,%xmm1
  mulsd  (%r10),%xmm1
  pxor   %xmm2,%xmm2
  addsd  %xmm2,%xmm1
  mulsd  0x8(%r10),%xmm3
  addsd  %xmm2,%xmm3
  movapd %xmm2,%xmm0
  jmp    L86
L35:
  mov    %r9,%rdi
  jmp    L87
L108:
  pxor   %xmm0,%xmm0
  movapd %xmm0,%xmm2
  movapd %xmm0,%xmm3
  movapd %xmm0,%xmm1
  jmp    L86
L79:
  cmp    $0x1,%ebx
  je     L68
  mulsd  0x8(%r13),%xmm1
  subsd  %xmm1,%xmm3
  mulsd  0x10(%r13),%xmm3
  movsd  %xmm3,0x20(%rbp)
  jmp    L68
```

assistant: ```c
void kernel_dgemm_dtrsm_nt_2x2_vs_lib4(int km, int kn, int tri, int kadd, int ksub, double *Ap, double *Bp, double *Am, double *Bm, double *C, double *D, double *fact, int alg) {
  const int bs = 4;
  int k;
  double a_0, a_1, b_0, b_1, c_00 = 0, c_01 = 0, c_10 = 0, c_11 = 0;
  k = 0;
  if (kadd > 0) {
    if (tri == 1) {
      if (kadd >= 2) {
        a_0 = Ap[0 + bs * 0];
        b_0 = Bp[0 + bs * 0];
        b_1 = Bp[1 + bs * 0];
        c_00 += a_0 * b_0;
        c_01 += a_0 * b_1;
        a_0 = Ap[0 + bs * 1];
        a_1 = Ap[1 + bs * 1];
        b_0 = Bp[0 + bs * 1];
        b_1 = Bp[1 + 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;
        Ap += 8;
        Bp += 8;
        k += 2;
      } else {
        a_0 = Ap[0 + bs * 0];
        b_0 = Bp[0 + bs * 0];
        b_1 = Bp[1 + bs * 0];
        c_00 += a_0 * b_0;
        c_01 += a_0 * b_1;
        k += 1;
      }
    }
    for (; k < kadd - 3; k += 4) {
      a_0 = Ap[0 + bs * 0];
      a_1 = Ap[1 + bs * 0];
      b_0 = Bp[0 + bs * 0];
      b_1 = Bp[1 + 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;
      a_0 = Ap[0 + bs * 1];
      a_1 = Ap[1 + bs * 1];
      b_0 = Bp[0 + bs * 1];
      b_1 = Bp[1 + 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;
      a_0 = Ap[0 + bs * 2];
      a_1 = Ap[1 + bs * 2];
      b_0 = Bp[0 + bs * 2];
      b_1 = Bp[1 + 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;
      a_0 = Ap[0 + bs * 3];
      a_1 = Ap[1 + bs * 3];
      b_0 = Bp[0 + bs * 3];
      b_1 = Bp[1 + 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;
      Ap += 16;
      Bp += 16;
    }
    for (; k < kadd; k++) {
      a_0 = Ap[0 + bs * 0];
      a_1 = Ap[1 + bs * 0];
      b_0 = Bp[0 + bs * 0];
      b_1 = Bp[1 + 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;
      Ap += 4;
      Bp += 4;
    }
  }
  for (k = 0; k < ksub - 3; k += 4) {
    a_0 = Am[0 + bs * 0];
    a_1 = Am[1 + bs * 0];
    b_0 = Bm[0 + bs * 0];
    b_1 = Bm[1 + 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;
    a_0 = Am[0 + bs * 1];
    a_1 = Am[1 + bs * 1];
    b_0 = Bm[0 + bs * 1];
    b_1 = Bm[1 + 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;
    a_0 = Am[0 + bs * 2];
    a_1 = Am[1 + bs * 2];
    b_0 = Bm[0 + bs * 2];
    b_1 = Bm[1 + 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;
    a_0 = Am[0 + bs * 3];
    a_1 = Am[1 + bs * 3];
    b_0 = Bm[0 + bs * 3];
    b_1 = Bm[1 + 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;
    Am += 16;
    Bm += 16;
  }
  if (alg != 0) {
    c_00 += C[0 + bs * 0];
    c_10 += C[1 + bs * 0];
    c_01 += C[0 + bs * 1];
    c_11 += C[1 + bs * 1];
  }
  double a_00, a_10, a_11;
  a_00 = fact[0];
  c_00 *= a_00;
  c_10 *= a_00;
  D[0 + bs * 0] = c_00;
  if (km >= 2)
    D[1 + bs * 0] = c_10;
  if (kn == 1)
    return;
  a_10 = fact[1];
  a_11 = fact[2];
  c_01 -= c_00 * a_10;
  c_11 -= c_10 * a_10;
  c_01 *= a_11;
  c_11 *= a_11;
  D[0 + bs * 1] = c_01;
  if (km >= 2)
    D[1 + bs * 1] = c_11;
}
```