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

```asm
<SolveCubic>:
  endbr64
  divsd  %xmm0,%xmm1
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x50,%rsp
  divsd  %xmm0,%xmm2
  movsd  %xmm1,(%rsp)
  fldl   (%rsp)
  pxor   %xmm1,%xmm1
  fstpt  (%rsp)
  fldt   (%rsp)
  divsd  %xmm0,%xmm3
  movsd  %xmm2,0x30(%rsp)
  fldl   0x30(%rsp)
  fld    %st(1)
  fmul   %st(2),%st
  flds   0xe02(%rip)        # 2000 <_fini+0xa8c>
  fmul   %st(2),%st
  fsubrp %st,%st(1)
  flds   0xdfc(%rip)        # 2004 <_fini+0xa90>
  fdivr  %st,%st(1)
  movsd  %xmm3,0x30(%rsp)
  fld    %st(3)
  fadd   %st(4),%st
  fmul   %st(4),%st
  fmul   %st(4),%st
  fxch   %st(4)
  fmulp  %st,%st(1)
  fmulp  %st,%st(2)
  fxch   %st(2)
  fsubp  %st,%st(1)
  flds   0xde0(%rip)        # 2008 <_fini+0xa94>
  fmull  0x30(%rsp)
  faddp  %st,%st(1)
  fdivs  0xdd8(%rip)        # 200c <_fini+0xa98>
  fld    %st(1)
  fmul   %st(2),%st
  fmul   %st(2),%st
  fld    %st(1)
  fmul   %st(2),%st
  fsub   %st(1),%st
  fstpl  0x30(%rsp)
  movsd  0x30(%rsp),%xmm0
  comisd %xmm0,%xmm1
  jae    L17
  fstp   %st(0)
  ucomisd %xmm0,%xmm1
  movl   $0x1,(%rdi)
  ja     L25
  fxch   %st(1)
  sqrtsd %xmm0,%xmm0
  movsd  %xmm0,0x30(%rsp)
L5:
  fstpt  0x20(%rsp)
  sub    $0x10,%rsp
  fld    %st(0)
  fstpt  (%rsp)
  fstpt  0x20(%rsp)
  call   <fabs@plt>
  pxor   %xmm0,%xmm0
  xor    %esi,%esi
  cvtsi2sd %rax,%xmm0
  addsd  0x40(%rsp),%xmm0
  cvttsd2si %xmm0,%rdi
  call   <pow@plt>
  movsd  %xmm0,0x40(%rsp)
  fldl   0x40(%rsp)
  fldt   0x30(%rsp)
  fdiv   %st(1),%st
  faddp  %st,%st(1)
  fstpl  0x40(%rsp)
  pop    %rax
  pop    %rdx
  fldt   0x10(%rsp)
  fldz
  fcomip %st(1),%st
  fstp   %st(0)
  ja     L32
  movsd  0x30(%rsp),%xmm5
  xorpd  D19(%rip),%xmm5
  movsd  %xmm5,0x30(%rsp)
L32:
  fldt   (%rsp)
  fdivs  0xd1c(%rip)        # 2000 <_fini+0xa8c>
  fsubrl 0x30(%rsp)
  fstpl  (%rbx)
  add    $0x50,%rsp
  pop    %rbx
  ret
L17:
  fstpl  0x30(%rsp)
  movsd  0x30(%rsp),%xmm0
  movl   $0x3,(%rdi)
  ucomisd %xmm0,%xmm1
  ja     L0
  fxch   %st(1)
  sqrtsd %xmm0,%xmm0
  movsd  %xmm0,0x30(%rsp)
L51:
  fstpt  0x10(%rsp)
  fdivl  0x30(%rsp)
  sub    $0x10,%rsp
  fstpt  (%rsp)
  call   <acos@plt>
  fldt   0x20(%rsp)
  pxor   %xmm1,%xmm1
  movsd  %xmm0,0x40(%rsp)
  fstpl  0x20(%rsp)
  movsd  0x20(%rsp),%xmm2
  pop    %rcx
  pop    %rsi
  ucomisd %xmm2,%xmm1
  ja     L27
  movsd  D28(%rip),%xmm6
  movapd %xmm2,%xmm4
  movsd  D35(%rip),%xmm7
  sqrtsd %xmm4,%xmm4
  divsd  %xmm6,%xmm0
  movsd  %xmm6,0x10(%rsp)
  movsd  %xmm7,0x38(%rsp)
  movsd  %xmm4,0x40(%rsp)
  mulsd  %xmm7,%xmm4
  movsd  %xmm4,0x20(%rsp)
  call   <cos@plt>
  fldt   (%rsp)
  movsd  0x20(%rsp),%xmm7
  mov    $0x1,%edi
  fdivs  0xc61(%rip)        # 2000 <_fini+0xa8c>
  mulsd  %xmm0,%xmm7
  movsd  %xmm7,0x48(%rsp)
  fld    %st(0)
  fstpt  (%rsp)
  fsubrl 0x48(%rsp)
  fstpl  (%rbx)
  call   <atan@plt>
  pxor   %xmm0,%xmm0
  shl    $0x2,%eax
  cvtsi2sd %eax,%xmm0
  addsd  %xmm0,%xmm0
  addsd  0x30(%rsp),%xmm0
  divsd  0x10(%rsp),%xmm0
  call   <cos@plt>
  mulsd  0x20(%rsp),%xmm0
  fldt   (%rsp)
  movsd  %xmm0,0x20(%rsp)
  fsubrl 0x20(%rsp)
  fstpl  0x8(%rbx)
L26:
  mov    $0x1,%edi
  call   <atan@plt>
  pxor   %xmm0,%xmm0
  shl    $0x2,%eax
  cvtsi2sd %eax,%xmm0
  mulsd  D37(%rip),%xmm0
  addsd  0x30(%rsp),%xmm0
  divsd  0x10(%rsp),%xmm0
  call   <cos@plt>
  fldt   (%rsp)
  movapd %xmm0,%xmm1
  movsd  0x40(%rsp),%xmm0
  mulsd  0x38(%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,0x30(%rsp)
  fsubrl 0x30(%rsp)
  fstpl  0x10(%rbx)
  add    $0x50,%rsp
  pop    %rbx
  ret
L25:
  fstpt  0x20(%rsp)
  fstpt  0x10(%rsp)
  call   <sqrt@plt>
  fldt   0x20(%rsp)
  movsd  %xmm0,0x30(%rsp)
  fldt   0x10(%rsp)
  jmp    L5
L0:
  fstpt  0x20(%rsp)
  fstpt  0x10(%rsp)
  call   <sqrt@plt>
  fldt   0x20(%rsp)
  movsd  %xmm0,0x30(%rsp)
  fldt   0x10(%rsp)
  jmp    L51
L27:
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x40(%rsp)
  call   <sqrt@plt>
  movsd  D28(%rip),%xmm7
  movsd  %xmm0,0x20(%rsp)
  movsd  0x30(%rsp),%xmm0
  movsd  %xmm7,0x10(%rsp)
  divsd  %xmm7,%xmm0
  call   <cos@plt>
  fldt   (%rsp)
  movsd  D35(%rip),%xmm5
  movsd  0x20(%rsp),%xmm1
  fdivs  0xb30(%rip)        # 2000 <_fini+0xa8c>
  movsd  0x40(%rsp),%xmm2
  movsd  %xmm5,0x38(%rsp)
  mulsd  %xmm5,%xmm1
  movapd %xmm1,%xmm4
  mulsd  %xmm0,%xmm4
  movapd %xmm2,%xmm0
  movsd  %xmm4,0x20(%rsp)
  fld    %st(0)
  fstpt  (%rsp)
  fsubrl 0x20(%rsp)
  fstpl  (%rbx)
  call   <sqrt@plt>
  mov    $0x1,%edi
  movsd  %xmm0,0x20(%rsp)
  call   <atan@plt>
  pxor   %xmm0,%xmm0
  shl    $0x2,%eax
  cvtsi2sd %eax,%xmm0
  addsd  %xmm0,%xmm0
  addsd  0x30(%rsp),%xmm0
  divsd  0x10(%rsp),%xmm0
  call   <cos@plt>
  movsd  0x20(%rsp),%xmm1
  fldt   (%rsp)
  movapd %xmm0,%xmm3
  movsd  0x40(%rsp),%xmm2
  mulsd  0x38(%rsp),%xmm1
  movapd %xmm1,%xmm0
  mulsd  %xmm3,%xmm0
  movsd  %xmm0,0x20(%rsp)
  fsubrl 0x20(%rsp)
  movapd %xmm2,%xmm0
  fstpl  0x8(%rbx)
  call   <sqrt@plt>
  movsd  %xmm0,0x40(%rsp)
  jmp    L26
```

tool_calls: name: parse_data
arguments: data_label: D19
type: f32[4]
name: parse_data
arguments: data_label: D28
type: f32[2]
name: parse_data
arguments: data_label: D35
type: f32[2]
name: parse_data
arguments: data_label: D37
type: f64

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

tool: {"D28": [0.0,2.125]}

tool: {"D35": [0.0,-2.0]}

tool: D37: 4

assistant: ```c
void SolveCubic(double a, double b, double c, double d, int *solutions, double *x) {
  long double a1 = b / a, a2 = c / a, a3 = d / a;
  long double Q = (a1 * a1 - 3.0 * a2) / 9.0;
  long double R = (2.0 * a1 * a1 * a1 - 9.0 * a1 * a2 + 27.0 * a3) / 54.0;
  double R2_Q3 = R * R - Q * Q * Q;
  double theta;
  if (R2_Q3 <= 0) {
    *solutions = 3;
    theta = acos(R / sqrt(Q * Q * Q));
    x[0] = -2.0 * sqrt(Q) * cos(theta / 3.0) - a1 / 3.0;
    x[1] = -2.0 * sqrt(Q) * cos((theta + 2.0 * (4 * atan(1))) / 3.0) - a1 / 3.0;
    x[2] = -2.0 * sqrt(Q) * cos((theta + 4.0 * (4 * atan(1))) / 3.0) - a1 / 3.0;
  } else {
    *solutions = 1;
    x[0] = pow(sqrt(R2_Q3) + fabs(R), 1 / 3.0);
    x[0] += Q / x[0];
    x[0] *= (R < 0.0) ? 1 : -1;
    x[0] -= a1 / 3.0;
  }
}
```