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

```asm
<MatrixSolve>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  mov    $0x4,%esi
  push   %rbx
  mov    %edi,%ebx
  sub    $0x78,%rsp
  call   <calloc@plt>
  mov    %rax,0x10(%rsp)
  test   %ebx,%ebx
  jle    L46
  lea    -0x1(%rbx),%esi
  mov    %esi,0x4c(%rsp)
  cmp    $0x2,%esi
  jbe    L283
  mov    %ebx,%edx
  movdqa D3(%rip),%xmm0
  movdqa D22(%rip),%xmm2
  shr    $0x2,%edx
  shl    $0x4,%rdx
  add    %rax,%rdx
  nopw   0x0(%rax,%rax,1)
L327:
  movdqa %xmm0,%xmm1
  add    $0x10,%rax
  paddd  %xmm2,%xmm0
  movups %xmm1,-0x10(%rax)
  cmp    %rax,%rdx
  jne    L327
  mov    %ebx,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%bl
  je     L324
L290:
  mov    0x10(%rsp),%rsi
  movslq %eax,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    %eax,(%rsi,%rdx,4)
  lea    0x1(%rax),%edx
  cmp    %ebx,%edx
  jge    L324
  add    $0x2,%eax
  mov    %edx,0x4(%rsi,%rcx,1)
  cmp    %eax,%ebx
  jle    L324
  mov    %eax,0x8(%rsi,%rcx,1)
L324:
  mov    %ebx,%eax
  movslq %ebx,%rsi
  mov    %ebx,%edx
  mov    0x10(%rsp),%rdi
  imul   %ebx,%eax
  shr    %edx
  mov    %rsi,0x28(%rsp)
  mov    %ebx,%ecx
  sub    $0x1,%edx
  mov    %rdi,0x60(%rsp)
  and    $0xfffffffe,%ecx
  mov    %rbp,%r14
  add    $0x1,%rdx
  mov    %rdi,(%rsp)
  xor    %r9d,%r9d
  xor    %r10d,%r10d
  mov    %eax,0x48(%rsp)
  shl    $0x4,%rdx
  lea    0x8(,%rsi,8),%rax
  movq   D11(%rip),%xmm5
  mov    %rax,0x20(%rsp)
  mov    0x4c(%rsp),%eax
  pxor   %xmm3,%xmm3
  mov    %rdx,0x58(%rsp)
  movsd  D20(%rip),%xmm6
  movapd %xmm5,%xmm4
  mov    %rax,0x18(%rsp)
  lea    0x0(,%rsi,8),%rax
  shl    $0x4,%rsi
  mov    %rsi,%r15
  lea    0x8(%rbp),%rsi
  movq   $0x0,0x8(%rsp)
  mov    %rsi,0x68(%rsp)
  lea    0x1(%rbx),%esi
  mov    %r15,%r13
  mov    %ecx,%r15d
  movl   $0x0,0x44(%rsp)
  mov    %esi,0x34(%rsp)
  nopl   (%rax)
L53:
  movsd  (%r14),%xmm2
  mov    %r10d,0x30(%rsp)
  mov    %r10d,%esi
  mov    %r14,%r8
  mov    %r10d,%edx
  mov    %r10d,%edi
  movapd %xmm2,%xmm0
  movapd %xmm2,%xmm1
  cmpltsd %xmm3,%xmm0
  xorpd  %xmm5,%xmm1
  andpd  %xmm0,%xmm1
  andnpd %xmm2,%xmm0
  orpd   %xmm0,%xmm1
  nopl   0x0(%rax,%rax,1)
L244:
  movsd  (%r8),%xmm0
  comisd %xmm0,%xmm3
  jbe    L125
  xorpd  %xmm4,%xmm0
L125:
  comisd %xmm1,%xmm0
  mov    %edx,%ecx
  maxsd  %xmm1,%xmm0
  cmova  %edi,%ecx
  add    $0x1,%edi
  movapd %xmm0,%xmm1
  add    %rax,%r8
  mov    %ecx,%edx
  cmp    %edi,%ebx
  jg     L244
  mov    %r10d,%r8d
  cmp    %ecx,%r10d
  jne    L122
L359:
  mov    0x10(%rsp),%rdi
  mov    (%rsp),%r11
  movslq %ecx,%rcx
  ucomisd %xmm3,%xmm2
  lea    (%rdi,%rcx,4),%rcx
  mov    (%r11),%edx
  mov    (%rcx),%edi
  mov    %edi,(%r11)
  mov    %edx,(%rcx)
  jp     L357
  jne    L357
  mov    0x48(%rsp),%edx
  add    0x30(%rsp),%edx
  movsd  %xmm6,(%r14)
  addl   $0x1,0x44(%rsp)
  movslq %edx,%rdx
  movq   $0x0,0x0(%rbp,%rdx,8)
  movsd  (%r14),%xmm2
L357:
  mov    0x30(%rsp),%ecx
  mov    %ebx,%edx
  sub    %ecx,%edx
  cmp    $0x3,%edx
  jbe    L80
  cmp    %r8d,%ebx
  jl     L80
  mov    0x34(%rsp),%edi
  movapd %xmm2,%xmm1
  mov    %r14,%rdx
  unpcklpd %xmm1,%xmm1
  sub    %ecx,%edi
  cmp    %esi,%ebx
  mov    $0x1,%ecx
  cmovl  %ecx,%edi
  xor    %ecx,%ecx
  mov    %edi,%r11d
  shr    %r11d
  nopw   0x0(%rax,%rax,1)
L176:
  movsd  (%rdx),%xmm0
  add    $0x1,%ecx
  movhpd (%rdx,%rax,1),%xmm0
  divpd  %xmm1,%xmm0
  movlpd %xmm0,(%rdx)
  movhpd %xmm0,(%rdx,%rax,1)
  add    %r13,%rdx
  cmp    %r11d,%ecx
  jne    L176
  mov    %edi,%ecx
  movslq %r9d,%r11
  and    $0xfffffffe,%ecx
  lea    (%rcx,%rsi,1),%edx
  cmp    %ecx,%edi
  je     L274
  imul   %ebx,%edx
  add    %esi,%edx
  movslq %edx,%rdx
  lea    0x0(%rbp,%rdx,8),%rdx
  movsd  (%rdx),%xmm0
  divsd  %xmm2,%xmm0
  movsd  %xmm0,(%rdx)
L274:
  lea    0x0(%rbp,%r11,8),%r12
  mov    %r10,%rdi
  xor    %r11d,%r11d
  nopl   0x0(%rax)
L280:
  cmp    %r8d,%r11d
  je     L329
  lea    (%r11,%r9,1),%edx
  mov    %esi,%ecx
  movslq %edx,%rdx
  movsd  0x0(%rbp,%rdx,8),%xmm2
  mov    %r12,%rdx
  nopw   0x0(%rax,%rax,1)
L221:
  movsd  (%rdx,%rdi,8),%xmm1
  movsd  (%rdx),%xmm0
  add    $0x1,%ecx
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx)
  add    %rax,%rdx
  cmp    %ecx,%ebx
  jge    L221
L329:
  lea    0x1(%r11),%edx
  add    $0x8,%r12
  sub    $0x1,%rdi
  cmp    %edx,%ebx
  je     L229
  mov    %edx,%r11d
  jmp    L280
  nopl   0x0(%rax)
L229:
  mov    0x28(%rsp),%rdi
  addq   $0x4,(%rsp)
  lea    0x1(%r10),%rdx
  add    %ebx,%r9d
  add    %rdi,0x8(%rsp)
  add    0x20(%rsp),%r14
  cmp    0x18(%rsp),%r10
  je     L165
  mov    %rdx,%r10
  jmp    L53
  cs nopw 0x0(%rax,%rax,1)
L122:
  imul   %ebx,%edx
  movslq %edx,%rdi
  lea    0x0(,%rdi,8),%r11
  mov    %rdi,0x50(%rsp)
  mov    0x8(%rsp),%rdi
  lea    0x0(,%rdi,8),%r12
  lea    0x10(%r11),%rdi
  cmp    %rdi,%r12
  mov    0x8(%rsp),%rdi
  setge  0x38(%rsp)
  lea    0x10(,%rdi,8),%rdi
  cmp    %r11,%rdi
  movzbl 0x38(%rsp),%edi
  setle  0x43(%rsp)
  or     0x43(%rsp),%dil
  lea    (%r12,%rbp,1),%rdi
  je     L346
  cmpl   $0x1,0x4c(%rsp)
  jbe    L346
  mov    %rax,0x38(%rsp)
  mov    0x58(%rsp),%rax
  add    %rbp,%r11
  xor    %r12d,%r12d
L363:
  movupd (%rdi,%r12,1),%xmm0
  movupd (%r11,%r12,1),%xmm7
  movups %xmm7,(%rdi,%r12,1)
  movups %xmm0,(%r11,%r12,1)
  add    $0x10,%r12
  cmp    %rax,%r12
  jne    L363
  mov    0x38(%rsp),%rax
  cmp    %r15d,%ebx
  je     L367
  lea    (%r9,%r15,1),%edi
  add    %r15d,%edx
  movslq %edi,%rdi
  movslq %edx,%rdx
  lea    0x0(%rbp,%rdi,8),%rdi
  lea    0x0(%rbp,%rdx,8),%rdx
  movsd  (%rdi),%xmm0
  movsd  (%rdx),%xmm1
  movsd  %xmm1,(%rdi)
  movsd  %xmm0,(%rdx)
L367:
  movsd  (%r14),%xmm2
  jmp    L359
L80:
  movslq %r9d,%r11
  mov    %esi,%ecx
  lea    (%r11,%r10,1),%rdx
  lea    0x0(%rbp,%rdx,8),%rdx
  nopl   0x0(%rax,%rax,1)
L62:
  movsd  (%rdx),%xmm0
  add    $0x1,%ecx
  divsd  %xmm2,%xmm0
  movsd  %xmm0,(%rdx)
  add    %rax,%rdx
  cmp    %ecx,%ebx
  jge    L62
  jmp    L274
L165:
  movslq 0x48(%rsp),%rax
  mov    0x60(%rsp),%r8
  xor    %esi,%esi
  mov    0x10(%rsp),%rbx
  mov    %rax,%r10
  lea    0x0(%rbp,%rax,8),%rdi
  nopl   0x0(%rax)
L87:
  mov    (%r8),%r9d
  mov    %r8,%rax
  mov    %esi,%edx
  jmp    L154
  nopw   0x0(%rax,%rax,1)
L316:
  lea    0x1(%rdx),%ecx
  add    $0x4,%rax
  cmp    %edx,%r11d
  jle    L335
  mov    %ecx,%edx
L154:
  cmp    %esi,(%rax)
  jne    L316
  mov    %esi,%r12d
L368:
  add    %r10d,%edx
  movsd  (%rdi),%xmm0
  add    $0x4,%r8
  add    $0x8,%rdi
  movslq %edx,%rdx
  lea    0x0(%rbp,%rdx,8),%rdx
  movsd  (%rdx),%xmm1
  movsd  %xmm1,-0x8(%rdi)
  movsd  %xmm0,(%rdx)
  mov    %r12d,-0x4(%r8)
  mov    %r9d,(%rax)
  lea    0x1(%rsi),%eax
  cmp    %esi,%r11d
  je     L55
  mov    %eax,%esi
  jmp    L87
  nopl   0x0(%rax)
L335:
  movslq %ecx,%rax
  mov    %ecx,%edx
  lea    (%rbx,%rax,4),%rax
  mov    (%rax),%r12d
  jmp    L368
L46:
  movl   $0x0,0x44(%rsp)
L55:
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x44(%rsp),%eax
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L346:
  mov    0x8(%rsp),%r11
  mov    0x18(%rsp),%rdx
  mov    0x68(%rsp),%r12
  add    %r11,%rdx
  lea    (%r12,%rdx,8),%rdx
  mov    0x50(%rsp),%r12
  sub    %r11,%r12
  nopl   0x0(%rax)
L96:
  movsd  (%rdi),%xmm0
  movsd  (%rdi,%r12,8),%xmm1
  movsd  %xmm1,(%rdi)
  movsd  %xmm0,(%rdi,%r12,8)
  add    $0x8,%rdi
  cmp    %rdi,%rdx
  jne    L96
  jmp    L367
L283:
  xor    %eax,%eax
  jmp    L290
```

tool_calls: name: parse_data
arguments: data_label: D3
type_infered: f32[4]
name: parse_data
arguments: data_label: D22
type_infered: byte[16]
name: parse_data
arguments: data_label: D11
type_infered: f32[2]
name: parse_data
arguments: data_label: D20
type_infered: f64

tool: {"D3": [0.0,1.401298464324817e-45,2.802596928649634e-45,4.203895392974451e-45]}

tool: {"D22": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

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

tool: D20: 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;
}
```