user: Please show me the C implementation that matches the assembly code listed below:

```asm
<matrix_inversion>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %esi,%edi
  imul   %esi,%edi
  sub    $0x58,%rsp
  mov    %esi,0x8(%rsp)
  mov    $0x4,%esi
  call   <calloc@plt>
  mov    0x8(%rsp),%r8d
  mov    %rax,0x48(%rsp)
  test   %r8d,%r8d
  jle    L207
  mov    %rax,%rsi
  movslq %r8d,%rax
  mov    %r12,%rcx
  mov    $0xfffffffffffffffc,%r10
  sub    %rsi,%rcx
  mov    %r12,%r9
  mov    %r12,%rdi
  xor    %r11d,%r11d
  lea    0x4(,%rax,4),%rbp
  lea    0x0(,%rax,4),%r13
  movss  D5(%rip),%xmm2
  lea    -0x1(%r8),%eax
  mov    %rbp,0x40(%rsp)
  shl    $0x2,%rax
  mov    %r13,(%rsp)
  lea    0x4(%rsi,%rax,1),%rdx
  sub    %rax,%r10
  mov    %rsi,%rax
  mov    %rcx,%rsi
  mov    %rbx,%rcx
  sub    %rax,%rcx
  nopw   0x0(%rax,%rax,1)
L51:
  lea    (%r10,%rdx,1),%rax
  nopl   0x0(%rax)
L153:
  movl   $0x0,(%rsi,%rax,1)
  movss  (%rcx,%rax,1),%xmm0
  add    $0x4,%rax
  movss  %xmm0,-0x4(%rax)
  cmp    %rdx,%rax
  jne    L153
  lea    0x1(%r11),%eax
  movss  %xmm2,(%rdi)
  add    %r13,%rdx
  add    %rbp,%rdi
  cmp    %eax,%r8d
  je     L52
  mov    %eax,%r11d
  jmp    L51
L52:
  mov    %eax,0xc(%rsp)
  pxor   %xmm1,%xmm1
  xor    %r13d,%r13d
  mov    %rbx,%r14
  mov    %r11d,0x8(%rsp)
  mov    %rbx,0x10(%rsp)
  movl   $0x0,0x3c(%rsp)
  movss  %xmm2,0x18(%rsp)
L6:
  mov    0x10(%rsp),%rcx
  mov    %r12,0x30(%rsp)
  mov    %r13d,%r15d
  mov    %r13d,%r12d
  mov    %r14,0x20(%rsp)
  mov    %r9,0x28(%rsp)
  mov    %rcx,%rbp
  mov    %r8d,0x38(%rsp)
  movss  %xmm1,0x1c(%rsp)
  jmp    L114
  nopw   0x0(%rax,%rax,1)
L208:
  mov    %eax,%r12d
L114:
  movss  0x0(%rbp),%xmm0
  call   <fabs@plt>
  mov    %rax,%r14
  mov    0xc(%rsp),%eax
  imul   %r15d,%eax
  add    %r13d,%eax
  cltq
  movss  (%rbx,%rax,4),%xmm0
  call   <fabs@plt>
  cmp    %rax,%r14
  lea    0x1(%r12),%eax
  cmovg  %r12d,%r15d
  add    (%rsp),%rbp
  cmp    %r12d,0x8(%rsp)
  jg     L208
  movss  0x1c(%rsp),%xmm1
  mov    0x20(%rsp),%r14
  mov    0x28(%rsp),%r9
  mov    0x38(%rsp),%r8d
  mov    0x30(%rsp),%r12
  cmp    %r13d,%r15d
  jne    L21
L56:
  mov    0x10(%rsp),%rax
  movss  0x18(%rsp),%xmm3
  pxor   %xmm4,%xmm4
  movss  (%rax),%xmm2
  mulss  %xmm2,%xmm3
  ucomiss %xmm4,%xmm3
  movss  %xmm3,0x18(%rsp)
  jp     L164
  je     L58
L164:
  mov    %r8d,%edx
  xor    %eax,%eax
  xchg   %ax,%ax
L25:
  movss  (%r9,%rax,4),%xmm0
  divss  %xmm2,%xmm0
  movss  %xmm0,(%r9,%rax,4)
  cmp    %eax,%r13d
  jg     L162
  movss  (%r14,%rax,4),%xmm0
  divss  %xmm2,%xmm0
  movss  %xmm0,(%r14,%rax,4)
L162:
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L25
  mov    0x3c(%rsp),%ebp
  mov    0x8(%rsp),%esi
  mov    %r13d,%r15d
  mov    %r8d,%r11d
  xor    %edi,%edi
  xchg   %ax,%ax
L94:
  cmp    %r13d,%edi
  je     L134
  movslq %r15d,%rax
  movss  (%rbx,%rax,4),%xmm1
L134:
  mov    %r11d,%edx
  sub    %r8d,%edx
  nopl   0x0(%rax,%rax,1)
L103:
  cmp    %r13d,%edi
  je     L135
  lea    0x0(%rbp,%rdx,1),%ecx
  movslq %edx,%rax
  movslq %ecx,%rcx
  shl    $0x2,%rax
  movss  (%r12,%rcx,4),%xmm2
  lea    (%r12,%rax,1),%r10
  add    %rbx,%rax
  movss  (%r10),%xmm0
  mulss  %xmm1,%xmm2
  subss  %xmm2,%xmm0
  movss  %xmm0,(%r10)
  movss  (%rbx,%rcx,4),%xmm2
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm2
  subss  %xmm2,%xmm0
  movss  %xmm0,(%rax)
L135:
  add    $0x1,%edx
  cmp    %edx,%r11d
  jne    L103
  lea    0x1(%rdi),%eax
  add    %r8d,%r11d
  sub    %r8d,%ebp
  add    %r8d,%r15d
  cmp    %esi,%edi
  je     L37
  mov    %eax,%edi
  jmp    L94
  nopl   0x0(%rax,%rax,1)
L37:
  mov    (%rsp),%rsi
  mov    0x40(%rsp),%rdi
  lea    0x1(%r13),%eax
  add    %r8d,0x3c(%rsp)
  add    %rdi,0x10(%rsp)
  add    %rsi,%r14
  add    %rsi,%r9
  cmp    %r13d,0x8(%rsp)
  je     L207
  mov    %eax,%r13d
  jmp    L6
L21:
  imul   0xc(%rsp),%r15d
  mov    %r8d,%ecx
  xor    %eax,%eax
  movslq %r15d,%rdx
  shl    $0x2,%rdx
  lea    (%r12,%rdx,1),%rsi
  add    %rbx,%rdx
  nopl   (%rax)
L123:
  movss  (%r9,%rax,4),%xmm0
  movss  (%rsi,%rax,4),%xmm2
  movss  %xmm2,(%r9,%rax,4)
  movss  %xmm0,(%rsi,%rax,4)
  cmp    %eax,%r13d
  jg     L50
  movss  (%r14,%rax,4),%xmm0
  movss  (%rdx,%rax,4),%xmm2
  movss  %xmm2,(%r14,%rax,4)
  movss  %xmm0,(%rdx,%rax,4)
L50:
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L123
  jmp    L56
L207:
  mov    0x48(%rsp),%rdi
  call   <free@plt>
  add    $0x58,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L58:
  mov    0x48(%rsp),%rdi
  call   <free@plt>
  add    $0x58,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: label: D5
data_type: byte[4]

tool: {"D5": [0x00,0x00,0x80,0x3f]}

assistant: ```c
int matrix_inversion(float *A, int n, float *AInverse) {
  int i, j, iPass, imx, icol, irow;
  float det, temp, pivot;
  float factor = 0;
  float *ac = (float *)calloc(n * n, sizeof(float));
  det = 1;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      AInverse[n * i + j] = 0;
      ac[n * i + j] = A[n * i + j];
    }
    AInverse[n * i + i] = 1;
  }
  for (iPass = 0; iPass < n; iPass++) {
    imx = iPass;
    for (irow = iPass; irow < n; irow++) {
      if (fabs(A[n * irow + iPass]) > fabs(A[n * imx + iPass]))
        imx = irow;
    }
    if (imx != iPass) {
      for (icol = 0; icol < n; icol++) {
        temp = AInverse[n * iPass + icol];
        AInverse[n * iPass + icol] = AInverse[n * imx + icol];
        AInverse[n * imx + icol] = temp;
        if (icol >= iPass) {
          temp = A[n * iPass + icol];
          A[n * iPass + icol] = A[n * imx + icol];
          A[n * imx + icol] = temp;
        }
      }
    }
    pivot = A[n * iPass + iPass];
    det = det * pivot;
    if (det == 0) {
      free(ac);
      return 0;
    }
    for (icol = 0; icol < n; icol++) {
      AInverse[n * iPass + icol] = AInverse[n * iPass + icol] / pivot;
      if (icol >= iPass)
        A[n * iPass + icol] = A[n * iPass + icol] / pivot;
    }
    for (irow = 0; irow < n; irow++) {
      if (irow != iPass)
        factor = A[n * irow + iPass];
      for (icol = 0; icol < n; icol++) {
        if (irow != iPass) {
          AInverse[n * irow + icol] -= factor * AInverse[n * iPass + icol];
          A[n * irow + icol] -= factor * A[n * iPass + icol];
        }
      }
    }
  }
  free(ac);
  return 1;
}
```