user: What would the C source look like for the assembly code provided here?

```asm
<matinv>:
  endbr64
  push   %r15
  mov    %rdx,%r15
  push   %r14
  push   %r13
  movslq %edi,%r13
  push   %r12
  mov    %r13,%rdi
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    $0x4,%esi
  sub    $0xa8,%rsp
  call   <calloc@plt>
  mov    %rax,0x68(%rsp)
  test   %rax,%rax
  je     L302
  mov    $0x4,%esi
  mov    %r13,%rdi
  call   <calloc@plt>
  mov    %rax,0x60(%rsp)
  test   %rax,%rax
  je     L336
  mov    $0x8,%esi
  mov    %r13,%rdi
  call   <calloc@plt>
  mov    %rax,0x98(%rsp)
  test   %rax,%rax
  je     L343
  mov    %r13d,%edi
  mov    $0x8,%esi
  mov    %r13,%rbp
  imul   %r13d,%edi
  movslq %edi,%rdi
  call   <calloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L280
  test   %r13d,%r13d
  jle    L332
  lea    -0x1(%r13),%eax
  mov    %r13d,%r8d
  mov    0x68(%rsp),%r9
  xor    %ecx,%ecx
  mov    %eax,0x4c(%rsp)
  xor    %esi,%esi
  pxor   %xmm4,%xmm4
  movq   D18(%rip),%xmm3
  mov    %rax,0x28(%rsp)
  mov    0x98(%rsp),%rdi
  mov    %r8,0x58(%rsp)
L135:
  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)
L362:
  movsd  (%rbx,%rax,1),%xmm0
  movapd %xmm0,%xmm1
  andpd  %xmm3,%xmm1
  comisd %xmm2,%xmm1
  jbe    L328
  movsd  %xmm1,(%rdi,%rcx,8)
  movapd %xmm1,%xmm2
L328:
  movsd  %xmm0,(%r12,%rax,1)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L362
  add    %ebp,%esi
  ucomisd %xmm4,%xmm2
  jp     L24
  je     L103
L24:
  add    $0x1,%rcx
  cmp    %r8,%rcx
  jne    L135
  lea    0x8(%r12),%rdi
  mov    %r12,0x8(%rsp)
  mov    %ebp,%edx
  mov    %r12,%r8
  mov    %rdi,0x30(%rsp)
  lea    0x0(%rbp,%rbp,1),%edi
  lea    0x8(,%r13,8),%rax
  mov    0x98(%rsp),%r9
  mov    %edi,0x20(%rsp)
  lea    0x0(,%r13,8),%rbx
  mov    $0x1,%r14d
  xor    %r11d,%r11d
  movq   $0x0,0x10(%rsp)
  mov    %rax,0x18(%rsp)
  lea    -0x2(%rbp),%eax
  mov    %r15,0x38(%rsp)
  mov    %eax,%r15d
L174:
  movsd  (%r8),%xmm1
  movsd  (%r9,%r11,8),%xmm2
  mov    %edx,%edi
  mov    %r14d,%esi
  sub    %ebp,%edi
  lea    -0x1(%r14),%eax
  andpd  %xmm3,%xmm1
  mov    %edi,(%rsp)
  divsd  %xmm2,%xmm1
  cmp    %r14d,%ebp
  jle    L48
  mov    0x8(%rsp),%rdi
  movslq %edx,%rdx
  mov    %r14,%rcx
  add    %r11,%rdx
  lea    (%rdi,%rdx,8),%rdi
  nopl   0x0(%rax,%rax,1)
L191:
  movsd  (%rdi),%xmm0
  andpd  %xmm3,%xmm0
  divsd  (%r9,%rcx,8),%xmm0
  comisd %xmm1,%xmm0
  maxsd  %xmm1,%xmm0
  cmova  %ecx,%eax
  add    $0x1,%rcx
  movapd %xmm0,%xmm1
  add    %rbx,%rdi
  movslq %eax,%rdx
  cmp    %ecx,%ebp
  jg     L191
  cmp    %r11d,%eax
  jg     L379
L48:
  cmp    0x58(%rsp),%r14
  je     L335
L108:
  mov    %r14,%r10
  mov    %r13,%rcx
  mov    %r15d,%eax
  add    %r13,0x10(%rsp)
  sub    %r11,%r10
  lea    (%rbx,%r8,1),%rdx
  neg    %rcx
  shl    $0x3,%r10
  lea    0x10(,%rax,8),%r12
  jmp    L258
  nopl   (%rax)
L237:
  add    $0x1,%esi
  add    %rbx,%rdx
  sub    %r13,%rcx
  cmp    %esi,%ebp
  je     L310
L258:
  movsd  (%rdx),%xmm0
  ucomisd %xmm4,%xmm0
  jp     L283
  je     L237
L283:
  divsd  (%r8),%xmm0
  lea    (%rdx,%r10,1),%rax
  movsd  %xmm0,(%rdx)
  lea    (%r12,%rdx,1),%rdi
  jmp    L296
  nopl   0x0(%rax)
L122:
  movsd  (%rdx),%xmm0
L296:
  mulsd  (%rax,%rcx,8),%xmm0
  movsd  (%rax),%xmm1
  add    $0x8,%rax
  subsd  %xmm0,%xmm1
  movsd  %xmm1,-0x8(%rax)
  cmp    %rdi,%rax
  jne    L122
  add    $0x1,%esi
  add    %rbx,%rdx
  sub    %r13,%rcx
  cmp    %esi,%ebp
  jne    L258
L310:
  mov    (%rsp),%edx
  add    $0x1,%r11
  add    $0x1,%r14
  add    0x18(%rsp),%r8
  add    0x20(%rsp),%edx
  sub    $0x1,%r15d
  jmp    L174
  nopl   0x0(%rax)
L222:
  mov    (%rsp),%r14
L50:
  mov    0x78(%rsp),%r12
  mov    0x74(%rsp),%r11d
  mov    %ebp,%edi
  mov    0x80(%rsp),%r8
  mov    0x70(%rsp),%r10d
  mov    0x88(%rsp),%r9
  nopl   (%rax)
L289:
  cmp    0x10(%rsp),%edi
  jge    L30
  lea    0x0(%r13,%r10,1),%eax
  mov    0x40(%rsp),%rsi
  movslq %r11d,%rdx
  add    0x8(%rsp),%rdx
  cltq
  lea    (%r15,%rdx,8),%rdx
  lea    (%r15,%rax,8),%rcx
  movslq %edi,%rax
  add    %r8,%rax
  movsd  (%rcx),%xmm1
  lea    (%rsi,%rax,8),%rax
  mov    0x4c(%rsp),%esi
  mov    %rax,(%rsp)
  mov    0x50(%rsp),%rax
  sub    %edi,%esi
  add    %r12,%rsi
  lea    (%rax,%rsi,8),%rsi
  mov    (%rsp),%rax
  nopw   0x0(%rax,%rax,1)
L31:
  movsd  (%rax),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %rbx,%rdx
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rcx)
  cmp    %rsi,%rax
  jne    L31
L30:
  movsd  (%r14,%r8,8),%xmm0
  add    0x28(%rsp),%r10d
  divsd  (%r9),%xmm0
  sub    %ebp,%r11d
  movsd  %xmm0,(%r14,%r8,8)
  add    0x20(%rsp),%r9
  add    0x30(%rsp),%r8
  add    0x38(%rsp),%r12
  sub    $0x1,%edi
  jne    L289
  addq   $0x1,0x8(%rsp)
  add    $0x8,%r14
  mov    0x8(%rsp),%rax
  cmp    0x58(%rsp),%rax
  jne    L94
  mov    0x40(%rsp),%r12
L332:
  mov    0x68(%rsp),%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  call   <free@plt>
  mov    0x98(%rsp),%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  xor    %eax,%eax
L372:
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L379:
  imul   %ebp,%eax
  mov    0x8(%rsp),%rdi
  mov    0x30(%rsp),%r10
  cltq
  lea    (%rdi,%rax,8),%rcx
  mov    0x28(%rsp),%rdi
  add    %rax,%rdi
  lea    (%r10,%rdi,8),%r10
  mov    0x10(%rsp),%rdi
  sub    %rax,%rdi
L381:
  movsd  (%rcx),%xmm0
  movsd  (%rcx,%rdi,8),%xmm1
  movsd  %xmm1,(%rcx)
  movsd  %xmm0,(%rcx,%rdi,8)
  add    $0x8,%rcx
  cmp    %r10,%rcx
  jne    L381
  mov    0x68(%rsp),%rdi
  lea    (%r9,%rdx,8),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm2,(%rax)
  lea    (%rdi,%rdx,4),%rax
  mov    (%rdi,%r11,4),%ecx
  mov    (%rax),%edx
  movsd  %xmm0,(%r9,%r11,8)
  mov    %ecx,(%rax)
  mov    %edx,(%rdi,%r11,4)
  cmp    0x58(%rsp),%r14
  jne    L108
L335:
  mov    0x8(%rsp),%r12
  mov    0x38(%rsp),%r15
  xor    %eax,%eax
  mov    0x68(%rsp),%rcx
  mov    0x60(%rsp),%rsi
  mov    0x58(%rsp),%rdi
  nopl   0x0(%rax,%rax,1)
L8:
  movslq (%rcx,%rax,4),%rdx
  mov    %eax,(%rsi,%rdx,4)
  add    $0x1,%rax
  cmp    %rdi,%rax
  jne    L8
  mov    0x58(%rsp),%rax
  xor    %r14d,%r14d
  mov    %r12,(%rsp)
  mov    %r14d,%r12d
  mov    %rbx,%r14
  lea    0x0(,%rax,8),%r13
  xor    %eax,%eax
  mov    %eax,%ebx
  xchg   %ax,%ax
L151:
  movslq %r12d,%rax
  mov    %r13,%rdx
  xor    %esi,%esi
  add    %ebp,%r12d
  lea    (%r15,%rax,8),%rdi
  call   <memset@plt>
  mov    %ebx,%eax
  add    $0x1,%ebx
  cmp    %ebx,%ebp
  jne    L151
  mov    %eax,%edi
  mov    %eax,0x18(%rsp)
  mov    %ebp,%eax
  mov    (%rsp),%r12
  not    %eax
  movsd  D5(%rip),%xmm2
  mov    %ebx,0x10(%rsp)
  mov    %r14,%rbx
  cltq
  mov    %r12,0x40(%rsp)
  mov    %r15,%r14
  movq   $0x0,0x8(%rsp)
  shl    $0x3,%rax
  mov    %rax,0x20(%rsp)
  mov    0x4c(%rsp),%eax
  imul   %ebp,%eax
  movslq %eax,%rcx
  mov    %eax,0x70(%rsp)
  movslq %edi,%rax
  not    %edi
  add    %rcx,%rax
  mov    %rcx,0x80(%rsp)
  mov    %rax,0x78(%rsp)
  lea    (%r12,%rax,8),%rax
  mov    %rax,0x88(%rsp)
  mov    %ebp,%eax
  imul   %ebp,%eax
  mov    %edi,0x28(%rsp)
  mov    %eax,0x74(%rsp)
  lea    0x8(%r12),%rax
  mov    %rax,0x90(%rsp)
  movslq %edi,%rax
  mov    %rax,0x30(%rsp)
  sub    $0x1,%rax
  mov    %rax,0x38(%rsp)
  lea    0x10(%r12),%rax
  mov    %rax,0x50(%rsp)
  nopw   0x0(%rax,%rax,1)
L94:
  mov    0x8(%rsp),%rcx
  mov    0x60(%rsp),%rax
  mov    (%rax,%rcx,4),%r9d
  mov    0x10(%rsp),%eax
  mov    %ecx,%r13d
  imul   %r9d,%eax
  lea    0x1(%r9),%edi
  lea    (%rax,%rcx,1),%edx
  movslq %edx,%rdx
  movsd  %xmm2,(%r15,%rdx,8)
  cmp    0x18(%rsp),%r9d
  jge    L50
  mov    %edi,%r8d
  cltq
  mov    %r14,(%rsp)
  mov    0x40(%rsp),%r12
  imul   %ebp,%r8d
  add    %rcx,%rax
  mov    0x90(%rsp),%r14
  movslq %r9d,%r10
  lea    (%r15,%rax,8),%r11
  nopl   0x0(%rax,%rax,1)
L272:
  cmp    %edi,%r9d
  jge    L368
  lea    0x0(%r13,%r8,1),%eax
  mov    %edi,%esi
  movslq %r8d,%rdx
  cltq
  sub    %r9d,%esi
  add    %r10,%rdx
  lea    (%r15,%rax,8),%rcx
  sub    $0x1,%esi
  lea    (%r12,%rdx,8),%rax
  add    %rdx,%rsi
  movsd  (%rcx),%xmm1
  mov    %r11,%rdx
  lea    (%r14,%rsi,8),%rsi
L396:
  movsd  (%rax),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %rbx,%rdx
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rcx)
  cmp    %rax,%rsi
  jne    L396
L368:
  lea    0x1(%rdi),%eax
  add    %ebp,%r8d
  cmp    %edi,0x18(%rsp)
  je     L222
  mov    %eax,%edi
  jmp    L272
L103:
  mov    0x68(%rsp),%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  call   <free@plt>
  mov    0x98(%rsp),%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    $0x3,%eax
  jmp    L372
L280:
  mov    0x68(%rsp),%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  call   <free@plt>
  mov    0x98(%rsp),%rdi
  call   <free@plt>
  mov    $0x2,%eax
  jmp    L372
L343:
  mov    0x68(%rsp),%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  call   <free@plt>
  mov    $0x2,%eax
  jmp    L372
L336:
  mov    0x68(%rsp),%rdi
  call   <free@plt>
  mov    $0x2,%eax
  jmp    L372
L302:
  mov    $0x2,%eax
  jmp    L372
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D18
type_guessed: qword
name: extract_symbolic_data
arguments: data_tag: D5
type_guessed: f64

tool: D18: 9223372036854775807

tool: D5: 1

assistant: ```c
int matinv(n, mat, inv)
int n;
const double mat[];
double inv[];
{
  register int i, ij, ik, j, k, kj, pj;
  int itemp, *mxl, *lxm, pivot;
  double colmax, *lu, *rowmax, dtemp;
  if (!(mxl = calloc(n, sizeof(int))))
    return 2;
  if (!(lxm = calloc(n, sizeof(int)))) {
    free(mxl);
    return 2;
  }
  if (!(rowmax = calloc(n, sizeof(double)))) {
    free(mxl);
    free(lxm);
    return 2;
  }
  if (!(lu = calloc(n * n, sizeof(double)))) {
    free(mxl);
    free(lxm);
    free(rowmax);
    return 2;
  }
  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 3;
    }
  }
  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;
}
```