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

```asm
<linsolve>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r13
  mov    %rdi,0x20(%rsp)
  mov    %esi,%ebx
  mov    %rdx,%r15
  mov    %rcx,%rbp
  mov    %r8,(%rsp)
  movslq %esi,%r12
  mov    %r12,0x28(%rsp)
  lea    0x0(,%rsi,8),%edi
  call   <malloc@plt>
  mov    %rax,%r14
  test   %ebx,%ebx
  jle    L144
  lea    0x8(,%r12,8),%rax
  mov    %rax,0x8(%rsp)
  mov    %ebx,%eax
  lea    (%r14,%rax,8),%rax
  mov    %rax,0x10(%rsp)
  mov    %r14,%r12
  mov    %rbp,%rax
  sub    %r14,%rax
  mov    %rax,0x18(%rsp)
  jmp    L44
L8:
  add    $0x8,%r12
  add    0x8(%rsp),%r13
  cmp    0x10(%rsp),%r12
  je     L144
L44:
  movq   $0x0,(%r12)
  mov    0x18(%rsp),%rax
  movq   $0x0,(%rax,%r12,1)
  pxor   %xmm2,%xmm2
  ucomisd 0x0(%r13),%xmm2
  jp     L8
  jne    L8
  lea    D8(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L8
L144:
  mov    (%rsp),%rax
  movslq (%rax),%rax
  movsd  (%r15,%rax,8),%xmm0
  movsd  %xmm0,(%r14)
  cmp    $0x1,%ebx
  jle    L50
  lea    0x8(%r14),%rdx
  mov    0x28(%rsp),%rdi
  shl    $0x3,%rdi
  mov    %rdi,%rcx
  sub    %r14,%rcx
  add    0x20(%rsp),%rcx
  mov    %ebx,%r8d
  mov    $0x1,%esi
L45:
  test   %esi,%esi
  jle    L120
  mov    %r14,%rax
  pxor   %xmm1,%xmm1
L156:
  movsd  (%rax),%xmm0
  mulsd  (%rcx,%rax,1),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L156
L32:
  mov    (%rsp),%rax
  movslq (%rax,%rsi,4),%rax
  movsd  (%r15,%rax,8),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x1,%rsi
  add    $0x8,%rdx
  add    %rdi,%rcx
  cmp    %r8,%rsi
  jne    L45
  mov    %ebx,%eax
  imul   %ebx,%eax
  cltq
  movsd  -0x8(%r14,%rdi,1),%xmm0
  mov    0x20(%rsp),%r10
  divsd  -0x8(%r10,%rax,8),%xmm0
  movsd  %xmm0,-0x8(%rbp,%rdi,1)
  lea    -0x2(%rbx),%esi
  movslq %esi,%rcx
  lea    (%r14,%rcx,8),%rdi
  mov    %ebx,%edx
  not    %edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%r9
  lea    0x1(%rbx),%eax
  imul   %esi,%eax
  cltq
  shl    $0x3,%rax
  lea    (%r10,%rax,1),%rsi
  lea    0x8(,%rdx,8),%r8
  mov    %rcx,%rdx
  neg    %rdx
  lea    (%rax,%rdx,8),%rax
  lea    (%r10,%rax,1),%rdx
L133:
  lea    0x1(%rcx),%eax
  cmp    %eax,%ebx
  jle    L16
  cltq
  pxor   %xmm1,%xmm1
L72:
  movsd  (%rdx,%rax,8),%xmm0
  mulsd  0x0(%rbp,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L72
L56:
  movsd  (%rdi),%xmm0
  subsd  %xmm1,%xmm0
  divsd  (%rsi),%xmm0
  movsd  %xmm0,0x0(%rbp,%rcx,8)
  sub    $0x1,%rcx
  sub    $0x8,%rdi
  add    %r9,%rsi
  add    %r8,%rdx
  test   %ecx,%ecx
  jns    L133
L147:
  mov    %r14,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L120:
  pxor   %xmm1,%xmm1
  jmp    L32
L50:
  mov    0x28(%rsp),%rax
  shl    $0x3,%rax
  imul   %ebx,%ebx
  movslq %ebx,%rdx
  movsd  -0x8(%r14,%rax,1),%xmm0
  mov    0x20(%rsp),%rdi
  divsd  -0x8(%rdi,%rdx,8),%xmm0
  movsd  %xmm0,-0x8(%rbp,%rax,1)
  jmp    L147
L16:
  pxor   %xmm1,%xmm1
  jmp    L56
```

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

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