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

```asm
<MatrixInv>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  movl   $0x3,-0x38(%rbp)
  movl   $0x2,-0x34(%rbp)
  movl   $0x0,-0x40(%rbp)
  movl   $0x0,-0x3c(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x28(%rbp)
  movl   $0x0,-0x40(%rbp)
  jmp    L185
L11:
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  mov    -0x40(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x28(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,(%rbx)
  addl   $0x1,-0x40(%rbp)
L185:
  mov    -0x40(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L11
  movl   $0x0,-0x40(%rbp)
  jmp    L7
L114:
  movl   $0x0,-0x3c(%rbp)
  jmp    L17
L69:
  mov    -0x40(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x48(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x3c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,%rdx
  mov    -0x3c(%rbp),%eax
  cltq
  movsd  (%rcx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx)
  addl   $0x1,-0x3c(%rbp)
L17:
  mov    -0x3c(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L69
  addl   $0x1,-0x40(%rbp)
L7:
  mov    -0x40(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L114
  mov    -0x38(%rbp),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Determinant@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  ucomisd -0x30(%rbp),%xmm0
  jp     L60
  pxor   %xmm0,%xmm0
  ucomisd -0x30(%rbp),%xmm0
  jne    L60
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L97
L60:
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x40(%rbp)
  jmp    L14
L4:
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  mov    -0x40(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x20(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,(%rbx)
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  mov    -0x40(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x18(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,(%rbx)
  addl   $0x1,-0x40(%rbp)
L14:
  mov    -0x40(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L4
  mov    -0x30(%rbp),%rsi
  mov    -0x38(%rbp),%edx
  mov    -0x20(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  movq   %rsi,%xmm0
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <InverseMatrix@plt>
  movl   $0x0,-0x40(%rbp)
  jmp    L159
L94:
  movl   $0x0,-0x3c(%rbp)
  jmp    L103
L109:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x3c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x40(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rax,%rdx
  movsd  (%rcx),%xmm0
  mov    -0x3c(%rbp),%eax
  cltq
  movsd  %xmm0,(%rdx,%rax,8)
  addl   $0x1,-0x3c(%rbp)
L103:
  mov    -0x3c(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L109
  addl   $0x1,-0x40(%rbp)
L159:
  mov    -0x40(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L94
  movl   $0x0,-0x40(%rbp)
  jmp    L51
L27:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  addl   $0x1,-0x40(%rbp)
L51:
  mov    -0x40(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L27
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L97:
  movl   $0x0,-0x40(%rbp)
  jmp    L90
L48:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  addl   $0x1,-0x40(%rbp)
L90:
  mov    -0x40(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L48
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D1
data_type: string

tool: D1: 
No determinant(A)

assistant: ```c
void MatrixInv(double matrix_in[3][3], double matrix_out[3][3]) {
  int userN = 3;
  int userM = 2;
  int row = 0;
  int column = 0;
  double **matrixA;
  double **inversedMatrixA;
  double **multiplicationalMatrixA;
  double determinantResult = 0;
  matrixA = (double **)malloc(sizeof(double *) * userN);
  for (row = 0; row < userN; row++) {
    matrixA[row] = (double *)malloc(sizeof(double) * userN);
  }
  for (row = 0; row < userN; row++) {
    for (column = 0; column < userN; column++) {
      matrixA[row][column] = matrix_in[row][column];
    }
  }
  determinantResult = Determinant(matrixA, userN);
  if (!determinantResult) {
    printf("\nNo determinant(A)\n");
  } else {
    inversedMatrixA = (double **)malloc(sizeof(double *) * userN);
    multiplicationalMatrixA = (double **)malloc(sizeof(double *) * userN);
    for (row = 0; row < userN; row++) {
      inversedMatrixA[row] = (double *)malloc(sizeof(double) * userN);
      multiplicationalMatrixA[row] = (double *)malloc(sizeof(double) * userN);
    }
    InverseMatrix(matrixA, inversedMatrixA, userN, determinantResult);
    for (row = 0; row < userN; row++) {
      for (column = 0; column < userN; column++) {
        matrix_out[row][column] = inversedMatrixA[row][column];
      }
    }
    for (row = 0; row < userN; row++) {
      free(multiplicationalMatrixA[row]);
      free(inversedMatrixA[row]);
    }
    free(multiplicationalMatrixA);
    free(inversedMatrixA);
  }
  for (row = 0; row < userN; row++) {
    free(matrixA[row]);
  }
  free(matrixA);
}
```