user: Please show me the C implementation that matches the assembly code listed below:

```asm
<cmxx_ejec>:
  endbr64
  push   %r15
  mulsd  %xmm2,%xmm2
  mov    %r8d,%eax
  mov    %r9d,%r10d
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %rsi,0x40(%rsp)
  mov    0xd0(%rsp),%rsi
  mov    %rdi,0x38(%rsp)
  mov    0xd8(%rsp),%r12
  mov    %rdx,%rdi
  mov    %r9d,0x54(%rsp)
  mov    0xc0(%rsp),%r15
  mov    %rsi,%r9
  mov    %rsi,0x58(%rsp)
  mov    0xc8(%rsp),%rbx
  mov    %eax,%esi
  mov    %rdx,0x48(%rsp)
  mov    0xe0(%rsp),%r13
  movsd  %xmm0,0x18(%rsp)
  mov    0xf0(%rsp),%rbp
  mov    %rbx,%r8
  movsd  %xmm1,0x8(%rsp)
  mov    %fs:0x28,%rdx
  mov    %rdx,0x78(%rsp)
  xor    %edx,%edx
  test   %ecx,%ecx
  mov    $0x2,%edx
  movsd  %xmm2,0x10(%rsp)
  cmovle %edx,%r14d
  lea    0x70(%rsp),%rdx
  mov    %r15,%rcx
  movl   $0x0,0x60(%rsp)
  movl   $0x0,0x64(%rsp)
  movq   $0x0,0x68(%rsp)
  movq   $0x0,0x70(%rsp)
  push   %rdx
  mov    %r10d,%edx
  push   %r12
  mov    %eax,0x60(%rsp)
  call   <cmxx_en@plt>
  movsd  %xmm0,0x40(%rsp)
  pop    %rcx
  pop    %rsi
  mov    0x50(%rsp),%eax
  cmp    %eax,%r14d
  jge    L113
  movslq %r14d,%rdx
  lea    -0x1(%rax),%r9d
  mov    %r12,%rcx
  movsd  0x18(%rsp),%xmm4
  lea    0x1(%rdx),%r8
  sub    %r14d,%r9d
  mov    %rbp,%r12
  movsd  0x10(%rsp),%xmm2
  add    %r8,%r9
  mov    %r8,%rbp
  xor    %r14d,%r14d
  mov    %r13,%r8
  mov    %r9,%r13
  jmp    L91
  nopw   0x0(%rax,%rax,1)
L31:
  test   %eax,%eax
  jne    L53
  movsd  %xmm4,0x68(%rsp)
L119:
  mov    %rbp,%rdx
  cmp    %rbp,%r13
  je     L129
L103:
  add    $0x1,%rbp
L91:
  mov    (%rbx,%rdx,8),%rax
  movsd  (%rax),%xmm0
  movsd  0x8(%rax),%xmm3
  movsd  0x10(%rax),%xmm1
  mulsd  %xmm0,%xmm0
  mulsd  %xmm3,%xmm3
  mulsd  %xmm1,%xmm1
  addsd  %xmm3,%xmm0
  addsd  %xmm1,%xmm0
  comisd %xmm2,%xmm0
  jbe    L21
  mov    (%rcx,%rdx,8),%rax
  pxor   %xmm0,%xmm0
  movl   $0xfffffffd,(%r8,%rdx,4)
  mov    $0x1,%r14d
  movq   $0x0,(%r15,%rdx,8)
  movq   $0x0,0x10(%rax)
  movups %xmm0,(%rax)
L21:
  mov    0x8(%r12),%eax
  cmp    $0x1,%eax
  je     L81
  cmp    $0x3,%eax
  jne    L31
  movapd %xmm4,%xmm0
  mov    %rbp,%rdx
  subsd  0x8(%rsp),%xmm0
  divsd  D1(%rip),%xmm0
  movsd  %xmm0,0x68(%rsp)
  cmp    %rbp,%r13
  jne    L103
L129:
  test   %r14d,%r14d
  je     L13
  mov    0x38(%rsp),%rbp
  mov    %rbx,%r8
  lea    0x8(%rbp),%rax
  push   %rax
  push   %rcx
  mov    0x68(%rsp),%r9
  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(%rbp),%xmm0
  addsd  0x10(%rbp),%xmm0
  movsd  %xmm0,0x10(%rbp)
  movsd  0x40(%rsp),%xmm0
  subsd  0x8(%rax),%xmm0
  addsd  0x10(%rax),%xmm0
  movsd  %xmm0,0x10(%rax)
  pop    %rax
  pop    %rdx
L13:
  mov    0x78(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L12
  add    $0x88,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L53:
  cmp    $0x2,%eax
  jne    L119
  movapd %xmm4,%xmm0
  subsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x68(%rsp)
  jmp    L119
  cs nopw 0x0(%rax,%rax,1)
L81:
  movapd %xmm4,%xmm0
  lea    0x68(%rsp),%rdx
  lea    0x64(%rsp),%rsi
  mov    %r8,0x28(%rsp)
  lea    0x60(%rsp),%rdi
  mov    %rcx,0x20(%rsp)
  movsd  %xmm2,0x18(%rsp)
  movsd  %xmm4,0x10(%rsp)
  call   <cmio_jd2y@plt>
  movsd  0x10(%rsp),%xmm4
  movsd  0x18(%rsp),%xmm2
  mov    0x20(%rsp),%rcx
  mov    0x28(%rsp),%r8
  jmp    L119
  nopl   0x0(%rax)
L113:
  xor    %r14d,%r14d
  jmp    L13
L12:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D1
data_type: f64

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