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

```asm
<invert_matrix>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  lea    0x0(,%r12,8),%r13
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %r13,%rdi
  mov    %r12d,0x4(%rsp)
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,%r14
  xor    %eax,%eax
  call   <check_alloc@plt>
  mov    0x4(%rsp),%edx
  test   %edx,%edx
  je     L143
  lea    -0x1(%rdx),%r8d
  lea    0x0(%r13,%r14,1),%rbp
  mov    %r14,%rbx
  mov    %edx,%r15d
  mov    %r14,0x20(%rsp)
  mov    %rbp,0x28(%rsp)
  mov    %r8d,0x4(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L146:
  mov    %r13,%rdi
  add    $0x8,%rbx
  call   <malloc@plt>
  mov    %rax,-0x8(%rbx)
  mov    %rax,%rdi
  xor    %eax,%eax
  call   <check_alloc@plt>
  cmp    %rbp,%rbx
  jne    L146
  mov    %r13,%rdi
  mov    %r15d,0x10(%rsp)
  call   <malloc@plt>
  mov    %rax,%r15
  mov    %rax,%rdi
  xor    %eax,%eax
  call   <check_alloc@plt>
  mov    %r15,%rbx
  lea    (%r15,%r13,1),%rbp
L133:
  mov    %r13,%rdi
  add    $0x8,%rbx
  call   <malloc@plt>
  mov    %rax,-0x8(%rbx)
  mov    %rax,%rdi
  xor    %eax,%eax
  call   <check_alloc@plt>
  cmp    %rbp,%rbx
  jne    L133
  mov    %r13,%rdi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,%r13
  xor    %eax,%eax
  call   <check_alloc@plt>
  mov    0x10(%rsp),%edx
  xor    %r9d,%r9d
  pxor   %xmm1,%xmm1
  mov    0x4(%rsp),%r8d
  mov    0x8(%rsp),%rcx
  mov    %edx,%eax
  mov    %edx,%r10d
  shr    %eax
  and    $0xfffffffe,%r10d
  lea    -0x1(%rax),%ebp
  movslq %r10d,%rbx
  mov    %r15,%rax
  mov    %r14,%r15
  add    $0x1,%rbp
  mov    %r9,%r14
  shl    $0x3,%rbx
  mov    %rax,%r9
  shl    $0x4,%rbp
  nopw   0x0(%rax,%rax,1)
L28:
  xor    %r11d,%r11d
  nopl   0x0(%rax,%rax,1)
L114:
  movapd %xmm1,%xmm0
  cmp    %r14d,%r11d
  je     L13
L43:
  mov    (%rcx,%r11,8),%rsi
  mov    (%r15,%r11,8),%rdi
  movsd  %xmm0,0x0(%r13,%r11,8)
  lea    0x8(%rsi),%rax
  cmp    %rax,%rdi
  mov    $0x0,%eax
  je     L1
  cmp    $0x2,%r8d
  jbe    L1
  nopl   0x0(%rax,%rax,1)
L122:
  movupd (%rsi,%rax,1),%xmm2
  movups %xmm2,(%rdi,%rax,1)
  add    $0x10,%rax
  cmp    %rbp,%rax
  jne    L122
  cmp    %r10d,%edx
  je     L31
  movsd  (%rsi,%rbx,1),%xmm0
  movsd  %xmm0,(%rdi,%rbx,1)
L31:
  add    $0x1,%r11
  cmp    %r12,%r11
  jne    L114
  mov    %r15,%rdi
  mov    %r13,%rsi
  mov    %r10d,0x1c(%rsp)
  mov    %r8d,0x18(%rsp)
  mov    %r9,0x10(%rsp)
  mov    %rcx,0x8(%rsp)
  mov    %edx,0x4(%rsp)
  call   <solvele@plt>
  mov    0x1c(%rsp),%r10d
  mov    0x4(%rsp),%edx
  xor    %eax,%eax
  mov    0x18(%rsp),%r8d
  mov    0x10(%rsp),%r9
  pxor   %xmm1,%xmm1
  lea    0x0(,%r14,8),%rdi
  mov    0x8(%rsp),%rcx
  nopl   0x0(%rax,%rax,1)
L147:
  movsd  0x0(%r13,%rax,8),%xmm0
  mov    (%r9,%rax,8),%rsi
  add    $0x1,%rax
  movsd  %xmm0,(%rsi,%rdi,1)
  cmp    %r12,%rax
  jne    L147
  add    $0x1,%r14
  cmp    %rax,%r14
  jne    L28
  mov    %r13,%rdi
  mov    %r15,%r14
  mov    %r9,%r15
  call   <free@plt>
  mov    0x20(%rsp),%rbx
  mov    0x28(%rsp),%rbp
  cs nopw 0x0(%rax,%rax,1)
L45:
  mov    (%rbx),%rdi
  add    $0x8,%rbx
  call   <free@plt>
  cmp    %rbp,%rbx
  jne    L45
L79:
  mov    %r14,%rdi
  call   <free@plt>
  add    $0x38,%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L1:
  movsd  (%rsi,%rax,8),%xmm0
  movsd  %xmm0,(%rdi,%rax,8)
  add    $0x1,%rax
  cmp    %r12,%rax
  jne    L1
  jmp    L31
  nopl   0x0(%rax,%rax,1)
L13:
  mov    D6(%rip),%rax
  movq   %rax,%xmm0
  jmp    L43
L143:
  mov    %r13,%rdi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,%r15
  xor    %eax,%eax
  call   <check_alloc@plt>
  mov    %r13,%rdi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    %rax,%rdi
  xor    %eax,%eax
  call   <check_alloc@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  jmp    L79
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D6
data_type: f64

tool: D6: 1

assistant: ```c
double **invert_matrix(double **mat, unsigned int size) {
  int i, j, k;
  double **hmat, **imat, *vec;
  extern void solvele(double **, double *, unsigned int);
  check_alloc(hmat = (double **)malloc(sizeof(double *) * size));
  for (i = 0; i < size; i++) {
    check_alloc(hmat[i] = (double *)malloc(sizeof(double) * size));
  }
  check_alloc(imat = (double **)malloc(sizeof(double *) * size));
  for (i = 0; i < size; i++) {
    check_alloc(imat[i] = (double *)malloc(sizeof(double) * size));
  }
  check_alloc(vec = (double *)malloc(sizeof(double) * size));
  for (i = 0; i < size; i++) {
    for (j = 0; j < size; j++) {
      vec[j] = (i == j) ? 1.0 : 0.0;
      for (k = 0; k < size; k++)
        hmat[j][k] = mat[j][k];
    }
    solvele(hmat, vec, size);
    for (j = 0; j < size; j++)
      imat[j][i] = vec[j];
  }
  free(vec);
  for (i = 0; i < size; i++)
    free(hmat[i]);
  free(hmat);
  return imat;
}
```