user: Converte this assembly snippet into its equivalent C code:

```asm
<gauss_matrix>:
  endbr64
  push   %r15
  movslq %esi,%rax
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  lea    0x0(,%rax,8),%r12d
  push   %rbp
  mov    %r12d,%edi
  mov    %rax,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x28,%rsp
  mov    %rax,0x10(%rsp)
  call   <shMalloc@plt>
  mov    %r12d,%edi
  mov    %rax,%r13
  call   <shMalloc@plt>
  mov    %rax,0x8(%rsp)
  test   %ebp,%ebp
  jle    L116
  lea    -0x2(%rbp),%eax
  mov    %r14,%rdi
  movq   D87(%rip),%xmm3
  xor    %esi,%esi
  mov    %r13,%rcx
  pxor   %xmm2,%xmm2
  sub    %r13,%rdi
  lea    0x10(,%rax,8),%r8
  nopl   0x0(%rax)
L169:
  mov    (%rdi,%rcx,1),%rdx
  movsd  (%rdx),%xmm1
  andpd  %xmm3,%xmm1
  movsd  %xmm1,(%rcx)
  cmp    $0x1,%ebp
  je     L175
  lea    0x8(%rdx),%rax
  add    %r8,%rdx
  nopl   0x0(%rax)
L217:
  movsd  (%rax),%xmm0
  andpd  %xmm3,%xmm0
  comisd %xmm1,%xmm0
  jbe    L195
  movsd  %xmm0,(%rcx)
  movapd %xmm0,%xmm1
L195:
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L217
L175:
  ucomisd %xmm2,%xmm1
  jp     L57
  je     L53
L57:
  add    $0x1,%esi
  add    $0x8,%rcx
  cmp    %esi,%ebp
  jne    L169
L116:
  lea    -0x1(%rbp),%eax
  movq   D87(%rip),%xmm3
  movsd  D60(%rip),%xmm4
  mov    %eax,0x1c(%rsp)
  test   %eax,%eax
  jle    L177
  lea    -0x2(%rbp),%eax
  mov    $0x1,%r15d
  add    $0x2,%rax
  mov    %rax,(%rsp)
  mov    %rbx,%rax
  mov    %r14,%rbx
  mov    %r13,%r14
  mov    %rax,%r12
  nopw   0x0(%rax,%rax,1)
L60:
  lea    -0x1(%r15),%r8d
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  mov    %r8d,0x18(%rsp)
  call   <gauss_pivot@plt>
  mov    0x18(%rsp),%r8d
  cmp    $0x1,%eax
  je     L151
  mov    -0x8(%rbx,%r15,8),%rcx
  lea    -0x8(,%r15,8),%rsi
  movsd  (%r14),%xmm1
  movq   D87(%rip),%xmm3
  mov    D60(%rip),%rax
  lea    (%rcx,%rsi,1),%r9
  movsd  (%r9),%xmm0
  movq   %rax,%xmm4
  movapd %xmm0,%xmm2
  divsd  %xmm1,%xmm2
  andpd  %xmm3,%xmm2
  comisd %xmm2,%xmm4
  ja     L109
  cmp    %r15d,%ebp
  jle    L37
  mov    %r15,%r8
  nopl   0x0(%rax)
L78:
  mov    (%rbx,%r8,8),%rdx
  mov    %r15,%rax
  movsd  (%rdx,%rsi,1),%xmm2
  divsd  %xmm0,%xmm2
L155:
  movsd  (%rcx,%rax,8),%xmm1
  movsd  (%rdx,%rax,8),%xmm0
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%ebp
  jg     L155
  mulsd  -0x8(%r12,%r15,8),%xmm2
  movsd  (%r12,%r8,8),%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%r12,%r8,8)
  add    $0x1,%r8
  cmp    %r8d,%ebp
  jle    L37
  movsd  (%r9),%xmm0
  jmp    L78
  cs nopw 0x0(%rax,%rax,1)
L37:
  add    $0x1,%r15
  add    $0x8,%r14
  cmp    %r15,(%rsp)
  jne    L60
  mov    %rbx,%r14
  mov    %r12,%rbx
L177:
  mov    0x10(%rsp),%rax
  shl    $0x3,%rax
  mov    -0x8(%r14,%rax,1),%rdx
  movsd  -0x8(%r13,%rax,1),%xmm1
  movsd  -0x8(%rdx,%rax,1),%xmm2
  movapd %xmm2,%xmm0
  divsd  %xmm1,%xmm0
  andpd  %xmm3,%xmm0
  comisd %xmm0,%xmm4
  ja     L145
  movsd  -0x8(%rbx,%rax,1),%xmm0
  mov    0x8(%rsp),%rdi
  mov    %ebp,%r10d
  divsd  %xmm2,%xmm0
  movsd  %xmm0,-0x8(%rdi,%rax,1)
  sub    $0x2,%r10d
  js     L71
  mov    0x8(%rsp),%r9
  movslq %r10d,%rdi
  mov    0x1c(%rsp),%r8d
  pxor   %xmm2,%xmm2
  lea    0x0(,%rdi,8),%rsi
  lea    0x10(%r9),%r11
L111:
  mov    (%r14,%rsi,1),%r12
  cmp    %r8d,%ebp
  jle    L238
  mov    %r10d,%edx
  movslq %r8d,%rax
  movapd %xmm2,%xmm1
  sub    %edi,%edx
  lea    (%r9,%rax,8),%rax
  add    %rdi,%rdx
  lea    (%r11,%rdx,8),%rcx
  mov    %r12,%rdx
  sub    %r9,%rdx
  nopw   0x0(%rax,%rax,1)
L210:
  movsd  (%rdx,%rax,1),%xmm0
  mulsd  (%rax),%xmm0
  add    $0x8,%rax
  addsd  %xmm0,%xmm1
  cmp    %rax,%rcx
  jne    L210
L95:
  movsd  (%rbx,%rsi,1),%xmm0
  sub    $0x1,%rdi
  sub    $0x1,%r8d
  subsd  %xmm1,%xmm0
  divsd  (%r12,%rsi,1),%xmm0
  movsd  %xmm0,(%r9,%rsi,1)
  sub    $0x8,%rsi
  test   %edi,%edi
  jns    L111
L71:
  test   %ebp,%ebp
  jle    L19
  mov    0x8(%rsp),%rdi
  mov    %ebp,%ebp
  mov    %rdi,%rax
  lea    (%rdi,%rbp,8),%rdx
  sub    %rdi,%rbx
L92:
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rbx,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%rdx
  jne    L92
L19:
  mov    0x8(%rsp),%rdi
  call   <shFree@plt>
  mov    %r13,%rdi
  call   <shFree@plt>
  xor    %edx,%edx
  jmp    L248
L53:
  lea    D89(%rip),%rdi
  xor    %eax,%eax
  call   <shError@plt>
L249:
  mov    %r13,%rdi
  call   <shFree@plt>
  mov    0x8(%rsp),%rdi
  call   <shFree@plt>
  mov    $0x1,%edx
L248:
  add    $0x28,%rsp
  mov    %edx,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L109:
  mov    %r8d,%esi
  lea    D84(%rip),%rdi
L135:
  mov    $0x2,%eax
  call   <shError@plt>
  jmp    L249
L151:
  mov    %eax,0x18(%rsp)
  lea    D0(%rip),%rdi
  xor    %eax,%eax
  call   <shError@plt>
  mov    %r13,%rdi
  call   <shFree@plt>
  mov    0x8(%rsp),%rdi
  call   <shFree@plt>
  mov    0x18(%rsp),%edx
  jmp    L248
L238:
  movapd %xmm2,%xmm1
  jmp    L95
L145:
  movapd %xmm2,%xmm0
  mov    %ebp,%esi
  lea    D35(%rip),%rdi
  jmp    L135
```

tool_calls: name: disassemble_data
arguments: data_tag: D87
data_type: qword
name: disassemble_data
arguments: data_tag: D60
data_type: byte[8]
name: disassemble_data
arguments: data_tag: D89
data_type: string
name: disassemble_data
arguments: data_tag: D84
data_type: string
name: disassemble_data
arguments: data_tag: D0
data_type: string
name: disassemble_data
arguments: data_tag: D35
data_type: string

tool: D87: 9223372036854775807

tool: {"D60": [0x11,0xea,0x2d,0x81,0x99,0x97,0x71,0x3d]}

tool: D89: gauss_matrix: biggest val in row %d is zero

tool: D84: gauss_matrix: Y: row %d has tiny value %f / %f

tool: D0: gauss_matrix: singular matrix

tool: D35: gauss_matrix: Z: row %d has tiny value %f / %f

assistant: ```c
int gauss_matrix(double **matrix, int num, double *vector) {
  int i, j, k;
  double *biggest_val;
  double *solution_vector;
  double factor;
  double sum;
  biggest_val = (double *)shMalloc(num * sizeof(double));
  solution_vector = (double *)shMalloc(num * sizeof(double));
  for (i = 0; i < num; i++) {
    biggest_val[i] = fabs(matrix[i][0]);
    for (j = 1; j < num; j++) {
      if (fabs(matrix[i][j]) > biggest_val[i]) {
        biggest_val[i] = fabs(matrix[i][j]);
      }
    }
    if (biggest_val[i] == 0.0) {
      shError("gauss_matrix: biggest val in row %d is zero", i);
      shFree(biggest_val);
      shFree(solution_vector);
      return (1);
    }
  }
  for (i = 0; i < num - 1; i++) {
    if (gauss_pivot(matrix, num, vector, biggest_val, i) == 1) {
      shError("gauss_matrix: singular matrix");
      shFree(biggest_val);
      shFree(solution_vector);
      return (1);
    }
    if (fabs(matrix[i][i] / biggest_val[i]) < 1.0e-12) {
      shError("gauss_matrix: Y: row %d has tiny value %f / %f", i, matrix[i][i], biggest_val[i]);
      shFree(biggest_val);
      shFree(solution_vector);
      return (1);
    }
    for (j = i + 1; j < num; j++) {
      factor = matrix[j][i] / matrix[i][i];
      for (k = i + 1; k < num; k++) {
        matrix[j][k] -= factor * matrix[i][k];
      }
      vector[j] -= factor * vector[i];
    }
  }
  if (fabs(matrix[num - 1][num - 1] / biggest_val[num - 1]) < 1.0e-12) {
    shError("gauss_matrix: Z: row %d has tiny value %f / %f", num, matrix[num - 1][num - 1], biggest_val[num - 1]);
    shFree(biggest_val);
    shFree(solution_vector);
    return (1);
  }
  solution_vector[num - 1] = vector[num - 1] / matrix[num - 1][num - 1];
  for (i = num - 2; i >= 0; i--) {
    sum = 0.0;
    for (j = i + 1; j < num; j++) {
      sum += matrix[i][j] * solution_vector[j];
    }
    solution_vector[i] = (vector[i] - sum) / matrix[i][i];
  }
  for (i = 0; i < num; i++) {
    vector[i] = solution_vector[i];
  }
  shFree(solution_vector);
  shFree(biggest_val);
  return (0);
}
```