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

```asm
<reb_drift_kepmd>:
  endbr64
  push   %r12
  movapd %xmm0,%xmm6
  movapd %xmm2,%xmm7
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x20,%rsp
  movsd  D10(%rip),%xmm4
  divsd  D37(%rip),%xmm7
  movsd  %xmm6,0x18(%rsp)
  movapd %xmm4,%xmm3
  movapd %xmm4,%xmm0
  movsd  %xmm2,0x10(%rsp)
  subsd  %xmm2,%xmm3
  movsd  %xmm1,0x8(%rsp)
  divsd  %xmm3,%xmm0
  movapd %xmm1,%xmm3
  mulsd  %xmm1,%xmm3
  mulsd  %xmm0,%xmm3
  movapd %xmm0,%xmm5
  mulsd  %xmm6,%xmm5
  mulsd  D4(%rip),%xmm0
  subsd  %xmm7,%xmm3
  movapd %xmm1,%xmm7
  mulsd  %xmm5,%xmm0
  mulsd  %xmm5,%xmm3
  subsd  %xmm3,%xmm7
  movapd %xmm4,%xmm3
  mulsd  %xmm7,%xmm0
  movsd  D14(%rip),%xmm7
  subsd  %xmm0,%xmm3
  mulsd  %xmm5,%xmm3
  movsd  D97(%rip),%xmm5
  movapd %xmm3,%xmm0
  movsd  %xmm3,(%rdi)
  mulsd  %xmm3,%xmm0
  subsd  %xmm0,%xmm5
  mulsd  %xmm0,%xmm5
  subsd  %xmm5,%xmm7
  movsd  D41(%rip),%xmm5
  mulsd  %xmm0,%xmm7
  subsd  %xmm7,%xmm5
  movsd  D153(%rip),%xmm7
  mulsd  %xmm0,%xmm5
  subsd  %xmm5,%xmm7
  movsd  D143(%rip),%xmm5
  mulsd  %xmm0,%xmm7
  movapd %xmm5,%xmm0
  subsd  %xmm7,%xmm0
  mulsd  %xmm3,%xmm0
  movapd %xmm4,%xmm3
  divsd  %xmm5,%xmm0
  movsd  %xmm0,(%rsi)
  mulsd  %xmm0,%xmm0
  subsd  %xmm0,%xmm3
  cvttsd2si %xmm3,%edi
  call   <sqrt@plt>
  mov    D10(%rip),%rax
  movsd  0x10(%rsp),%xmm2
  movsd  %xmm0,(%rbx)
  movsd  0x0(%rbp),%xmm10
  movsd  0x8(%rsp),%xmm1
  movapd %xmm0,%xmm9
  movq   %rax,%xmm3
  movq   %rax,%xmm8
  movq   %rax,%xmm4
  movsd  (%r12),%xmm7
  movapd %xmm10,%xmm11
  subsd  %xmm0,%xmm3
  movsd  0x18(%rsp),%xmm6
  mov    D143(%rip),%rax
  mulsd  %xmm2,%xmm11
  mulsd  %xmm1,%xmm10
  movq   %rax,%xmm5
  mulsd  %xmm0,%xmm2
  movapd %xmm7,%xmm0
  mulsd  %xmm1,%xmm9
  mulsd  %xmm3,%xmm1
  subsd  %xmm11,%xmm0
  subsd  %xmm2,%xmm8
  subsd  %xmm10,%xmm2
  addsd  %xmm11,%xmm9
  addsd  %xmm1,%xmm0
  addsd  %xmm10,%xmm8
  subsd  %xmm6,%xmm0
  xorpd  D124(%rip),%xmm0
  movapd %xmm0,%xmm3
  movapd %xmm0,%xmm1
  divsd  %xmm8,%xmm3
  mulsd  D4(%rip),%xmm3
  mulsd  %xmm9,%xmm3
  addsd  %xmm8,%xmm3
  divsd  %xmm3,%xmm1
  movsd  D141(%rip),%xmm3
  mulsd  %xmm1,%xmm3
  mulsd  %xmm1,%xmm3
  mulsd  D4(%rip),%xmm1
  mulsd  %xmm3,%xmm2
  mulsd  %xmm9,%xmm1
  addsd  %xmm8,%xmm1
  addsd  %xmm1,%xmm2
  movsd  D97(%rip),%xmm1
  divsd  %xmm2,%xmm0
  movsd  D14(%rip),%xmm2
  addsd  %xmm7,%xmm0
  movapd %xmm0,%xmm3
  movsd  %xmm0,(%r12)
  mulsd  %xmm0,%xmm3
  subsd  %xmm3,%xmm1
  mulsd  %xmm3,%xmm1
  subsd  %xmm1,%xmm2
  movsd  D41(%rip),%xmm1
  mulsd  %xmm3,%xmm2
  subsd  %xmm2,%xmm1
  movsd  D153(%rip),%xmm2
  mulsd  %xmm3,%xmm1
  subsd  %xmm1,%xmm2
  movq   %rax,%xmm1
  mulsd  %xmm3,%xmm2
  subsd  %xmm2,%xmm1
  mulsd  %xmm1,%xmm0
  divsd  %xmm5,%xmm0
  movsd  %xmm0,0x0(%rbp)
  mulsd  %xmm0,%xmm0
  subsd  %xmm0,%xmm4
  cvttsd2si %xmm4,%edi
  call   <sqrt@plt>
  movsd  %xmm0,(%rbx)
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: read_data
arguments: data_label: D10
type: f64
name: read_data
arguments: data_label: D37
type: f64
name: read_data
arguments: data_label: D4
type: f64
name: read_data
arguments: data_label: D14
type: f64
name: read_data
arguments: data_label: D97
type: f64
name: read_data
arguments: data_label: D41
type: f64
name: read_data
arguments: data_label: D153
type: f64
name: read_data
arguments: data_label: D143
type: f64
name: read_data
arguments: data_label: D124
type: byte[16]
name: read_data
arguments: data_label: D141
type: f64

tool: D10: 1

tool: D37: 3

tool: D4: 0.5

tool: D14: 7920

tool: D97: 110

tool: D41: 332640

tool: D153: 6652800

tool: D143: 39916800

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

tool: D141: 0.16666666666666666

assistant: ```c
void reb_drift_kepmd(double dm, double es, double ec, double *x, double *s, double *c) {
  const double A0 = 39916800.;
  const double A1 = 6652800.;
  const double A2 = 332640.;
  const double A3 = 7920.;
  const double A4 = 110.;
  double fac1 = 1. / (1. - ec);
  double q = fac1 * dm;
  double fac2 = es * es * fac1 - ec / 3.;
  *x = q * (1. - 0.5 * fac1 * q * (es - q * fac2));
  double y = (*x) * (*x);
  *s = (*x) * (A0 - y * (A1 - y * (A2 - y * (A3 - y * (A4 - y))))) / A0;
  *c = sqrt(1. - (*s) * (*s));
  double f = (*x) - ec * (*s) + es * (1. - (*c)) - dm;
  double fp = 1. - ec * (*c) + es * (*s);
  double fpp = ec * (*s) + es * (*c);
  double fppp = ec * (*c) - es * (*s);
  double dx = -f / fp;
  dx = -f / (fp + 0.5 * dx * fpp);
  dx = -f / (fp + 0.5 * dx * fpp + 0.16666666666666666666 * dx * dx * fppp);
  *x = (*x) + dx;
  y = (*x) * (*x);
  *s = (*x) * (A0 - y * (A1 - y * (A2 - y * (A3 - y * (A4 - y))))) / A0;
  *c = sqrt(1. - (*s) * (*s));
}
```