user: Translate the below assembly code into C programming language:

```asm
<reb_tools_M_to_E>:
  endbr64
  push   %r14
  push   %rbx
  sub    $0x38,%rsp
  movsd  D18(%rip),%xmm7
  movsd  %xmm0,(%rsp)
  comisd %xmm0,%xmm7
  movsd  %xmm1,0x8(%rsp)
  jbe    L86
  movapd %xmm0,%xmm6
  movsd  D63(%rip),%xmm0
  comisd %xmm6,%xmm0
  ja     L37
  movsd  D27(%rip),%xmm0
  movsd  D24(%rip),%xmm3
  movsd  D12(%rip),%xmm2
L41:
  mulsd  (%rsp),%xmm3
  movq   D1(%rip),%xmm4
  movapd %xmm2,%xmm1
  mov    $0x64,%ebx
  movsd  D53(%rip),%xmm7
  movaps %xmm4,0x20(%rsp)
  movq   %xmm7,%r14
  subsd  %xmm3,%xmm1
  subsd  0x8(%rsp),%xmm1
  jmp    L62
  nopw   0x0(%rax,%rax,1)
L49:
  sub    $0x1,%ebx
  je     L29
  movsd  %xmm2,0x18(%rsp)
  call   <cos@plt>
  movsd  0x18(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm1
L62:
  mulsd  (%rsp),%xmm0
  movsd  D18(%rip),%xmm3
  subsd  %xmm0,%xmm3
  divsd  %xmm3,%xmm1
  subsd  %xmm1,%xmm2
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x10(%rsp)
  call   <sin@plt>
  mulsd  (%rsp),%xmm0
  movsd  0x10(%rsp),%xmm2
  movq   %r14,%xmm7
  movapd 0x20(%rsp),%xmm4
  movapd %xmm2,%xmm1
  subsd  %xmm0,%xmm1
  subsd  0x8(%rsp),%xmm1
  movapd %xmm2,%xmm0
  andpd  %xmm1,%xmm4
  movsd  %xmm1,0x10(%rsp)
  comisd %xmm4,%xmm7
  jbe    L49
L29:
  add    $0x38,%rsp
  pop    %rbx
  pop    %r14
  jmp    10f0 <mod2pi@plt>
  nopl   0x0(%rax,%rax,1)
L37:
  movapd %xmm1,%xmm0
  call   <sin@plt>
  movsd  %xmm0,0x10(%rsp)
  movsd  0x8(%rsp),%xmm0
  call   <cos@plt>
  movsd  0x8(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm3
  jmp    L41
  nopl   0x0(%rax,%rax,1)
L86:
  movq   D1(%rip),%xmm7
  mov    $0x64,%ebx
  movapd %xmm7,%xmm5
  movaps %xmm7,0x20(%rsp)
  movsd  0x8(%rsp),%xmm7
  movapd %xmm7,%xmm0
  movapd %xmm7,%xmm4
  andpd  %xmm5,%xmm0
  divsd  %xmm0,%xmm4
  addsd  %xmm0,%xmm0
  divsd  (%rsp),%xmm0
  addsd  D40(%rip),%xmm0
  cvttsd2si %xmm0,%edi
  movsd  %xmm4,0x10(%rsp)
  call   <log@plt>
  movsd  0x10(%rsp),%xmm2
  mulsd  %xmm0,%xmm2
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x10(%rsp)
  call   <sinh@plt>
  mulsd  (%rsp),%xmm0
  movsd  0x10(%rsp),%xmm2
  movsd  D53(%rip),%xmm4
  movapd %xmm2,%xmm1
  movq   %xmm4,%r14
  subsd  %xmm0,%xmm1
  addsd  0x8(%rsp),%xmm1
  jmp    L72
  nopl   (%rax)
L80:
  sub    $0x1,%ebx
  je     L52
L72:
  movapd %xmm2,%xmm0
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm2,0x10(%rsp)
  call   <cosh@plt>
  mulsd  (%rsp),%xmm0
  movsd  D18(%rip),%xmm3
  movsd  0x18(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm2
  subsd  %xmm0,%xmm3
  divsd  %xmm3,%xmm1
  subsd  %xmm1,%xmm2
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x10(%rsp)
  call   <sinh@plt>
  mulsd  (%rsp),%xmm0
  movsd  0x10(%rsp),%xmm2
  movq   %r14,%xmm5
  movapd 0x20(%rsp),%xmm6
  movapd %xmm2,%xmm1
  subsd  %xmm0,%xmm1
  addsd  0x8(%rsp),%xmm1
  andpd  %xmm1,%xmm6
  comisd %xmm6,%xmm5
  jbe    L80
L52:
  add    $0x38,%rsp
  movapd %xmm2,%xmm0
  pop    %rbx
  pop    %r14
  ret
```

tool_calls: name: read_data
arguments: tag: D18
datatype: f64
name: read_data
arguments: tag: D63
datatype: f64
name: read_data
arguments: tag: D27
datatype: byte[8]
name: read_data
arguments: tag: D24
datatype: byte[8]
name: read_data
arguments: tag: D12
datatype: f64
name: read_data
arguments: tag: D1
datatype: qword
name: read_data
arguments: tag: D53
datatype: byte[8]
name: read_data
arguments: tag: D40
datatype: f64

tool: D18: 1

tool: D63: 0.8

tool: {"D27": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: {"D24": [0x07,0x5c,0x14,0x33,0x26,0xa6,0xa1,0x3c]}

tool: D12: 3.141592653589793

tool: D1: 9223372036854775807

tool: {"D53": [0xbc,0x89,0xd8,0x97,0xb2,0xd2,0x9c,0x3c]}

tool: D40: 1.8

assistant: ```c
double reb_tools_M_to_E(double e, double M) {
  double E;
  if (e < 1.) {
    E = e < 0.8 ? M : 3.14159265358979323846;
    double F = E - e * sin(E) - M;
    for (int i = 0; i < 100; i++) {
      E = E - F / (1. - e * cos(E));
      F = E - e * sin(E) - M;
      if (fabs(F) < 1.e-16) {
        break;
      }
    }
    E = mod2pi(E);
    return E;
  } else {
    E = M / fabs(M) * log(2. * fabs(M) / e + 1.8);
    double F = E - e * sinh(E) + M;
    for (int i = 0; i < 100; i++) {
      E = E - F / (1.0 - e * cosh(E));
      F = E - e * sinh(E) + M;
      if (fabs(F) < 1.e-16) {
        break;
      }
    }
    return E;
  }
}
```