user: 请将以下的汇编代码转换成C语言代码:

```asm
<matmat>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  movslq %ecx,%rbx
  sub    $0x68,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %ebx,%edi
  imul   %ebx,%edi
  mov    %rdx,0x10(%rsp)
  mov    %rsi,0x8(%rsp)
  movsd  %xmm0,0x28(%rsp)
  movsd  %xmm1,0x20(%rsp)
  shl    $0x3,%edi
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  movb   $0x74,0x3e(%rsp)
  movb   $0x74,0x3f(%rsp)
  mov    %ebx,0x40(%rsp)
  mov    %ebx,0x44(%rsp)
  mov    %ebx,0x48(%rsp)
  mov    %ebx,0x4c(%rsp)
  mov    %ebx,0x50(%rsp)
  mov    %ebx,0x54(%rsp)
  call   <malloc@plt>
  test   %ebx,%ebx
  mov    0x10(%rsp),%rdx
  mov    0x18(%rsp),%r8
  mov    %rax,%r10
  jle    L92
  mov    %rbx,%r12
  mov    %rax,%r14
  mov    $0xfffffffffffffff8,%r15
  mov    %r10,%r9
  lea    -0x1(%r12),%eax
  shl    $0x3,%rbx
  xor    %ebp,%ebp
  shl    $0x3,%rax
  lea    0x8(%rdx,%rax,1),%r13
  sub    %rax,%r15
  mov    %r13,%rdi
  xchg   %ax,%ax
L88:
  lea    (%r15,%rdi,1),%rax
  mov    %r9,%rcx
  nopw   0x0(%rax,%rax,1)
L119:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,(%rcx)
  add    %rbx,%rcx
  cmp    %rdi,%rax
  jne    L119
  lea    0x1(%rbp),%ecx
  add    $0x8,%r9
  lea    (%rax,%rbx,1),%rdi
  cmp    %ecx,%r12d
  je     L134
  mov    %ecx,%ebp
  jmp    L88
  nopl   0x0(%rax,%rax,1)
L134:
  mov    %rdx,%r12
  mov    %r10,%r9
  xor    %r11d,%r11d
  sub    %r10,%r12
  nopl   0x0(%rax)
L74:
  mov    %r9,%rax
  xor    %ecx,%ecx
  nopl   (%rax)
L2:
  movsd  (%rax),%xmm0
  mov    %ecx,%edi
  add    $0x1,%ecx
  movsd  %xmm0,(%r12,%rax,1)
  add    %rbx,%rax
  cmp    %edi,%ebp
  jne    L2
  lea    0x1(%r11),%eax
  add    $0x8,%r9
  cmp    %r11d,%ebp
  je     L126
  mov    %eax,%r11d
  jmp    L74
L126:
  mov    %r10,0x10(%rsp)
  lea    0x44(%rsp),%rcx
  lea    0x40(%rsp),%r11
  lea    0x3f(%rsp),%rsi
  lea    0x3e(%rsp),%rdi
  sub    $0x8,%rsp
  lea    0x5c(%rsp),%r9
  push   %r9
  push   %rdx
  lea    0x38(%rsp),%rdx
  push   %rdx
  lea    0x70(%rsp),%rdx
  push   %rdx
  push   0x30(%rsp)
  lea    0x7c(%rsp),%rdx
  push   %rdx
  mov    %r11,%rdx
  push   %r8
  lea    0x68(%rsp),%r9
  lea    0x88(%rsp),%r8
  call   <dgemm_@plt>
  mov    0x50(%rsp),%r10
  add    $0x40,%rsp
  xor    %esi,%esi
  mov    %r10,%rcx
L111:
  lea    0x0(%r13,%r15,1),%rax
  mov    %rcx,%rdx
  nopl   0x0(%rax,%rax,1)
L135:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,(%rdx)
  add    %rbx,%rdx
  cmp    %rax,%r13
  jne    L135
  lea    0x1(%rsi),%eax
  add    $0x8,%rcx
  add    %rbx,%r13
  cmp    %esi,%ebp
  je     L6
  mov    %eax,%esi
  jmp    L111
  cs nopw 0x0(%rax,%rax,1)
L6:
  xor    %esi,%esi
  nopw   0x0(%rax,%rax,1)
L20:
  mov    %r14,%rax
  xor    %edx,%edx
  nopl   (%rax)
L25:
  movsd  (%rax),%xmm0
  mov    %edx,%ecx
  add    $0x1,%edx
  movsd  %xmm0,(%r12,%rax,1)
  add    %rbx,%rax
  cmp    %ecx,%ebp
  jne    L25
  lea    0x1(%rsi),%eax
  add    $0x8,%r14
  cmp    %esi,%ebp
  je     L38
  mov    %eax,%esi
  jmp    L20
L92:
  mov    %rax,0x10(%rsp)
  lea    0x3f(%rsp),%r11
  lea    0x44(%rsp),%rcx
  lea    0x40(%rsp),%r12
  lea    0x3e(%rsp),%rdi
  sub    $0x8,%rsp
  mov    %r11,%rsi
  lea    0x5c(%rsp),%rax
  push   %rax
  push   %rdx
  mov    %r12,%rdx
  lea    0x38(%rsp),%rax
  push   %rax
  lea    0x70(%rsp),%rax
  push   %rax
  push   0x30(%rsp)
  lea    0x7c(%rsp),%rax
  push   %rax
  push   %r8
  lea    0x68(%rsp),%r9
  lea    0x88(%rsp),%r8
  call   <dgemm_@plt>
  mov    0x50(%rsp),%r10
  add    $0x40,%rsp
  nopw   0x0(%rax,%rax,1)
L38:
  mov    %r10,%rdi
  call   <free@plt>
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L30
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L30:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void matmat(double *A, double *B, double *C, double alpha, double beta, int nA) {
  int i, j;
  char TRANSA = 't';
  char TRANSB = 't';
  int m = nA;
  int n = nA;
  int k = nA;
  int LDA = nA;
  int LDB = nA;
  int LDC = nA;
  double *work = (double *)malloc(sizeof(double) * nA * nA);
  for (i = 0; i < nA; i++) {
    for (j = 0; j < nA; j++)
      work[i + nA * j] = C[j + nA * i];
  }
  for (i = 0; i < nA; i++) {
    for (j = 0; j < nA; j++)
      C[i + nA * j] = work[i + nA * j];
  }
  dgemm_(&TRANSA, &TRANSB, &m, &n, &k, &alpha, A, &LDA, B, &LDB, &beta, C, &LDC);
  for (i = 0; i < nA; i++) {
    for (j = 0; j < nA; j++)
      work[i + nA * j] = C[j + nA * i];
  }
  for (i = 0; i < nA; i++) {
    for (j = 0; j < nA; j++)
      C[i + nA * j] = work[i + nA * j];
  }
  free(work);
  return;
}
```