#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double cos(double);
double cosh(double);
double fabs(double);
double mod2pi(double);
double sin(double);
double sinh(double);
double reb_M_to_E(double e, double M) {
  double E;
  if (e < 1.) {
    E = e < 0.8 ? M : 3.14159265358979323846;
    double F = E - e * sin(M) - 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;
    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;
      }
    }
    E = mod2pi(E);
    return E;
  }
}


x86 assembly (clang, -O0):
<reb_M_to_E>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xe93(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1335 <reb_M_to_E+0x1e5>
movsd  0xe90(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    119a <reb_M_to_E+0x4a>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    11ac <reb_M_to_E+0x5c>
movsd  0xe76(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    11ac <reb_M_to_E+0x5c>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <sin@plt>
movsd  -0x58(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x64,-0x2c(%rbp)
jge    1317 <reb_M_to_E+0x1c7>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1070 <cos@plt>
movsd  -0x80(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x70(%rbp),%xmm0
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
movsd  0xd88(%rip),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1060 <sin@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
movaps 0xd37(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xd13(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1304 <reb_M_to_E+0x1b4>
jmp    1317 <reb_M_to_E+0x1c7>
jmp    1309 <reb_M_to_E+0x1b9>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1211 <reb_M_to_E+0xc1>
movsd  -0x20(%rbp),%xmm0
call   1040 <mod2pi@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14e3 <reb_M_to_E+0x393>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
call   1030 <sinh@plt>
movsd  -0x90(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x88(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x64,-0x3c(%rbp)
jge    14ca <reb_M_to_E+0x37a>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
call   1050 <cosh@plt>
movsd  -0xb8(%rbp),%xmm2
ff
movsd  -0xb0(%rbp),%xmm1
ff
movaps %xmm0,%xmm3
movsd  -0xa8(%rbp),%xmm0
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
movsd  0xbe1(%rip),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
call   1030 <sinh@plt>
movsd  -0xa0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x98(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm1
movaps 0xb84(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xb60(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    14b7 <reb_M_to_E+0x367>
jmp    14ca <reb_M_to_E+0x37a>
jmp    14bc <reb_M_to_E+0x36c>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13a6 <reb_M_to_E+0x256>
movsd  -0x20(%rbp),%xmm0
call   1040 <mod2pi@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reb_M_to_E>:
push   %rbx
sub    $0x40,%rsp
movapd %xmm0,%xmm2
movsd  0xe9f(%rip),%xmm0
ucomisd %xmm2,%xmm0
movapd %xmm1,0x30(%rsp)
movapd %xmm2,0x10(%rsp)
jbe    126e <reb_M_to_E+0x11e>
movapd %xmm2,%xmm3
cmpltsd 0xe8c(%rip),%xmm3
movapd %xmm3,%xmm0
andpd  %xmm1,%xmm0
movsd  0xe84(%rip),%xmm1
andnpd %xmm1,%xmm3
orpd   %xmm0,%xmm3
movapd %xmm3,(%rsp)
movapd 0x30(%rsp),%xmm0
call   1060 <sin@plt>
movapd (%rsp),%xmm1
movapd 0xe67(%rip),%xmm2
movapd 0x10(%rsp),%xmm3
xorpd  %xmm3,%xmm2
movapd %xmm2,0x20(%rsp)
mulsd  %xmm3,%xmm0
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
subsd  0x30(%rsp),%xmm2
mov    $0x63,%ebx
movapd %xmm2,0x10(%rsp)
movapd %xmm1,(%rsp)
movapd %xmm1,%xmm0
call   1070 <cos@plt>
mulsd  0x20(%rsp),%xmm0
addsd  0xdfe(%rip),%xmm0
movapd 0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd (%rsp),%xmm0
subsd  %xmm1,%xmm0
movapd %xmm0,(%rsp)
movapd (%rsp),%xmm0
call   1060 <sin@plt>
movapd (%rsp),%xmm1
movapd %xmm0,%xmm2
mulsd  0x20(%rsp),%xmm2
addsd  %xmm1,%xmm2
subsd  0x30(%rsp),%xmm2
movapd %xmm2,%xmm0
andpd  0xde7(%rip),%xmm0
sub    $0x1,%ebx
setb   %al
movsd  0xdb1(%rip),%xmm3
ucomisd %xmm0,%xmm3
ja     1335 <reb_M_to_E+0x1e5>
test   %al,%al
je     11e0 <reb_M_to_E+0x90>
jmp    1335 <reb_M_to_E+0x1e5>
movapd %xmm1,%xmm0
call   1030 <sinh@plt>
movapd 0x30(%rsp),%xmm1
movapd 0xd9b(%rip),%xmm2
movapd 0x10(%rsp),%xmm3
xorpd  %xmm3,%xmm2
movapd %xmm2,0x20(%rsp)
mulsd  %xmm3,%xmm0
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
subsd  %xmm1,%xmm2
mov    $0x63,%ebx
nopw   0x0(%rax,%rax,1)
movapd %xmm2,0x10(%rsp)
movapd %xmm1,(%rsp)
movapd %xmm1,%xmm0
call   1050 <cosh@plt>
mulsd  0x20(%rsp),%xmm0
addsd  0xd2e(%rip),%xmm0
movapd 0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd (%rsp),%xmm0
subsd  %xmm1,%xmm0
movapd %xmm0,(%rsp)
movapd (%rsp),%xmm0
call   1030 <sinh@plt>
movapd (%rsp),%xmm1
movapd %xmm0,%xmm2
mulsd  0x20(%rsp),%xmm2
addsd  %xmm1,%xmm2
subsd  0x30(%rsp),%xmm2
movapd %xmm2,%xmm0
andpd  0xd17(%rip),%xmm0
sub    $0x1,%ebx
setb   %al
movsd  0xce1(%rip),%xmm3
ucomisd %xmm0,%xmm3
ja     1335 <reb_M_to_E+0x1e5>
test   %al,%al
je     12b0 <reb_M_to_E+0x160>
movapd %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbx
jmp    1040 <mod2pi@plt>

LLVM IR (-O0):
define double @reb_M_to_E(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca double
%10 = alloca i32
store double %0, double* %4
store double %1, double* %5
%11 = load double, double* %4
%12 = fcmp olt double %11, 1.000000e+00
br i1 %12, label %13, label %62
13: ; preds = %2
%14 = load double, double* %4
%15 = fcmp olt double %14, 8.000000e-01
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load double, double* %5
br label %19
18: ; preds = %13
br label %19
19: ; preds = %18, %16
%20 = phi double [ %17, %16 ], [ 0x400921FB54442D18, %18 ]
store double %20, double* %6
%21 = load double, double* %6
%22 = load double, double* %4
%23 = load double, double* %5
%24 = call double @sin(double %23)
%25 = fneg double %22
%26 = call double @llvm.fmuladd.f64(double %25, double %24, double %21)
%27 = load double, double* %5
%28 = fsub double %26, %27
store double %28, double* %7
store i32 0, i32* %8
br label %29
29: ; preds = %55, %19
%30 = load i32, i32* %8
%31 = icmp slt i32 %30, 100
br i1 %31, label %32, label %58
32: ; preds = %29
%33 = load double, double* %6
%34 = load double, double* %7
%35 = load double, double* %4
%36 = load double, double* %6
%37 = call double @cos(double %36)
%38 = fneg double %35
%39 = call double @llvm.fmuladd.f64(double %38, double %37, double 1.000000e+00)
%40 = fdiv double %34, %39
%41 = fsub double %33, %40
store double %41, double* %6
%42 = load double, double* %6
%43 = load double, double* %4
%44 = load double, double* %6
%45 = call double @sin(double %44)
%46 = fneg double %43
%47 = call double @llvm.fmuladd.f64(double %46, double %45, double %42)
%48 = load double, double* %5
%49 = fsub double %47, %48
store double %49, double* %7
%50 = load double, double* %7
%51 = call double @llvm.fabs.f64(double %50)
%52 = fcmp olt double %51, 0x3C9CD2B297D889BC
br i1 %52, label %53, label %54
53: ; preds = %32
br label %58
54: ; preds = %32
br label %55
55: ; preds = %54
%56 = load i32, i32* %8
%57 = add nsw i32 %56, 1
store i32 %57, i32* %8
br label %29
58: ; preds = %53, %29
%59 = load double, double* %6
%60 = call double @mod2pi(double %59)
store double %60, double* %6
%61 = load double, double* %6
store double %61, double* %3
br label %105
62: ; preds = %2
%63 = load double, double* %5
store double %63, double* %6
%64 = load double, double* %6
%65 = load double, double* %4
%66 = load double, double* %6
%67 = call double @sinh(double %66)
%68 = fneg double %65
%69 = call double @llvm.fmuladd.f64(double %68, double %67, double %64)
%70 = load double, double* %5
%71 = fsub double %69, %70
store double %71, double* %9
store i32 0, i32* %10
br label %72
72: ; preds = %98, %62
%73 = load i32, i32* %10
%74 = icmp slt i32 %73, 100
br i1 %74, label %75, label %101
75: ; preds = %72
%76 = load double, double* %6
%77 = load double, double* %9
%78 = load double, double* %4
%79 = load double, double* %6
%80 = call double @cosh(double %79)
%81 = fneg double %78
%82 = call double @llvm.fmuladd.f64(double %81, double %80, double 1.000000e+00)
%83 = fdiv double %77, %82
%84 = fsub double %76, %83
store double %84, double* %6
%85 = load double, double* %6
%86 = load double, double* %4
%87 = load double, double* %6
%88 = call double @sinh(double %87)
%89 = fneg double %86
%90 = call double @llvm.fmuladd.f64(double %89, double %88, double %85)
%91 = load double, double* %5
%92 = fsub double %90, %91
store double %92, double* %9
%93 = load double, double* %9
%94 = call double @llvm.fabs.f64(double %93)
%95 = fcmp olt double %94, 0x3C9CD2B297D889BC
br i1 %95, label %96, label %97
96: ; preds = %75
br label %101
97: ; preds = %75
br label %98
98: ; preds = %97
%99 = load i32, i32* %10
%100 = add nsw i32 %99, 1
store i32 %100, i32* %10
br label %72
101: ; preds = %96, %72
%102 = load double, double* %6
%103 = call double @mod2pi(double %102)
store double %103, double* %6
%104 = load double, double* %6
store double %104, double* %3
br label %105
105: ; preds = %101, %58
%106 = load double, double* %3
ret double %106
}

LLVM IR (-O2):
define double @reb_M_to_E(double %0, double %1) {
%3 = fcmp olt double %0, 1.000000e+00
br i1 %3, label %4, label %27
4: ; preds = %2
%5 = fcmp olt double %0, 8.000000e-01
%6 = select i1 %5, double %1, double 0x400921FB54442D18
%7 = tail call double @sin(double %1)
%8 = fneg double %0
%9 = tail call double @llvm.fmuladd.f64(double %8, double %7, double %6)
%10 = fsub double %9, %1
br label %11
11: ; preds = %11, %4
%12 = phi i32 [ 0, %4 ], [ %24, %11 ]
%13 = phi double [ %10, %4 ], [ %21, %11 ]
%14 = phi double [ %6, %4 ], [ %18, %11 ]
%15 = tail call double @cos(double %14)
%16 = tail call double @llvm.fmuladd.f64(double %8, double %15, double 1.000000e+00)
%17 = fdiv double %13, %16
%18 = fsub double %14, %17
%19 = tail call double @sin(double %18)
%20 = tail call double @llvm.fmuladd.f64(double %8, double %19, double %18)
%21 = fsub double %20, %1
%22 = tail call double @llvm.fabs.f64(double %21)
%23 = fcmp olt double %22, 0x3C9CD2B297D889BC
%24 = add nuw nsw i32 %12, 1
%25 = icmp eq i32 %24, 100
%26 = select i1 %23, i1 true, i1 %25
br i1 %26, label %48, label %11
27: ; preds = %2
%28 = tail call double @sinh(double %1)
%29 = fneg double %0
%30 = tail call double @llvm.fmuladd.f64(double %29, double %28, double %1)
%31 = fsub double %30, %1
br label %32
32: ; preds = %32, %27
%33 = phi i32 [ 0, %27 ], [ %45, %32 ]
%34 = phi double [ %31, %27 ], [ %42, %32 ]
%35 = phi double [ %1, %27 ], [ %39, %32 ]
%36 = tail call double @cosh(double %35)
%37 = tail call double @llvm.fmuladd.f64(double %29, double %36, double 1.000000e+00)
%38 = fdiv double %34, %37
%39 = fsub double %35, %38
%40 = tail call double @sinh(double %39)
%41 = tail call double @llvm.fmuladd.f64(double %29, double %40, double %39)
%42 = fsub double %41, %1
%43 = tail call double @llvm.fabs.f64(double %42)
%44 = fcmp olt double %43, 0x3C9CD2B297D889BC
%45 = add nuw nsw i32 %33, 1
%46 = icmp eq i32 %45, 100
%47 = select i1 %44, i1 true, i1 %46
br i1 %47, label %48, label %32
48: ; preds = %32, %11
%49 = phi double [ %18, %11 ], [ %39, %32 ]
%50 = tail call double @mod2pi(double %49)
ret double %50
}