user: What is the c source code of the assembly code below:

```asm
<matinv>:
  endbr64
  push   %r15
  movslq %edi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    0x0(,%r15,4),%ebp
  push   %rbx
  movslq %ebp,%rbp
  mov    %rsi,%rbx
  mov    %rbp,%rdi
  sub    $0xd8,%rsp
  mov    %rdx,0xb0(%rsp)
  call   <malloc@plt>
  mov    %rax,0x90(%rsp)
  test   %rax,%rax
  je     L503
  mov    %rbp,%rdi
  call   <malloc@plt>
  mov    %rax,0x60(%rsp)
  test   %rax,%rax
  je     L345
  lea    0x0(,%r15,8),%ebp
  mov    %r15,%r12
  movslq %ebp,%rdi
  call   <malloc@plt>
  mov    %rax,0x48(%rsp)
  test   %rax,%rax
  je     L237
  imul   %r15d,%ebp
  movslq %ebp,%rdi
  call   <malloc@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L264
  test   %r15d,%r15d
  jle    L505
  lea    -0x1(%r15),%eax
  mov    %r15d,%r8d
  mov    0x48(%rsp),%rdi
  xor    %ecx,%ecx
  mov    %eax,0x40(%rsp)
  xor    %esi,%esi
  pxor   %xmm4,%xmm4
  movq   D16(%rip),%xmm3
  mov    %rax,0x78(%rsp)
  mov    0x90(%rsp),%r9
  mov    %r8,0x68(%rsp)
  nopl   0x0(%rax)
L311:
  movslq %esi,%rdx
  mov    %ecx,(%r9,%rcx,4)
  movapd %xmm4,%xmm2
  movq   $0x0,(%rdi,%rcx,8)
  lea    0x0(,%rdx,8),%rax
  add    %r8,%rdx
  shl    $0x3,%rdx
  nopw   0x0(%rax,%rax,1)
L448:
  movsd  (%rbx,%rax,1),%xmm1
  movapd %xmm1,%xmm0
  andpd  %xmm3,%xmm0
  comisd %xmm2,%xmm0
  jbe    L348
  movsd  %xmm1,(%r14,%rax,1)
  add    $0x8,%rax
  movapd %xmm0,%xmm2
  movsd  %xmm0,(%rdi,%rcx,8)
  cmp    %rdx,%rax
  jne    L448
L219:
  add    %r12d,%esi
  ucomisd %xmm4,%xmm2
  jp     L396
  je     L430
L396:
  add    $0x1,%rcx
  cmp    %r8,%rcx
  jne    L311
  lea    0x1(%r12),%eax
  lea    0x8(%r14),%rdi
  xor    %ecx,%ecx
  xor    %ebp,%ebp
  mov    %eax,0xb8(%rsp)
  lea    -0x3(%r12),%eax
  lea    0x0(,%r15,8),%r13
  mov    %eax,0x58(%rsp)
  lea    -0x2(%r12),%eax
  mov    %eax,0x30(%rsp)
  lea    0x8(,%r15,8),%rax
  mov    %rax,0x98(%rsp)
  lea    0x10(%r14),%rax
  mov    %rax,0x38(%rsp)
  mov    %rax,%rbx
  mov    %r12d,%eax
  shr    %eax
  movl   $0x2,(%rsp)
  sub    $0x1,%eax
  movl   $0x1,0x50(%rsp)
  add    $0x1,%rax
  mov    %rdi,0xc8(%rsp)
  movq   $0x0,0x70(%rsp)
  shl    $0x4,%rax
  mov    %rax,0xc0(%rsp)
  mov    %r12d,%eax
  and    $0xfffffffe,%eax
  mov    %eax,0xbc(%rsp)
  mov    %r13,%rax
  sub    %r14,%rax
  mov    %rax,0xa0(%rsp)
  mov    $0x8,%eax
  sub    %r14,%rax
  mov    %rax,0xa8(%rsp)
  mov    %ecx,%eax
  cs nopw 0x0(%rax,%rax,1)
L294:
  mov    0x48(%rsp),%r9
  movsd  -0x10(%rbx),%xmm1
  lea    0x1(%rbp),%edi
  mov    %ebp,%r8d
  mov    %ebp,0x34(%rsp)
  mov    %edi,%esi
  movsd  (%r9,%rbp,8),%xmm2
  andpd  %xmm3,%xmm1
  mov    %edi,0x8(%rsp)
  divsd  %xmm2,%xmm1
  cmp    %edi,%r12d
  jle    L272
  lea    (%rax,%r12,1),%edx
  lea    0x1(%rbp),%rcx
  movslq %edx,%rdx
  add    %rbp,%rdx
  lea    (%r14,%rdx,8),%rdi
  nop
L458:
  movsd  (%rdi),%xmm0
  mov    %r8d,%edx
  andpd  %xmm3,%xmm0
  divsd  (%r9,%rcx,8),%xmm0
  comisd %xmm1,%xmm0
  maxsd  %xmm1,%xmm0
  cmova  %ecx,%edx
  add    $0x1,%rcx
  movapd %xmm0,%xmm1
  add    %r13,%rdi
  mov    %edx,%r8d
  cmp    %ecx,%r12d
  jg     L458
  cmp    %ebp,%edx
  jg     L134
L272:
  cmp    0x78(%rsp),%rbp
  je     L305
L395:
  movslq 0x50(%rsp),%rcx
  movslq (%rsp),%r8
  lea    (%rax,%r12,1),%edi
  mov    0xa0(%rsp),%rdx
  mov    %edi,0x20(%rsp)
  mov    %r15,%rdi
  lea    (%r14,%rcx,8),%r11
  mov    0x30(%rsp),%ecx
  add    %r15,0x70(%rsp)
  neg    %rdi
  mov    %r11,0x10(%rsp)
  add    %rbx,%rdx
  mov    %rcx,%r11
  lea    0x0(,%rcx,8),%r10
  shr    %ecx
  and    $0xfffffffe,%r11d
  mov    %r10,0x18(%rsp)
  lea    -0x1(%rcx),%r9d
  mov    0x20(%rsp),%ecx
  mov    %r11d,%r10d
  mov    %r11d,0x44(%rsp)
  add    $0x1,%r9
  add    %r8d,%r10d
  sub    %rbp,%r8
  shl    $0x4,%r9
  add    %r10d,%eax
  lea    -0x10(%r14,%r8,8),%r8
  cltq
  mov    %r8,0x80(%rsp)
  lea    (%r14,%rax,8),%r11
  mov    0x58(%rsp),%eax
  lea    0x8(%r14,%rax,8),%rax
  mov    %rax,0x88(%rsp)
  mov    0xa8(%rsp),%rax
  add    %rbx,%rax
  mov    %rax,0x28(%rsp)
  mov    %r12d,%eax
  sub    0x34(%rsp),%eax
  mov    %eax,0x34(%rsp)
  jmp    L154
  xchg   %ax,%ax
L163:
  add    $0x1,%esi
  add    %r12d,%ecx
  sub    %r15,%rdi
  add    %r13,%rdx
  cmp    %esi,%r12d
  je     L70
L154:
  movsd  -0x10(%r14,%rdx,1),%xmm0
  ucomisd %xmm4,%xmm0
  jp     L442
  je     L163
L442:
  mov    0x8(%rsp),%eax
  mov    0x10(%rsp),%r8
  divsd  -0x10(%rbx),%xmm0
  movsd  %xmm0,-0x10(%r14,%rdx,1)
  mulsd  (%r8),%xmm0
  add    %ecx,%eax
  cltq
  lea    (%r14,%rax,8),%rax
  movsd  (%rax),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
  cmp    %r12d,(%rsp)
  jge    L163
  mov    0x18(%rsp),%rax
  lea    -0x10(%rdx),%r8
  add    %rdx,%rax
  cmp    %rax,%r8
  lea    -0x8(%rdx),%rax
  setge  %r8b
  cmp    %rax,%rdx
  setge  %al
  or     %r8b,%al
  je     L28
  cmp    %rdx,0x28(%rsp)
  setne  %r8b
  cmpl   $0x3,0x34(%rsp)
  setne  %al
  test   %al,%r8b
  je     L28
  movsd  -0x10(%r14,%rdx,1),%xmm2
  lea    (%r14,%rdx,1),%r8
  xor    %eax,%eax
  unpcklpd %xmm2,%xmm2
  nopl   0x0(%rax)
L87:
  movupd (%rbx,%rax,1),%xmm1
  movupd (%r8,%rax,1),%xmm0
  mulpd  %xmm2,%xmm1
  subpd  %xmm1,%xmm0
  movups %xmm0,(%r8,%rax,1)
  add    $0x10,%rax
  cmp    %r9,%rax
  jne    L87
  mov    0x30(%rsp),%r8d
  cmp    %r8d,0x44(%rsp)
  je     L163
  movsd  (%r11),%xmm1
  lea    (%rcx,%r10,1),%eax
  mulsd  -0x10(%r14,%rdx,1),%xmm1
  cltq
  lea    (%r14,%rax,8),%rax
  movsd  (%rax),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L163
  nopl   0x0(%rax,%rax,1)
L348:
  movsd  %xmm1,(%r14,%rax,1)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L448
  jmp    L219
  nopl   0x0(%rax,%rax,1)
L75:
  mov    0x70(%rsp),%rbx
  mov    0x44(%rsp),%r11d
  mov    %r12d,%edi
  mov    0x58(%rsp),%r8
  mov    0x78(%rsp),%r10d
  mov    0x50(%rsp),%r9
  nopl   0x0(%rax)
L54:
  cmp    0x30(%rsp),%edi
  jge    L11
  mov    0x34(%rsp),%eax
  mov    0x28(%rsp),%rsi
  movslq %r11d,%rdx
  add    %r15,%rdx
  add    %r10d,%eax
  lea    (%r14,%rdx,8),%rdx
  cltq
  lea    (%r14,%rax,8),%rcx
  movslq %edi,%rax
  add    %r8,%rax
  movsd  (%rcx),%xmm1
  lea    (%rsi,%rax,8),%rax
  mov    0x40(%rsp),%esi
  mov    %rax,(%rsp)
  mov    0x38(%rsp),%rax
  sub    %edi,%esi
  add    %rbx,%rsi
  lea    (%rax,%rsi,8),%rsi
  mov    (%rsp),%rax
  nopw   0x0(%rax,%rax,1)
L197:
  movsd  (%rax),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %r13,%rdx
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rcx)
  cmp    %rsi,%rax
  jne    L197
L11:
  movsd  0x0(%rbp,%r8,8),%xmm0
  add    0x10(%rsp),%r10d
  divsd  (%r9),%xmm0
  sub    %r12d,%r11d
  movsd  %xmm0,0x0(%rbp,%r8,8)
  add    0x8(%rsp),%r9
  add    0x18(%rsp),%r8
  add    0x20(%rsp),%rbx
  sub    $0x1,%edi
  jne    L54
  add    $0x1,%r15
  add    $0x8,%rbp
  cmp    0x68(%rsp),%r15
  jne    L328
  mov    0x28(%rsp),%r14
L505:
  mov    0x90(%rsp),%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  call   <free@plt>
  mov    0x48(%rsp),%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  xor    %eax,%eax
L211:
  add    $0xd8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L70:
  mov    0xb8(%rsp),%edi
  addl   $0x1,(%rsp)
  add    $0x1,%rbp
  add    %edi,0x50(%rsp)
  mov    0x20(%rsp),%eax
  subl   $0x1,0x58(%rsp)
  add    0x98(%rsp),%rbx
  subl   $0x1,0x30(%rsp)
  jmp    L294
L28:
  mov    0x80(%rsp),%rax
  mov    0x88(%rsp),%r8
  add    %rdx,%rax
  add    %rdx,%r8
  nopl   0x0(%rax)
L177:
  movsd  (%rax,%rdi,8),%xmm1
  mulsd  -0x10(%r14,%rdx,1),%xmm1
  add    $0x8,%rax
  movsd  -0x8(%rax),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %r8,%rax
  jne    L177
  jmp    L163
L134:
  mov    %edx,%r11d
  mov    0x70(%rsp),%rdi
  imul   %r12d,%r11d
  lea    0x10(,%rdi,8),%r8
  shl    $0x3,%rdi
  movslq %r11d,%r9
  lea    0x0(,%r9,8),%rcx
  lea    0x10(%rcx),%r10
  cmp    %rdi,%r10
  setle  %r10b
  cmp    %r8,%rcx
  setge  %r8b
  add    %r14,%rcx
  or     %r10b,%r8b
  je     L194
  cmpl   $0x1,0x40(%rsp)
  jbe    L194
  mov    0xc0(%rsp),%r9
  add    %r14,%rdi
  xor    %r8d,%r8d
  nopw   0x0(%rax,%rax,1)
L214:
  movupd (%rcx,%r8,1),%xmm0
  movupd (%rdi,%r8,1),%xmm5
  movups %xmm5,(%rcx,%r8,1)
  movups %xmm0,(%rdi,%r8,1)
  add    $0x10,%r8
  cmp    %r9,%r8
  jne    L214
  mov    0xbc(%rsp),%r10d
  lea    (%rax,%r10,1),%edi
  lea    (%r10,%r11,1),%ecx
  cmp    %r12d,%r10d
  je     L483
  movslq %ecx,%rcx
  movslq %edi,%rdi
  lea    (%r14,%rcx,8),%rcx
  lea    (%r14,%rdi,8),%rdi
  movsd  (%rcx),%xmm0
  movsd  (%rdi),%xmm1
  movsd  %xmm1,(%rcx)
  movsd  %xmm0,(%rdi)
L483:
  mov    0x48(%rsp),%rdi
  movslq %edx,%rdx
  mov    0x90(%rsp),%r11
  lea    (%rdi,%rdx,8),%rcx
  lea    (%r11,%rdx,4),%rdx
  movsd  (%rcx),%xmm0
  movsd  %xmm2,(%rcx)
  mov    (%rdx),%ecx
  movsd  %xmm0,(%rdi,%rbp,8)
  mov    (%r11,%rbp,4),%edi
  mov    %edi,(%rdx)
  mov    %ecx,(%r11,%rbp,4)
  cmp    0x78(%rsp),%rbp
  jne    L395
L305:
  mov    0x90(%rsp),%rcx
  mov    0x60(%rsp),%rsi
  xor    %eax,%eax
  mov    0x68(%rsp),%rdi
  nopw   0x0(%rax,%rax,1)
L380:
  movslq (%rcx,%rax,4),%rdx
  mov    %eax,(%rsi,%rdx,4)
  add    $0x1,%rax
  cmp    %rdi,%rax
  jne    L380
  xor    %ebp,%ebp
  mov    0x68(%rsp),%rax
  mov    %r13,(%rsp)
  xor    %r15d,%r15d
  mov    %ebp,%r13d
  mov    0xb0(%rsp),%rbp
  lea    0x0(,%rax,8),%rbx
  nopl   0x0(%rax)
L253:
  movslq %r13d,%rax
  mov    %rbx,%rdx
  xor    %esi,%esi
  add    %r12d,%r13d
  lea    0x0(%rbp,%rax,8),%rdi
  call   <memset@plt>
  mov    %r15d,%eax
  add    $0x1,%r15d
  cmp    %r15d,%r12d
  jne    L253
  mov    %eax,%ebx
  mov    %eax,0x80(%rsp)
  mov    %r12d,%eax
  mov    0xb0(%rsp),%rcx
  not    %eax
  mov    (%rsp),%r13
  mov    %r14,0x28(%rsp)
  cltq
  movsd  D8(%rip),%xmm2
  mov    %r15d,0x30(%rsp)
  mov    %rcx,%rbp
  shl    $0x3,%rax
  mov    %rax,0x8(%rsp)
  mov    0x40(%rsp),%eax
  imul   %r12d,%eax
  movslq %eax,%rdi
  mov    %eax,0x78(%rsp)
  movslq %ebx,%rax
  not    %ebx
  add    %rdi,%rax
  mov    %ebx,0x10(%rsp)
  mov    %rax,0x70(%rsp)
  lea    (%r14,%rax,8),%rax
  mov    %rcx,%r14
  mov    %rax,0x50(%rsp)
  mov    %r12d,%eax
  imul   %r12d,%eax
  mov    %rdi,0x58(%rsp)
  xor    %edi,%edi
  mov    %rdi,%r15
  mov    %eax,0x44(%rsp)
  movslq %ebx,%rax
  mov    %rax,0x18(%rsp)
  sub    $0x1,%rax
  mov    %rax,0x20(%rsp)
  nopl   (%rax)
L328:
  mov    0x60(%rsp),%rax
  mov    0x30(%rsp),%ebx
  mov    %r15d,0x34(%rsp)
  mov    0x80(%rsp),%r10d
  movslq (%rax,%r15,4),%r8
  mov    %ebx,%eax
  imul   %r8d,%eax
  lea    0x1(%r8),%esi
  lea    (%rax,%r15,1),%edx
  movslq %edx,%rdx
  movsd  %xmm2,(%r14,%rdx,8)
  cmp    %r10d,%r8d
  jge    L75
  imul   %esi,%ebx
  cltq
  add    %r15,%rax
  lea    (%r14,%rax,8),%r9
  movslq %ebx,%rdx
  mov    0x28(%rsp),%rbx
  lea    (%rdx,%r15,1),%rcx
  lea    (%r14,%rcx,8),%rcx
  lea    (%rbx,%rdx,8),%rdi
  nopw   0x0(%rax,%rax,1)
L295:
  movsd  (%rcx),%xmm1
  mov    %r8,%rax
  mov    %r9,%rdx
  nopw   0x0(%rax,%rax,1)
L485:
  movsd  (%rdx),%xmm0
  mulsd  (%rdi,%rax,8),%xmm0
  add    $0x1,%rax
  add    %r13,%rdx
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rcx)
  cmp    %eax,%esi
  jg     L485
  lea    0x1(%rsi),%eax
  add    %r13,%rcx
  add    %r13,%rdi
  cmp    %esi,%r10d
  jle    L75
  mov    %eax,%esi
  jmp    L295
L430:
  mov    0x90(%rsp),%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  call   <free@plt>
  mov    0x48(%rsp),%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    $0x2,%eax
  jmp    L211
L194:
  mov    0x78(%rsp),%rdi
  mov    0xc8(%rsp),%r11
  add    %r9,%rdi
  lea    (%r11,%rdi,8),%r8
  mov    0x70(%rsp),%rdi
  sub    %r9,%rdi
L472:
  movsd  (%rcx),%xmm0
  movsd  (%rcx,%rdi,8),%xmm1
  movsd  %xmm1,(%rcx)
  movsd  %xmm0,(%rcx,%rdi,8)
  add    $0x8,%rcx
  cmp    %r8,%rcx
  jne    L472
  jmp    L483
L264:
  mov    0x90(%rsp),%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  call   <free@plt>
  mov    0x48(%rsp),%rdi
  call   <free@plt>
  mov    $0x1,%eax
  jmp    L211
L237:
  mov    0x90(%rsp),%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  call   <free@plt>
  mov    $0x1,%eax
  jmp    L211
L345:
  mov    0x90(%rsp),%rdi
  call   <free@plt>
  mov    $0x1,%eax
  jmp    L211
L503:
  mov    $0x1,%eax
  jmp    L211
```

tool_calls: name: read_data
arguments: tag: D16
type_infered: qword
name: read_data
arguments: tag: D8
type_infered: f64

tool: D16: 9223372036854775807

tool: D8: 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;
}
```