user: Converte this assembly snippet into its equivalent C code:

```asm
<binaryStarOrbit>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  movsd  %xmm2,(%rsp)
  movq   %xmm3,%rbx
  movq   %xmm4,%r15
  movq   %xmm5,%rbp
  movsd  %xmm6,0x8(%rsp)
  mov    %rdi,%r14
  mov    %rsi,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movsd  D21(%rip),%xmm3
  movapd %xmm3,%xmm4
  divsd  %xmm7,%xmm4
  movapd %xmm4,%xmm2
  subsd  %xmm1,%xmm0
  mulsd  %xmm0,%xmm2
  movsd  %xmm2,0x18(%rsp)
  lea    0x18(%rsp),%rdi
  movapd %xmm3,%xmm0
  mov    $0x1,%eax
  call   <range@plt>
  movsd  (%rsp),%xmm1
  movsd  0x18(%rsp),%xmm0
  mov    $0x2,%eax
  call   <solveKepler@plt>
  mov    %eax,%r12d
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  call   <cos@plt>
  movapd %xmm0,%xmm2
  movsd  (%rsp),%xmm5
  subsd  %xmm5,%xmm2
  movapd %xmm0,%xmm1
  mulsd  %xmm5,%xmm1
  movsd  D11(%rip),%xmm3
  movapd %xmm3,%xmm4
  subsd  %xmm1,%xmm4
  divsd  %xmm4,%xmm2
  movapd %xmm2,%xmm0
  movapd %xmm5,%xmm2
  mulsd  %xmm5,%xmm2
  movapd %xmm3,%xmm1
  subsd  %xmm2,%xmm1
  movsd  0x8(%rsp),%xmm2
  mulsd  %xmm1,%xmm2
  mulsd  %xmm0,%xmm5
  movapd %xmm5,%xmm1
  addsd  %xmm3,%xmm1
  divsd  %xmm1,%xmm2
  movsd  %xmm2,0x8(%rsp)
  call   <acos@plt>
  cmp    $0x3,%r12d
  jle    L6
  xorpd  D81(%rip),%xmm0
L6:
  movq   %rbx,%xmm1
  mulsd  D18(%rip),%xmm1
  divsd  D113(%rip),%xmm1
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rbx
  movapd %xmm1,%xmm0
  call   <tan@plt>
  movq   %xmm0,%r12
  movq   %rbp,%xmm0
  mulsd  D18(%rip),%xmm0
  divsd  D113(%rip),%xmm0
  call   <cos@plt>
  movq   %r12,%xmm7
  mulsd  %xmm0,%xmm7
  movapd %xmm7,%xmm0
  call   <atan@plt>
  movapd %xmm0,%xmm1
  movsd  D18(%rip),%xmm0
  movq   %r15,%xmm7
  mulsd  %xmm7,%xmm0
  movapd %xmm0,%xmm6
  divsd  D113(%rip),%xmm6
  movsd  %xmm6,(%rsp)
  addsd  %xmm6,%xmm1
  movq   %xmm1,%rbp
  movq   %rbx,%xmm0
  call   <cos@plt>
  movq   %xmm0,%rbx
  movq   %rbp,%xmm0
  subsd  (%rsp),%xmm0
  call   <cos@plt>
  movq   %rbx,%xmm1
  mulsd  0x8(%rsp),%xmm1
  divsd  %xmm0,%xmm1
  movq   %xmm1,%rbx
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  ja     L9
  mov    %rbp,0x20(%rsp)
L8:
  lea    0x20(%rsp),%rdi
  movsd  D21(%rip),%xmm0
  mov    $0x1,%eax
  call   <range@plt>
  movsd  0x20(%rsp),%xmm0
  movsd  %xmm0,(%r14)
  mov    %rbx,0x0(%r13)
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L38
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L9:
  movq   %rbp,%xmm0
  addsd  D18(%rip),%xmm0
  movsd  %xmm0,0x20(%rsp)
  movapd %xmm1,%xmm7
  xorpd  D81(%rip),%xmm7
  movq   %xmm7,%rbx
  jmp    L8
L38:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D21
data_type: byte[8]
name: disassemble_data
arguments: label: D11
data_type: f64
name: disassemble_data
arguments: label: D81
data_type: byte[16]
name: disassemble_data
arguments: label: D18
data_type: f64
name: disassemble_data
arguments: label: D113
data_type: f64

tool: {"D21": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x19,0x40]}

tool: D11: 1

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

tool: D18: 3.141592653589793

tool: D113: 180

assistant: ```c
void binaryStarOrbit(double t, double T, double e, double o, double O, double i, double a, double P, double *thetap, double *rhop) {
  double M, E, cosE, nu, cosnu, r, rho, theta;
  M = 2 * 3.141592653589793 / P * (t - T);
  range(&M, 2 * 3.141592653589793);
  E = solveKepler(M, e);
  cosE = cos(E);
  cosnu = (cosE - e) / (1.0 - e * cosE);
  r = a * (1.0 - e * e) / (1.0 + e * cosnu);
  nu = acos(cosnu);
  if (E > 3.141592653589793)
    nu = -nu;
  theta = atan(tan(nu + ((o)*3.141592653589793 / 180.)) * cos(((i)*3.141592653589793 / 180.))) + ((O)*3.141592653589793 / 180.);
  rho = r * cos(nu + ((o)*3.141592653589793 / 180.)) / cos(theta - ((O)*3.141592653589793 / 180.));
  if (rho < 0) {
    theta += 3.141592653589793;
    rho = -rho;
  }
  range(&theta, 2 * 3.141592653589793);
  *thetap = theta;
  *rhop = rho;
}
```