user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<MatrixSolve>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %edi,%ebp
  mov    %rsi,%rbx
  mov    $0x4,%esi
  call   <calloc@plt>
  mov    %rax,0x20(%rsp)
  test   %ebp,%ebp
  jle    L66
  mov    %rax,%r14
  mov    $0x0,%r10d
L238:
  mov    %r10d,(%rax)
  mov    %r10d,%esi
  add    $0x1,%r10d
  add    $0x4,%rax
  cmp    %r10d,%ebp
  jne    L238
  mov    %r10d,0x2c(%rsp)
  mov    %r10d,%eax
  imul   %r10d,%eax
  mov    %eax,0x44(%rsp)
  movslq %r10d,%rax
  mov    %rax,0x30(%rsp)
  lea    0x8(,%rax,8),%rdx
  mov    %rdx,0x38(%rsp)
  mov    %esi,%edx
  mov    %rdx,0x18(%rsp)
  shl    $0x3,%rax
  mov    0x20(%rsp),%rdx
  mov    %rdx,0x10(%rsp)
  mov    %rbx,0x8(%rsp)
  movq   $0x0,(%rsp)
  mov    $0x0,%r12d
  mov    $0x0,%r11d
  movl   $0x0,0x40(%rsp)
  pxor   %xmm7,%xmm7
  movq   D9(%rip),%xmm9
  movapd %xmm7,%xmm3
  movapd %xmm9,%xmm4
  movapd %xmm7,%xmm6
  movapd %xmm7,%xmm5
  movsd  D13(%rip),%xmm8
  lea    0x2(%rsi),%edx
  mov    %r14,0x48(%rsp)
  jmp    L203
L206:
  xorpd  %xmm9,%xmm1
  jmp    L294
L265:
  comisd %xmm1,%xmm0
  maxsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  cmova  %ecx,%r8d
  lea    0x1(%rcx),%r15d
  add    %rax,%rdi
  cmp    %ecx,%esi
  je     L97
  mov    %r15d,%ecx
L181:
  movsd  (%rdi),%xmm0
  comisd %xmm0,%xmm3
  jbe    L265
  xorpd  %xmm4,%xmm0
  jmp    L265
L97:
  cmp    %r9d,%r8d
  jne    L153
  mov    %r9d,%r8d
L196:
  mov    0x10(%rsp),%r15
  mov    (%r15),%ecx
  movslq %r8d,%r8
  mov    0x20(%rsp),%rdi
  lea    (%rdi,%r8,4),%rdi
  mov    (%rdi),%r8d
  mov    %r8d,(%r15)
  mov    %ecx,(%rdi)
  ucomisd (%r14),%xmm6
  jp     L14
  ucomisd (%r14),%xmm5
  jne    L14
  movsd  %xmm8,(%r14)
  mov    0x28(%rsp),%ecx
  add    0x44(%rsp),%ecx
  movslq %ecx,%rcx
  movq   $0x0,(%rbx,%rcx,8)
  addl   $0x1,0x40(%rsp)
L14:
  movsd  (%r14),%xmm1
  cmp    %r9d,%r10d
  jl     L177
  movslq %r13d,%rcx
  add    %r11,%rcx
  lea    (%rbx,%rcx,8),%rcx
  mov    %ebp,%edi
L225:
  movsd  (%rcx),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rcx)
  add    $0x1,%edi
  add    %rax,%rcx
  cmp    %edx,%edi
  jne    L225
L177:
  movslq %r13d,%r13
  lea    (%rbx,%r13,8),%r14
  mov    %r11,%r8
  mov    $0x0,%r13d
  jmp    L149
L153:
  mov    %r8d,%edi
  imul   %r10d,%edi
  mov    (%rsp),%r15
  lea    (%rbx,%r15,8),%rcx
  add    0x18(%rsp),%r15
  lea    0x8(%rbx,%r15,8),%r15
  movslq %edi,%rdi
  sub    (%rsp),%rdi
L195:
  movsd  (%rcx),%xmm0
  movsd  (%rcx,%rdi,8),%xmm1
  movsd  %xmm1,(%rcx)
  movsd  %xmm0,(%rcx,%rdi,8)
  add    $0x8,%rcx
  cmp    %r15,%rcx
  jne    L195
  jmp    L196
L129:
  mov    %ebp,%r8d
  jmp    L196
L266:
  lea    0x1(%r13),%ecx
  add    $0x8,%r14
  sub    $0x1,%r8
  cmp    %r13d,%esi
  je     L132
  mov    %ecx,%r13d
L149:
  cmp    %r9d,%r13d
  je     L266
  lea    0x0(%r13,%r12,1),%ecx
  movslq %ecx,%rcx
  movsd  (%rbx,%rcx,8),%xmm2
  cmp    %r9d,%r10d
  jl     L266
  mov    %r14,%rcx
  mov    %ebp,%edi
L220:
  movapd %xmm2,%xmm1
  mulsd  (%rcx,%r8,8),%xmm1
  movsd  (%rcx),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rcx)
  add    $0x1,%edi
  add    %rax,%rcx
  cmp    %edx,%edi
  jne    L220
  jmp    L266
L132:
  lea    0x1(%r11),%rcx
  mov    0x38(%rsp),%r15
  add    %r15,0x8(%rsp)
  add    0x2c(%rsp),%r12d
  addq   $0x4,0x10(%rsp)
  mov    0x30(%rsp),%r15
  add    %r15,(%rsp)
  cmp    0x18(%rsp),%r11
  je     L202
  mov    %rcx,%r11
L203:
  mov    %r11d,0x28(%rsp)
  mov    %r11d,%ebp
  mov    %r12d,%r13d
  mov    0x8(%rsp),%rdi
  mov    %rdi,%r14
  movsd  (%rdi),%xmm1
  comisd %xmm1,%xmm7
  ja     L206
L294:
  mov    %r11d,%r9d
  cmp    %r11d,%r10d
  jle    L129
  movslq %r13d,%rcx
  add    %r11,%rcx
  lea    (%rbx,%rcx,8),%rdi
  mov    %ebp,%r8d
  mov    %ebp,%ecx
  jmp    L181
L202:
  mov    0x48(%rsp),%r14
  mov    0x44(%rsp),%r12d
  movslq %r12d,%rax
  lea    (%rbx,%rax,8),%r9
  mov    $0x0,%r8d
  mov    %r10d,%r11d
  mov    0x20(%rsp),%rbp
  mov    0x18(%rsp),%r13
  jmp    L303
L64:
  mov    %ecx,%eax
L70:
  cmp    %edi,(%rdx)
  je     L9
  lea    0x1(%rax),%ecx
  add    $0x4,%rdx
  cmp    %eax,%esi
  jne    L64
  mov    %r11d,%eax
L9:
  movsd  (%r9,%r8,8),%xmm0
  lea    (%r12,%rax,1),%edx
  movslq %edx,%rdx
  lea    (%rbx,%rdx,8),%rdx
  movsd  (%rdx),%xmm1
  movsd  %xmm1,(%r9,%r8,8)
  movsd  %xmm0,(%rdx)
  mov    (%r14),%edx
  cltq
  lea    0x0(%rbp,%rax,4),%rax
  mov    (%rax),%ecx
  mov    %ecx,(%r14)
  mov    %edx,(%rax)
  lea    0x1(%r8),%rax
  add    $0x4,%r14
  cmp    %r13,%r8
  je     L100
  mov    %rax,%r8
L303:
  mov    %r8d,%eax
  mov    %r8d,%edi
  mov    %r14,%rdx
  cmp    %r8d,%r10d
  jg     L70
  jmp    L9
L66:
  movl   $0x0,0x40(%rsp)
L100:
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    0x40(%rsp),%eax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: data_label: D9
type: f32[2]
name: parse_data
arguments: data_label: D13
type: f64

tool: {"D9": [0.0,-0.0]}

tool: D13: 1

assistant: ```c
int MatrixSolve(int dim, double *matrix) {
  register int i, j, k;
  register double temp;
  int *order;
  int singular;
  order = (int *)calloc((unsigned)dim, sizeof(int));
  singular = 0;
  for (i = 0; i < dim; i++)
    order[i] = i;
  for (i = 0; i < dim; i++) {
    temp = ((matrix[dim * (i) + (i)]) < 0.0 ? -(matrix[dim * (i) + (i)]) : (matrix[dim * (i) + (i)]));
    k = i;
    for (j = i; j < dim; j++) {
      if (((matrix[dim * (j) + (i)]) < 0.0 ? -(matrix[dim * (j) + (i)]) : (matrix[dim * (j) + (i)])) > temp) {
        temp = ((matrix[dim * (j) + (i)]) < 0.0 ? -(matrix[dim * (j) + (i)]) : (matrix[dim * (j) + (i)]));
        k = j;
      }
    }
    if (i != k)
      for (j = 0; j < dim; j++) {
        temp = matrix[dim * (i) + (j)];
        matrix[dim * (i) + (j)] = matrix[dim * (k) + (j)];
        matrix[dim * (k) + (j)] = temp;
      }
    j = order[i];
    order[i] = order[k];
    order[k] = j;
    if (matrix[dim * (i) + (i)] == 0.0) {
      matrix[dim * (i) + (i)] = 1.0;
      matrix[dim * (dim) + (i)] = 0.0;
      singular++;
    }
    temp = matrix[dim * (i) + (i)];
    for (j = i; j < dim + 1; j++)
      matrix[dim * (j) + (i)] /= temp;
    for (j = 0; j < dim; j++) {
      if (i != j) {
        temp = matrix[dim * (i) + (j)];
        for (k = i; k < dim + 1; k++)
          matrix[dim * (k) + (j)] -= temp * matrix[dim * (k) + (i)];
      }
    }
  }
  for (i = 0; i < dim; i++) {
    for (j = i; j < dim; j++) {
      if (order[j] == i)
        break;
    }
    temp = matrix[dim * (dim) + (i)];
    matrix[dim * (dim) + (i)] = matrix[dim * (dim) + (j)];
    matrix[dim * (dim) + (j)] = temp;
    k = order[i];
    order[i] = order[j];
    order[j] = k;
  }
  (void)free(order);
  return singular;
}
```