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

```asm
<matinv>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x60,%rsp
  mov    %edi,-0x64(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %rdx,-0x78(%rbp)
  mov    -0x64(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,-0x58(%rbp)
  mov    -0x58(%rbp),%eax
  cltq
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x48(%rbp)
  cmpq   $0x0,-0x48(%rbp)
  jne    L384
  mov    $0x1,%eax
  jmp    L305
L384:
  mov    -0x58(%rbp),%eax
  cltq
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x40(%rbp)
  cmpq   $0x0,-0x40(%rbp)
  jne    L347
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x1,%eax
  jmp    L305
L347:
  mov    -0x64(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,-0x58(%rbp)
  mov    -0x58(%rbp),%eax
  cltq
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x38(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  jne    L41
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x1,%eax
  jmp    L305
L41:
  mov    -0x58(%rbp),%eax
  imul   -0x64(%rbp),%eax
  mov    %eax,-0x58(%rbp)
  mov    -0x58(%rbp),%eax
  cltq
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x30(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  jne    L254
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x1,%eax
  jmp    L305
L254:
  mov    $0x0,%ebx
  mov    $0x0,%r12d
  jmp    L25
L26:
  movslq %ebx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %ebx,(%rax)
  movslq %ebx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    $0x0,%r13d
  jmp    L273
L243:
  movslq %r12d,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D8(%rip),%xmm1
  andpd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movslq %ebx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x28(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L453
  movslq %ebx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L453:
  movslq %r12d,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rax,%rdx
  movslq %r12d,%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x1,%r13d
  add    $0x1,%r12d
L273:
  cmp    -0x64(%rbp),%r13d
  jl     L243
  movslq %ebx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jp     L106
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jne    L106
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x2,%eax
  jmp    L305
L106:
  add    $0x1,%ebx
L25:
  cmp    -0x64(%rbp),%ebx
  jl     L26
  mov    $0x0,%r12d
  jmp    L193
L120:
  mov    %r12d,%eax
  imul   -0x64(%rbp),%eax
  add    %r12d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D8(%rip),%xmm1
  andpd  %xmm1,%xmm0
  movslq %r12d,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  mov    %r12d,-0x5c(%rbp)
  lea    0x1(%r12),%ebx
  jmp    L237
L29:
  mov    %ebx,%eax
  imul   -0x64(%rbp),%eax
  lea    (%r12,%rax,1),%r14d
  movslq %r14d,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D8(%rip),%xmm1
  andpd  %xmm1,%xmm0
  movslq %ebx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x28(%rbp),%xmm0
  comisd -0x50(%rbp),%xmm0
  jbe    L63
  movsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  mov    %ebx,-0x5c(%rbp)
L63:
  add    $0x1,%ebx
L237:
  cmp    -0x64(%rbp),%ebx
  jl     L29
  cmp    %r12d,-0x5c(%rbp)
  jle    L109
  mov    $0x0,%r13d
  mov    -0x5c(%rbp),%eax
  imul   -0x64(%rbp),%eax
  mov    %eax,%r14d
  mov    %r12d,%ebx
  imul   -0x64(%rbp),%ebx
  jmp    L13
L100:
  movslq %r14d,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movslq %ebx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  movslq %r14d,%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  movslq %ebx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x1,%r13d
  add    $0x1,%r14d
  add    $0x1,%ebx
L13:
  cmp    -0x64(%rbp),%r13d
  jl     L100
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movslq %r12d,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  movslq %r12d,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x54(%rbp)
  movslq %r12d,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    -0x5c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x48(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  movslq %r12d,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x54(%rbp),%eax
  mov    %eax,(%rdx)
L109:
  lea    0x1(%r12),%ebx
  jmp    L86
L244:
  mov    %ebx,%eax
  imul   -0x64(%rbp),%eax
  lea    (%r12,%rax,1),%r14d
  movslq %r14d,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jp     L166
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  je     L160
L166:
  movslq %r14d,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    %r12d,%eax
  imul   -0x64(%rbp),%eax
  add    %r12d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movslq %r14d,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  lea    0x1(%r12),%r13d
  jmp    L218
L414:
  mov    %ebx,%eax
  imul   -0x64(%rbp),%eax
  add    %r13d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movslq %r14d,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    %r12d,%eax
  imul   -0x64(%rbp),%eax
  add    %r13d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  mov    %ebx,%eax
  imul   -0x64(%rbp),%eax
  add    %r13d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    $0x1,%r13d
L218:
  cmp    -0x64(%rbp),%r13d
  jl     L414
L160:
  add    $0x1,%ebx
L86:
  cmp    -0x64(%rbp),%ebx
  jl     L244
  add    $0x1,%r12d
L193:
  cmp    -0x64(%rbp),%r12d
  jl     L120
  mov    $0x0,%ebx
  jmp    L93
L328:
  movslq %ebx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    %ebx,(%rax)
  add    $0x1,%ebx
L93:
  cmp    -0x64(%rbp),%ebx
  jl     L328
  mov    $0x0,%ebx
  mov    $0x0,%r12d
  jmp    L344
L122:
  mov    $0x0,%r13d
  jmp    L306
L53:
  movslq %r12d,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  add    $0x1,%r13d
  add    $0x1,%r12d
L306:
  cmp    -0x64(%rbp),%r13d
  jl     L53
  add    $0x1,%ebx
L344:
  cmp    -0x64(%rbp),%ebx
  jl     L122
  mov    $0x0,%r12d
  jmp    L212
L208:
  movslq %r12d,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  imul   -0x64(%rbp),%eax
  add    %r12d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  D6(%rip),%xmm0
  movsd  %xmm0,(%rax)
  movslq %r12d,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%ebx
  jmp    L275
L141:
  movslq %r12d,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%r13d
  jmp    L46
L239:
  mov    %ebx,%eax
  imul   -0x64(%rbp),%eax
  add    %r12d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    %ebx,%eax
  imul   -0x64(%rbp),%eax
  add    %r13d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    %r13d,%eax
  imul   -0x64(%rbp),%eax
  add    %r12d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  mov    %ebx,%eax
  imul   -0x64(%rbp),%eax
  add    %r12d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    $0x1,%r13d
L46:
  cmp    %ebx,%r13d
  jl     L239
  add    $0x1,%ebx
L275:
  cmp    -0x64(%rbp),%ebx
  jl     L141
  mov    -0x64(%rbp),%eax
  lea    -0x1(%rax),%ebx
  jmp    L247
L72:
  lea    0x1(%rbx),%r13d
  jmp    L117
L309:
  mov    %ebx,%eax
  imul   -0x64(%rbp),%eax
  add    %r12d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    %ebx,%eax
  imul   -0x64(%rbp),%eax
  add    %r13d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    %r13d,%eax
  imul   -0x64(%rbp),%eax
  add    %r12d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  mov    %ebx,%eax
  imul   -0x64(%rbp),%eax
  add    %r12d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    $0x1,%r13d
L117:
  cmp    -0x64(%rbp),%r13d
  jl     L309
  mov    %ebx,%eax
  imul   -0x64(%rbp),%eax
  add    %r12d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    %ebx,%eax
  imul   -0x64(%rbp),%eax
  add    %ebx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    %ebx,%eax
  imul   -0x64(%rbp),%eax
  add    %r12d,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  sub    $0x1,%ebx
L247:
  test   %ebx,%ebx
  jns    L72
  add    $0x1,%r12d
L212:
  cmp    -0x64(%rbp),%r12d
  jl     L208
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
L305:
  add    $0x60,%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: data_label: D8
datatype: qword
name: read_data
arguments: data_label: D6
datatype: f64

tool: D8: 9223372036854775807

tool: D6: 1

assistant: ```c
int matinv(n, mat, inv) const int n;
const double mat[];
double inv[];
{
  register int i, ij, ik, j, k, kj, pj;
  int itemp, mem, *mxl, *lxm, pivot;
  double colmax, *lu, *rowmax, dtemp;
  mem = n * sizeof(int);
  if ((mxl = (int *)malloc(mem)) == (int *)0)
    return 1;
  if ((lxm = (int *)malloc(mem)) == (int *)0) {
    free(mxl);
    return 1;
  }
  mem = n * sizeof(double);
  if ((rowmax = (double *)malloc(mem)) == (double *)0) {
    free(mxl);
    free(lxm);
    return 1;
  }
  mem *= n;
  if ((lu = (double *)malloc(mem)) == (double *)0) {
    free(mxl);
    free(lxm);
    free(rowmax);
    return 1;
  }
  for (i = 0, ij = 0; i < n; i++) {
    mxl[i] = i;
    rowmax[i] = 0.0;
    for (j = 0; j < n; j++, ij++) {
      dtemp = fabs(mat[ij]);
      if (dtemp > rowmax[i])
        rowmax[i] = dtemp;
      lu[ij] = mat[ij];
    }
    if (rowmax[i] == 0.0) {
      free(mxl);
      free(lxm);
      free(rowmax);
      free(lu);
      return 2;
    }
  }
  for (k = 0; k < n; k++) {
    colmax = fabs(lu[k * n + k]) / rowmax[k];
    pivot = k;
    for (i = k + 1; i < n; i++) {
      ik = i * n + k;
      dtemp = fabs(lu[ik]) / rowmax[i];
      if (dtemp > colmax) {
        colmax = dtemp;
        pivot = i;
      }
    }
    if (pivot > k) {
      for (j = 0, pj = pivot * n, kj = k * n; j < n; j++, pj++, kj++) {
        dtemp = lu[pj];
        lu[pj] = lu[kj];
        lu[kj] = dtemp;
      }
      dtemp = rowmax[pivot];
      rowmax[pivot] = rowmax[k];
      rowmax[k] = dtemp;
      itemp = mxl[pivot];
      mxl[pivot] = mxl[k];
      mxl[k] = itemp;
    }
    for (i = k + 1; i < n; i++) {
      ik = i * n + k;
      if (lu[ik] != 0.0) {
        lu[ik] /= lu[k * n + k];
        for (j = k + 1; j < n; j++) {
          lu[i * n + j] -= lu[ik] * lu[k * n + j];
        }
      }
    }
  }
  for (i = 0; i < n; i++) {
    lxm[mxl[i]] = i;
  }
  for (i = 0, ij = 0; i < n; i++) {
    for (j = 0; j < n; j++, ij++) {
      inv[ij] = 0.0;
    }
  }
  for (k = 0; k < n; k++) {
    inv[lxm[k] * n + k] = 1.0;
    for (i = lxm[k] + 1; i < n; i++) {
      for (j = lxm[k]; j < i; j++) {
        inv[i * n + k] -= lu[i * n + j] * inv[j * n + k];
      }
    }
    for (i = n - 1; i >= 0; i--) {
      for (j = i + 1; j < n; j++) {
        inv[i * n + k] -= lu[i * n + j] * inv[j * n + k];
      }
      inv[i * n + k] /= lu[i * n + i];
    }
  }
  free(mxl);
  free(lxm);
  free(rowmax);
  free(lu);
  return 0;
}
```