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    L77
  fstp   %st(0)
  ucomisd %xmm0,%xmm1
  movl   $0x1,(%rdi)
  ja     L41
  fxch   %st(1)
  sqrtsd %xmm0,%xmm0
  movsd  %xmm0,0x30(%rsp)
L0:
  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     L50
  movsd  0x30(%rsp),%xmm5
  xorpd  D38(%rip),%xmm5
  movsd  %xmm5,0x30(%rsp)
L50:
  fldt   (%rsp)
  fdivs  0xd1c(%rip)        # 2000 <_fini+0xa8c>
  fsubrl 0x30(%rsp)
  fstpl  (%rbx)
  add    $0x50,%rsp
  pop    %rbx
  ret
L77:
  fstpl  0x30(%rsp)
  movsd  0x30(%rsp),%xmm0
  movl   $0x3,(%rdi)
  ucomisd %xmm0,%xmm1
  ja     L38
  fxch   %st(1)
  sqrtsd %xmm0,%xmm0
  movsd  %xmm0,0x30(%rsp)
L35:
  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     L4
  movsd  D17(%rip),%xmm6
  movapd %xmm2,%xmm4
  movsd  D16(%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)
L20:
  mov    $0x1,%edi
  call   <atan@plt>
  pxor   %xmm0,%xmm0
  shl    $0x2,%eax
  cvtsi2sd %eax,%xmm0
  mulsd  D49(%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
L41:
  fstpt  0x20(%rsp)
  fstpt  0x10(%rsp)
  call   <sqrt@plt>
  fldt   0x20(%rsp)
  movsd  %xmm0,0x30(%rsp)
  fldt   0x10(%rsp)
  jmp    L0
L38:
  fstpt  0x20(%rsp)
  fstpt  0x10(%rsp)
  call   <sqrt@plt>
  fldt   0x20(%rsp)
  movsd  %xmm0,0x30(%rsp)
  fldt   0x10(%rsp)
  jmp    L35
L4:
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x40(%rsp)
  call   <sqrt@plt>
  movsd  D17(%rip),%xmm7
  movsd  %xmm0,0x20(%rsp)
  movsd  0x30(%rsp),%xmm0
  movsd  %xmm7,0x10(%rsp)
  divsd  %xmm7,%xmm0
  call   <cos@plt>
  fldt   (%rsp)
  movsd  D16(%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    L20
```

tool_calls: name: disassemble_data
arguments: label: D38
data_type: f32[4]
name: disassemble_data
arguments: label: D17
data_type: f32[2]
name: disassemble_data
arguments: label: D16
data_type: f32[2]
name: disassemble_data
arguments: label: D49
data_type: f64

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

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

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

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