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

```asm
<cmxx_ejec>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  movsd  %xmm0,0x10(%rsp)
  movsd  %xmm1,0x28(%rsp)
  mov    %rdi,0x38(%rsp)
  mov    %rsi,0x40(%rsp)
  mov    %rdx,%rdi
  mov    %rdx,0x48(%rsp)
  mov    %ecx,%r14d
  mov    %r8d,%ebx
  mov    %r8d,0x50(%rsp)
  mov    %r9d,%edx
  mov    %r9d,0x54(%rsp)
  mov    0xc0(%rsp),%r15
  mov    0xc8(%rsp),%r12
  mov    0xd0(%rsp),%rcx
  mov    %rcx,0x58(%rsp)
  mov    0xd8(%rsp),%rbp
  mov    0xe0(%rsp),%rax
  mov    %rax,0x20(%rsp)
  mov    0xf0(%rsp),%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x78(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x60(%rsp)
  movl   $0x0,0x64(%rsp)
  movq   $0x0,0x68(%rsp)
  movq   $0x0,0x70(%rsp)
  test   %r14d,%r14d
  mov    $0x2,%eax
  cmovle %eax,%r14d
  mulsd  %xmm2,%xmm2
  movsd  %xmm2,0x8(%rsp)
  lea    0x70(%rsp),%rax
  push   %rax
  push   %rbp
  mov    %rcx,%r9
  mov    %r12,%r8
  mov    %r15,%rcx
  mov    %ebx,%esi
  call   <cmxx_en@plt>
  movsd  %xmm0,0x40(%rsp)
  add    $0x10,%rsp
  cmp    %ebx,%r14d
  jge    L67
  mov    %ebx,%esi
  movslq %r14d,%rbx
  lea    -0x1(%rsi),%eax
  sub    %r14d,%eax
  lea    0x1(%rbx,%rax,1),%r14
  movl   $0x0,0x1c(%rsp)
  jmp    L63
L135:
  lea    0x68(%rsp),%rdx
  lea    0x64(%rsp),%rsi
  lea    0x60(%rsp),%rdi
  movsd  0x10(%rsp),%xmm0
  call   <cmio_jd2y@plt>
  jmp    L85
L41:
  movsd  0x10(%rsp),%xmm0
  subsd  0x28(%rsp),%xmm0
  divsd  D6(%rip),%xmm0
  movsd  %xmm0,0x68(%rsp)
L85:
  add    $0x1,%rbx
  cmp    %r14,%rbx
  je     L52
L63:
  mov    (%r12,%rbx,8),%rax
  movsd  (%rax),%xmm0
  movsd  0x8(%rax),%xmm2
  movsd  0x10(%rax),%xmm1
  mulsd  %xmm0,%xmm0
  mulsd  %xmm2,%xmm2
  addsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  comisd 0x8(%rsp),%xmm0
  jbe    L59
  mov    0x20(%rsp),%rax
  movl   $0xfffffffd,(%rax,%rbx,4)
  movq   $0x0,(%r15,%rbx,8)
  mov    0x0(%rbp,%rbx,8),%rax
  movq   $0x0,(%rax)
  mov    0x0(%rbp,%rbx,8),%rax
  movq   $0x0,0x8(%rax)
  mov    0x0(%rbp,%rbx,8),%rax
  movq   $0x0,0x10(%rax)
  movl   $0x1,0x1c(%rsp)
L59:
  mov    0x8(%r13),%eax
  cmp    $0x1,%eax
  je     L135
  cmp    $0x3,%eax
  je     L41
  test   %eax,%eax
  jne    L66
  movsd  0x10(%rsp),%xmm5
  movsd  %xmm5,0x68(%rsp)
  jmp    L85
L66:
  cmp    $0x2,%eax
  jne    L85
  movsd  0x10(%rsp),%xmm0
  subsd  0x28(%rsp),%xmm0
  movsd  %xmm0,0x68(%rsp)
  jmp    L85
L52:
  cmpl   $0x0,0x1c(%rsp)
  jne    L76
L130:
  mov    0x78(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  mov    0x1c(%rsp),%eax
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L76:
  mov    0x38(%rsp),%rbx
  lea    0x8(%rbx),%rax
  push   %rax
  push   %rbp
  mov    0x68(%rsp),%r9
  mov    %r12,%r8
  mov    %r15,%rcx
  mov    0x64(%rsp),%edx
  mov    0x60(%rsp),%esi
  mov    0x58(%rsp),%rdi
  call   <cmxx_en@plt>
  mov    0x50(%rsp),%rax
  movsd  %xmm0,0x8(%rax)
  movsd  0x80(%rsp),%xmm0
  subsd  0x8(%rbx),%xmm0
  addsd  0x10(%rbx),%xmm0
  movsd  %xmm0,0x10(%rbx)
  movsd  0x40(%rsp),%xmm0
  subsd  0x8(%rax),%xmm0
  addsd  0x10(%rax),%xmm0
  movsd  %xmm0,0x10(%rax)
  add    $0x10,%rsp
  jmp    L130
L67:
  movl   $0x0,0x1c(%rsp)
  jmp    L130
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D6
datatype: f64

tool: D6: 365.25

assistant: ```c
int cmxx_ejec(double time, double tstart, double rmax, double en[3], double am[3], double jcen[3], int i0, int nbod, int nbig, double *m, const double **restrict x, const double **restrict v, double **s, int *stat, char **id, int opt[8], FILE *outfile, char mem[200], char lmem[200]) {
  int year = 0, month = 0;
  double r2 = 0.0, rmax2 = 0.0, t1 = 0.0, e = 0.0, l = 0.0;
  if (i0 <= 0) {
    i0 = 2;
  }
  int ejflag = 0;
  rmax2 = rmax * rmax;
  l = cmxx_en(jcen, nbod, nbig, m, x, v, s, &e);
  for (int j = i0; j < nbod; j++) {
    r2 = x[j][0] * x[j][0] + x[j][1] * x[j][1] + x[j][2] * x[j][2];
    if (r2 > rmax2) {
      ejflag = 1;
      stat[j] = -3;
      m[j] = 0.0;
      s[j][0] = 0.0;
      s[j][1] = 0.0;
      s[j][2] = 0.0;
    }
    if (opt[2] == 1) {
      cmio_jd2y(time, &year, &month, &t1);
    } else {
      if (opt[2] == 3) {
        t1 = (time - tstart) / 365.250;
        ;
      } else {
        if (opt[2] == 0) {
          t1 = time;
        }
        if (opt[2] == 2) {
          t1 = time - tstart;
        }
      }
    }
  }
  if (ejflag) {
    am[1] = cmxx_en(jcen, nbod, nbig, m, x, v, s, &en[1]);
    en[2] = en[2] + (e - en[1]);
    am[2] = am[2] + (l - am[1]);
  }
  return ejflag;
}
```