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

```asm
<linsolve>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L50
L49:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x20(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jp     L42
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jne    L42
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L42:
  addl   $0x1,-0x20(%rbp)
L50:
  mov    -0x20(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L49
  mov    -0x48(%rbp),%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x8(%rbp),%rax
  movsd  %xmm0,(%rax)
  movl   $0x1,-0x20(%rbp)
  jmp    L26
L1:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x20(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L75
L11:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x14(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  addl   $0x1,-0x1c(%rbp)
L75:
  mov    -0x1c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L11
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  subsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x20(%rbp)
L26:
  mov    -0x20(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L1
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x2c(%rbp),%eax
  imul   %eax,%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x2c(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L101
L83:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x2c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x20(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x18(%rbp)
  mov    -0x20(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L0
L51:
  addl   $0x1,-0x18(%rbp)
  mov    -0x14(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  addl   $0x1,-0x1c(%rbp)
L0:
  mov    -0x1c(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L51
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0x10(%rbp),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  subl   $0x1,-0x20(%rbp)
L101:
  cmpl   $0x0,-0x20(%rbp)
  jns    L83
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D4
type_guessed: string

tool: D4: The Matrix system does not have a unique solution

assistant: ```c
int linsolve(double *A, int N, double *b, double *x, int *ipiv) {
  int i, j, c1, l;
  double *y;
  double sum, temp;
  y = (double *)malloc(sizeof(double) * N);
  for (i = 0; i < N; ++i) {
    y[i] = 0.;
    x[i] = 0.;
    if (A[i * N + i] == 0.) {
      printf("The Matrix system does not have a unique solution");
      exit(1);
    }
  }
  y[0] = b[ipiv[0]];
  for (i = 1; i < N; ++i) {
    sum = 0.;
    c1 = i * N;
    for (j = 0; j < i; ++j) {
      sum += y[j] * A[c1 + j];
    }
    y[i] = b[ipiv[i]] - sum;
  }
  x[N - 1] = y[N - 1] / A[N * N - 1];
  for (i = N - 2; i >= 0; i--) {
    sum = 0.;
    c1 = i * (N + 1);
    l = 0;
    for (j = i + 1; j < N; j++) {
      l++;
      sum += A[c1 + l] * x[j];
    }
    x[i] = (y[i] - sum) / A[c1];
  }
  free(y);
  return 0;
}
```