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

```asm
<solvps>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,0x8(%rsp)
  mov    $0x0,%eax
  test   %edx,%edx
  jle    L111
  mov    %rsi,%r14
  mov    %edx,%r13d
  movslq %edx,%rbp
  shl    $0x3,%rbp
  lea    0x8(%rbp),%rax
  mov    %rax,(%rsp)
  mov    0x8(%rsp),%r12
  mov    %r12,%rbx
  mov    $0x0,%r15d
  jmp    L101
L121:
  call   <sqrt@plt>
  jmp    L139
L125:
  pxor   %xmm1,%xmm1
  jmp    L193
L151:
  lea    0x8(%rbp),%r11
  mov    %r14,%rdx
  mov    0x8(%rsp),%r9
  mov    %r9,%r10
  mov    $0x0,%r8d
  jmp    L87
L37:
  mov    %eax,%r8d
L87:
  mov    %r10,%rsi
  test   %r8d,%r8d
  jle    L128
  mov    %r8d,%ecx
  mov    $0x0,%eax
L44:
  movsd  (%r14,%rax,8),%xmm1
  mulsd  (%rsi,%rax,8),%xmm1
  movsd  (%rdx),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L44
L128:
  movsd  (%rdx),%xmm0
  divsd  (%r9),%xmm0
  movsd  %xmm0,(%rdx)
  lea    0x1(%r8),%eax
  add    %r11,%r9
  add    $0x8,%rdx
  add    %rbp,%r10
  cmp    %r8d,%r15d
  jne    L37
  imul   %edi,%edi
  movslq %edi,%rax
  mov    0x8(%rsp),%rdi
  lea    -0x8(%rdi,%rax,8),%r8
  movslq %r13d,%rsi
  shl    $0x3,%rsi
  mov    $0xfffffffffffffff8,%r9
  sub    %rsi,%r9
  lea    0x1(%r15),%edi
  movslq %r15d,%r15
  lea    (%r14,%r15,8),%rcx
  jmp    L194
L97:
  mov    %eax,%edi
L194:
  lea    (%r8,%rsi,1),%rdx
  cmp    %edi,%r13d
  jle    L178
  movslq %edi,%rax
L12:
  movsd  (%r14,%rax,8),%xmm1
  mulsd  (%rdx),%xmm1
  movsd  (%rcx),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rcx)
  add    %rsi,%rdx
  add    $0x1,%rax
  cmp    %eax,%r13d
  jg     L12
L178:
  movsd  (%rcx),%xmm0
  divsd  (%r8),%xmm0
  movsd  %xmm0,(%rcx)
  add    %r9,%r8
  lea    -0x1(%rdi),%eax
  sub    $0x8,%rcx
  sub    $0x2,%edi
  jns    L97
  mov    $0x0,%eax
  jmp    L111
L39:
  mov    $0xffffffff,%eax
L111:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L100:
  add    (%rsp),%rbx
  mov    %rsi,%r12
  cmp    %rsi,%rbx
  jbe    L203
  mov    %rsi,%rax
L195:
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  (%rbx),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rbx)
  add    $0x8,%rax
  cmp    %rbx,%rax
  jb     L195
L203:
  mov    %edi,%r15d
L101:
  movsd  (%rbx),%xmm0
  pxor   %xmm2,%xmm2
  comisd %xmm0,%xmm2
  jae    L39
  ucomisd %xmm0,%xmm2
  ja     L121
  sqrtsd %xmm0,%xmm0
L139:
  movsd  %xmm0,(%rbx)
  lea    0x1(%r15),%edi
  lea    (%rbx,%rbp,1),%rcx
  cmp    %edi,%r13d
  je     L151
  lea    (%r12,%rbp,1),%rsi
  mov    %rsi,%r9
  mov    %edi,%r8d
L75:
  mov    %r9,%rdx
  cmp    %r12,%rbx
  jbe    L125
  mov    %r12,%rax
  pxor   %xmm1,%xmm1
L29:
  add    $0x8,%rax
  add    $0x8,%rdx
  movsd  -0x8(%rax),%xmm0
  mulsd  -0x8(%rdx),%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rbx,%rax
  jb     L29
L193:
  movsd  (%rcx),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rcx)
  divsd  (%rbx),%xmm0
  movsd  %xmm0,(%rcx)
  add    $0x1,%r8d
  add    %rbp,%rcx
  add    %rbp,%r9
  cmp    %r8d,%r13d
  jne    L75
  jmp    L100
```

assistant: ```c
int solvps(double *a, double *b, int n) {
  double *p, *q, *r, *s, t;
  int j, k;
  for (j = 0, p = a; j < n; ++j, p += n + 1) {
    for (q = a + j * n; q < p; ++q)
      *p -= *q * *q;
    if (*p <= 0.)
      return -1;
    *p = sqrt(*p);
    for (k = j + 1, q = p + n; k < n; ++k, q += n) {
      for (r = a + j * n, s = a + k * n, t = 0.; r < p;)
        t += *r++ * *s++;
      *q -= t;
      *q /= *p;
    }
  }
  for (j = 0, p = a; j < n; ++j, p += n + 1) {
    for (k = 0, q = a + j * n; k < j;)
      b[j] -= b[k++] * *q++;
    b[j] /= *p;
  }
  for (j = n - 1, p = a + n * n - 1; j >= 0; --j, p -= n + 1) {
    for (k = j + 1, q = p + n; k < n; q += n)
      b[j] -= b[k++] * *q;
    b[j] /= *p;
  }
  return 0;
}
```