user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<ellipse2param>:
  endbr64
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x58,%rsp
  test   %rdi,%rdi
  je     L92
L67:
  test   %rbp,%rbp
  je     L15
L78:
  movsd  (%rbx),%xmm2
  movsd  0x28(%rbx),%xmm1
  movsd  0x8(%rbx),%xmm3
  movsd  0x20(%rbx),%xmm6
  movsd  %xmm1,0x30(%rsp)
  movapd %xmm2,%xmm1
  movsd  0x10(%rbx),%xmm4
  mov    0x40(%rbx),%rbx
  addsd  %xmm3,%xmm3
  subsd  %xmm6,%xmm1
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm6,(%rsp)
  movsd  %xmm4,0x28(%rsp)
  movapd %xmm3,%xmm0
  movsd  %xmm3,0x20(%rsp)
  call   <atan2@plt>
  lea    0x48(%rsp),%rdi
  lea    0x40(%rsp),%rsi
  movsd  D81(%rip),%xmm4
  mulsd  %xmm0,%xmm4
  movapd %xmm4,%xmm0
  movsd  %xmm4,0x38(%rsp)
  call   <sincos@plt>
  movsd  0x20(%rsp),%xmm3
  movsd  (%rsp),%xmm6
  mov    $0x0,%edx
  movsd  0x40(%rsp),%xmm9
  movsd  0x48(%rsp),%xmm10
  movsd  0x10(%rsp),%xmm2
  movapd %xmm9,%xmm1
  movapd %xmm10,%xmm0
  movapd %xmm9,%xmm7
  mulsd  %xmm10,%xmm1
  movapd %xmm2,%xmm5
  movapd %xmm10,%xmm8
  mulsd  %xmm9,%xmm7
  movapd %xmm9,%xmm11
  unpcklpd %xmm9,%xmm8
  mulsd  %xmm10,%xmm0
  unpcklpd %xmm10,%xmm11
  mulsd  %xmm3,%xmm1
  movapd %xmm6,%xmm3
  mulsd  %xmm7,%xmm5
  mulsd  %xmm0,%xmm3
  mulsd  %xmm7,%xmm6
  pxor   %xmm7,%xmm7
  mulsd  %xmm0,%xmm2
  addsd  %xmm3,%xmm5
  addsd  %xmm6,%xmm2
  addsd  %xmm1,%xmm5
  subsd  %xmm1,%xmm2
  ucomisd %xmm7,%xmm5
  setnp  %al
  cmovne %edx,%eax
  test   %al,%al
  jne    L30
  ucomisd %xmm7,%xmm2
  setnp  %dl
  cmove  %edx,%eax
  test   %al,%al
  jne    L30
  movsd  0x28(%rsp),%xmm3
  movsd  0x30(%rsp),%xmm1
  movapd %xmm5,%xmm12
  addsd  %xmm5,%xmm12
  movsd  0x38(%rsp),%xmm4
  addsd  %xmm3,%xmm3
  addsd  %xmm1,%xmm1
  movsd  %xmm4,0x20(%rsp)
  movapd %xmm3,%xmm0
  movapd %xmm1,%xmm6
  mulsd  %xmm10,%xmm6
  mulsd  %xmm9,%xmm0
  mulsd  %xmm10,%xmm3
  mulsd  %xmm9,%xmm1
  addsd  %xmm6,%xmm0
  movq   D26(%rip),%xmm6
  subsd  %xmm3,%xmm1
  movapd %xmm2,%xmm3
  addsd  %xmm2,%xmm3
  xorpd  %xmm6,%xmm0
  divsd  %xmm12,%xmm0
  xorpd  %xmm6,%xmm1
  divsd  %xmm3,%xmm1
  movapd %xmm0,%xmm12
  unpcklpd %xmm12,%xmm12
  mulpd  %xmm12,%xmm11
  movapd %xmm1,%xmm3
  unpcklpd %xmm3,%xmm3
  mulpd  %xmm8,%xmm3
  movapd %xmm11,%xmm8
  subpd  %xmm3,%xmm8
  addpd  %xmm3,%xmm11
  movapd %xmm5,%xmm3
  mulsd  %xmm0,%xmm3
  shufpd $0x2,%xmm11,%xmm8
  movaps %xmm8,0x10(%rsp)
  mulsd  %xmm3,%xmm0
  movq   %rbx,%xmm3
  subsd  %xmm0,%xmm3
  movapd %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  %xmm1,%xmm0
  subsd  %xmm0,%xmm3
  xorpd  %xmm6,%xmm3
  movapd %xmm3,%xmm0
  divsd  %xmm5,%xmm0
  divsd  %xmm2,%xmm3
  comisd %xmm7,%xmm0
  movsd  %xmm3,(%rsp)
  jbe    L105
  mov    D81(%rip),%rax
  movq   %rax,%xmm1
  call   <pow@plt>
  movsd  0x20(%rsp),%xmm4
  movsd  (%rsp),%xmm3
  pxor   %xmm7,%xmm7
  movapd 0x10(%rsp),%xmm8
  movq   D26(%rip),%xmm6
  movq   %xmm0,%rbx
L50:
  comisd %xmm7,%xmm3
  movaps %xmm8,(%rsp)
  movsd  %xmm4,0x20(%rsp)
  jbe    L36
  mov    D81(%rip),%rax
  movapd %xmm3,%xmm0
  movq   %rax,%xmm1
  call   <pow@plt>
  movsd  0x20(%rsp),%xmm4
  movapd (%rsp),%xmm8
L6:
  movq   %rbx,%xmm1
  unpcklpd %xmm0,%xmm1
  jmp    L109
  xchg   %ax,%ax
L30:
  pxor   %xmm1,%xmm1
  movapd %xmm7,%xmm4
  movapd %xmm1,%xmm8
L109:
  movups %xmm8,0x0(%rbp)
  movups %xmm1,0x10(%rbp)
  movsd  %xmm4,0x20(%rbp)
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L105:
  mov    D81(%rip),%rax
  xorpd  %xmm6,%xmm0
  movq   %rax,%xmm1
  call   <pow@plt>
  movapd 0x10(%rsp),%xmm8
  movsd  (%rsp),%xmm3
  pxor   %xmm7,%xmm7
  movq   D26(%rip),%xmm6
  movsd  0x20(%rsp),%xmm4
  xorpd  %xmm6,%xmm0
  movq   %xmm0,%rbx
  jmp    L50
  nopl   0x0(%rax)
L36:
  mov    D81(%rip),%rax
  movapd %xmm3,%xmm0
  xorpd  %xmm6,%xmm0
  movq   %rax,%xmm1
  call   <pow@plt>
  movq   D26(%rip),%xmm6
  movapd (%rsp),%xmm8
  movsd  0x20(%rsp),%xmm4
  xorpd  %xmm6,%xmm0
  jmp    L6
  cs nopw 0x0(%rax,%rax,1)
L15:
  lea    D75(%rip),%rdi
  call   <error@plt>
  jmp    L78
  nopl   0x0(%rax)
L92:
  lea    D55(%rip),%rdi
  call   <error@plt>
  jmp    L67
```

tool_calls: name: parse_data
arguments: data_label: D81
type_infered: f64
name: parse_data
arguments: data_label: D26
type_infered: byte[8]
name: parse_data
arguments: data_label: D75
type_infered: string
name: parse_data
arguments: data_label: D55
type_infered: string

tool: D81: 0.5

tool: {"D26": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

tool: D75: ellipse2param: output 'param' should be non-null

tool: D55: ellipse2param: null input ellipse matrix.

assistant: ```c
void ellipse2param(double *p, double *param) {
  double a, b, c, d, e, f;
  double thetarad, cost, sint, cos_squared, sin_squared, cos_sin;
  double Ao, Au, Av, Auu, Avv;
  double tuCentre, tvCentre, wCentre, uCentre, vCentre, Ru, Rv;
  if (p == NULL)
    error("ellipse2param: null input ellipse matrix.");
  if (param == NULL)
    error("ellipse2param: output 'param' should be non-null");
  a = p[0];
  b = 2 * p[1];
  c = p[4];
  d = 2 * p[2];
  e = 2 * p[5];
  f = p[8];
  thetarad = 0.5 * atan2(b, a - c);
  cost = cos(thetarad);
  sint = sin(thetarad);
  sin_squared = sint * sint;
  cos_squared = cost * cost;
  cos_sin = sint * cost;
  Ao = f;
  Au = d * cost + e * sint;
  Av = -d * sint + e * cost;
  Auu = a * cos_squared + c * sin_squared + b * cos_sin;
  Avv = a * sin_squared + c * cos_squared - b * cos_sin;
  if ((Auu == 0) || (Avv == 0)) {
    param[0] = 0;
    param[1] = 0;
    param[2] = 0;
    param[3] = 0;
    param[4] = 0;
  } else {
    tuCentre = -Au / (2. * Auu);
    tvCentre = -Av / (2. * Avv);
    wCentre = Ao - Auu * tuCentre * tuCentre - Avv * tvCentre * tvCentre;
    uCentre = tuCentre * cost - tvCentre * sint;
    vCentre = tuCentre * sint + tvCentre * cost;
    Ru = -wCentre / Auu;
    Rv = -wCentre / Avv;
    if (Ru > 0)
      Ru = pow(Ru, 0.5);
    else
      Ru = -pow(-Ru, 0.5);
    if (Rv > 0)
      Rv = pow(Rv, 0.5);
    else
      Rv = -pow(-Rv, 0.5);
    param[0] = uCentre;
    param[1] = vCentre;
    param[2] = Ru;
    param[3] = Rv;
    param[4] = thetarad;
  }
}
```