#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 atan2(double, double);
double cos(double);
double fabs(double);
double rev180(double);
double sin(double);
double kepler(double m, double ex) {
  double m1, sinm, cosm, exd, exan, dexan, lim1, adko, adk, denom;
  int converged;
  m1 = rev180(m);
  sinm = sin(m1 * (3.14159265358979323846 / 180.0));
  cosm = cos(m1 * (3.14159265358979323846 / 180.0));
  exan = ((180.0 / 3.14159265358979323846) * atan2(sinm, cosm - ex));
  if (ex > 0.008) {
    exd = ex * (180.0 / 3.14159265358979323846);
    lim1 = 1E-3 / ex;
    adko = 1E+10;
    denom = 1.0 - ex * cos(exan * (3.14159265358979323846 / 180.0));
    do {
      dexan = (m1 + exd * sin(exan * (3.14159265358979323846 / 180.0)) - exan) /
              denom;
      exan = exan + dexan;
      adk = fabs(dexan);
      converged = adk < 3E-8 || adk >= adko;
      adko = adk;
      if (!converged && adk > lim1)
        denom = 1.0 - ex * cos(exan * (3.14159265358979323846 / 180.0));
    } while (!converged);
  }
  return exan;
}


x86 assembly (clang, -O0):
<kepler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <rev180@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xea4(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xe8d(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
call   1030 <atan2@plt>
movaps %xmm0,%xmm1
movsd  0xe57(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe39(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    138e <kepler+0x24e>
movsd  0xe2f(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe3d(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe23(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xdfc(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xdcf(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xd9f(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
call   1040 <sin@plt>
movsd  -0x88(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  -0x38(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x40(%rbp),%xmm0
movaps 0xd83(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    $0x1,%al
movsd  0xd60(%rip),%xmm0
ucomisd -0x58(%rbp),%xmm0
mov    %al,-0x71(%rbp)
ja     12ee <kepler+0x1ae>
movsd  -0x58(%rbp),%xmm0
ucomisd -0x50(%rbp),%xmm0
setae  %al
mov    %al,-0x71(%rbp)
mov    -0x71(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x64(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
cmpl   $0x0,-0x64(%rbp)
jne    1373 <kepler+0x233>
movsd  -0x58(%rbp),%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    1373 <kepler+0x233>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xcde(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xcae(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1378 <kepler+0x238>
cmpl   $0x0,-0x64(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1252 <kepler+0x112>
jmp    138e <kepler+0x24e>
movsd  -0x38(%rbp),%xmm0
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kepler>:
push   %rbx
sub    $0x50,%rsp
movaps %xmm1,0x10(%rsp)
call   1060 <rev180@plt>
movsd  0xea9(%rip),%xmm1
movsd  %xmm0,0x38(%rsp)
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1040 <sin@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <cos@plt>
movapd %xmm0,%xmm1
subsd  0x10(%rsp),%xmm1
movsd  (%rsp),%xmm0
call   1030 <atan2@plt>
movapd %xmm0,%xmm1
mulsd  0xe68(%rip),%xmm1
movapd 0x10(%rsp),%xmm0
ucomisd 0xe62(%rip),%xmm0
jbe    12f5 <kepler+0x1b5>
movapd %xmm0,%xmm2
movsd  0xe48(%rip),%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0xe46(%rip),%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0xe1c(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1050 <cos@plt>
movsd  (%rsp),%xmm1
movapd 0xe41(%rip),%xmm2
movapd 0x10(%rsp),%xmm3
xorpd  %xmm3,%xmm2
movapd %xmm2,0x40(%rsp)
mulsd  %xmm3,%xmm0
movsd  0xe05(%rip),%xmm2
subsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  0xdfb(%rip),%xmm2
jmp    1238 <kepler+0xf8>
nop
test   %bl,%bl
jne    12f5 <kepler+0x1b5>
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,(%rsp)
mulsd  0xdb5(%rip),%xmm1
movapd %xmm1,%xmm0
call   1040 <sin@plt>
movsd  0x10(%rsp),%xmm3
movsd  (%rsp),%xmm1
movapd %xmm0,%xmm2
mulsd  0x30(%rsp),%xmm2
addsd  0x38(%rsp),%xmm2
subsd  %xmm1,%xmm2
divsd  0x8(%rsp),%xmm2
addsd  %xmm2,%xmm1
andpd  0xdcb(%rip),%xmm2
movsd  0xda3(%rip),%xmm0
ucomisd %xmm2,%xmm0
seta   %al
ucomisd %xmm3,%xmm2
setae  %bl
or     %al,%bl
ucomisd %xmm2,%xmm0
ja     1230 <kepler+0xf0>
ucomisd %xmm3,%xmm2
jae    1230 <kepler+0xf0>
ucomisd 0x28(%rsp),%xmm2
jbe    1230 <kepler+0xf0>
movapd %xmm1,%xmm0
mulsd  0xd3f(%rip),%xmm0
movsd  %xmm1,(%rsp)
movapd %xmm2,0x10(%rsp)
call   1050 <cos@plt>
movapd 0x10(%rsp),%xmm2
movsd  (%rsp),%xmm1
mulsd  0x40(%rsp),%xmm0
addsd  0xd36(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
jmp    1230 <kepler+0xf0>
movapd %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @kepler(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca i32
store double %0, double* %3
store double %1, double* %4
%16 = load double, double* %3
%17 = call double @rev180(double %16)
store double %17, double* %5
%18 = load double, double* %5
%19 = fmul double %18, 0x3F91DF46A2529D39
%20 = call double @sin(double %19)
store double %20, double* %6
%21 = load double, double* %5
%22 = fmul double %21, 0x3F91DF46A2529D39
%23 = call double @cos(double %22)
store double %23, double* %7
%24 = load double, double* %6
%25 = load double, double* %7
%26 = load double, double* %4
%27 = fsub double %25, %26
%28 = call double @atan2(double %24, double %27)
%29 = fmul double 0x404CA5DC1A63C1F8, %28
store double %29, double* %9
%30 = load double, double* %4
%31 = fcmp ogt double %30, 8.000000e-03
br i1 %31, label %32, label %88
32: ; preds = %2
%33 = load double, double* %4
%34 = fmul double %33, 0x404CA5DC1A63C1F8
store double %34, double* %8
%35 = load double, double* %4
%36 = fdiv double 1.000000e-03, %35
store double %36, double* %11
store double 1.000000e+10, double* %12
%37 = load double, double* %4
%38 = load double, double* %9
%39 = fmul double %38, 0x3F91DF46A2529D39
%40 = call double @cos(double %39)
%41 = fneg double %37
%42 = call double @llvm.fmuladd.f64(double %41, double %40, double 1.000000e+00)
store double %42, double* %14
br label %43
43: ; preds = %83, %32
%44 = load double, double* %5
%45 = load double, double* %8
%46 = load double, double* %9
%47 = fmul double %46, 0x3F91DF46A2529D39
%48 = call double @sin(double %47)
%49 = call double @llvm.fmuladd.f64(double %45, double %48, double %44)
%50 = load double, double* %9
%51 = fsub double %49, %50
%52 = load double, double* %14
%53 = fdiv double %51, %52
store double %53, double* %10
%54 = load double, double* %9
%55 = load double, double* %10
%56 = fadd double %54, %55
store double %56, double* %9
%57 = load double, double* %10
%58 = call double @llvm.fabs.f64(double %57)
store double %58, double* %13
%59 = load double, double* %13
%60 = fcmp olt double %59, 3.000000e-08
br i1 %60, label %65, label %61
61: ; preds = %43
%62 = load double, double* %13
%63 = load double, double* %12
%64 = fcmp oge double %62, %63
br label %65
65: ; preds = %61, %43
%66 = phi i1 [ true, %43 ], [ %64, %61 ]
%67 = zext i1 %66 to i32
store i32 %67, i32* %15
%68 = load double, double* %13
store double %68, double* %12
%69 = load i32, i32* %15
%70 = icmp ne i32 %69, 0
br i1 %70, label %82, label %71
71: ; preds = %65
%72 = load double, double* %13
%73 = load double, double* %11
%74 = fcmp ogt double %72, %73
br i1 %74, label %75, label %82
75: ; preds = %71
%76 = load double, double* %4
%77 = load double, double* %9
%78 = fmul double %77, 0x3F91DF46A2529D39
%79 = call double @cos(double %78)
%80 = fneg double %76
%81 = call double @llvm.fmuladd.f64(double %80, double %79, double 1.000000e+00)
store double %81, double* %14
br label %82
82: ; preds = %75, %71, %65
br label %83
83: ; preds = %82
%84 = load i32, i32* %15
%85 = icmp ne i32 %84, 0
%86 = xor i1 %85, true
br i1 %86, label %43, label %87
87: ; preds = %83
br label %88
88: ; preds = %87, %2
%89 = load double, double* %9
ret double %89
}

LLVM IR (-O2):
define double @kepler(double %0, double %1) {
%3 = tail call double @rev180(double %0)
%4 = fmul double %3, 0x3F91DF46A2529D39
%5 = tail call double @sin(double %4)
%6 = tail call double @cos(double %4)
%7 = fsub double %6, %1
%8 = tail call double @atan2(double %5, double %7)
%9 = fmul double %8, 0x404CA5DC1A63C1F8
%10 = fcmp ogt double %1, 8.000000e-03
br i1 %10, label %11, label %42
11: ; preds = %2
%12 = fmul double %1, 0x404CA5DC1A63C1F8
%13 = fdiv double 1.000000e-03, %1
%14 = fmul double %9, 0x3F91DF46A2529D39
%15 = tail call double @cos(double %14)
%16 = fneg double %1
%17 = tail call double @llvm.fmuladd.f64(double %16, double %15, double 1.000000e+00)
br label %18
18: ; preds = %40, %11
%19 = phi double [ 1.000000e+10, %11 ], [ %28, %40 ]
%20 = phi double [ %17, %11 ], [ %41, %40 ]
%21 = phi double [ %9, %11 ], [ %27, %40 ]
%22 = fmul double %21, 0x3F91DF46A2529D39
%23 = tail call double @sin(double %22)
%24 = tail call double @llvm.fmuladd.f64(double %12, double %23, double %3)
%25 = fsub double %24, %21
%26 = fdiv double %25, %20
%27 = fadd double %21, %26
%28 = tail call double @llvm.fabs.f64(double %26)
%29 = fcmp olt double %28, 3.000000e-08
%30 = fcmp oge double %28, %19
%31 = or i1 %29, %30
%32 = or i1 %29, %30
%33 = xor i1 %32, true
%34 = fcmp ogt double %28, %13
%35 = select i1 %33, i1 %34, i1 false
br i1 %35, label %36, label %40
36: ; preds = %18
%37 = fmul double %27, 0x3F91DF46A2529D39
%38 = tail call double @cos(double %37)
%39 = tail call double @llvm.fmuladd.f64(double %16, double %38, double 1.000000e+00)
br label %40
40: ; preds = %18, %36
%41 = phi double [ %20, %18 ], [ %39, %36 ]
br i1 %31, label %42, label %18
42: ; preds = %40, %2
%43 = phi double [ %9, %2 ], [ %27, %40 ]
ret double %43
}