double kepler(M, e)
double M, e;
{
  int n = 0;
  double E, Eold, eps = 1.0e-8;
  E = M + e * sin(M);
  do {
    Eold = E;
    E = Eold + (M - Eold + e * sin(Eold)) / (1.0 - e * cos(Eold));
    ++n;
  } while ((fabs(E - Eold) > eps) && (n < 100));
  return (E);
}


x86 assembly (clang, -O0):
<kepler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movsd  0xebf(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x58(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x48(%rbp),%xmm0
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
movsd  0xdf0(%rip),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movaps 0xdcd(%rip),%xmm1
pand   %xmm1,%xmm0
xor    %eax,%eax
ucomisd -0x30(%rbp),%xmm0
mov    %al,-0x69(%rbp)
jbe    1261 <kepler+0x141>
cmpl   $0x64,-0x14(%rbp)
setl   %al
mov    %al,-0x69(%rbp)
mov    -0x69(%rbp),%al
test   $0x1,%al
jne    117e <kepler+0x5e>
movsd  -0x20(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kepler>:
push   %rbx
sub    $0x40,%rsp
movaps %xmm1,0x20(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <sin@plt>
movapd %xmm0,%xmm1
movapd 0x20(%rsp),%xmm2
mulsd  %xmm2,%xmm1
addsd  0x10(%rsp),%xmm1
movapd 0xeaf(%rip),%xmm0
xorpd  %xmm2,%xmm0
movapd %xmm0,0x30(%rsp)
xor    %ebx,%ebx
nopl   (%rax)
movapd %xmm1,%xmm0
movsd  %xmm1,0x18(%rsp)
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
call   1030 <sin@plt>
mulsd  0x20(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <cos@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0x30(%rsp),%xmm0
addsd  0xe70(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0x18(%rsp),%xmm2
addsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
subsd  %xmm2,%xmm0
andpd  0xe42(%rip),%xmm0
ucomisd 0xe52(%rip),%xmm0
jbe    11e6 <kepler+0xc6>
lea    0x1(%rbx),%eax
cmp    $0x63,%ebx
mov    %eax,%ebx
jb     1160 <kepler+0x40>
movapd %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @kepler(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %3
store double %1, double* %4
store i32 0, i32* %5
store double 1.000000e-08, double* %8
%9 = load double, double* %3
%10 = load double, double* %4
%11 = load double, double* %3
%12 = call double @sin(double %11)
%13 = call double @llvm.fmuladd.f64(double %10, double %12, double %9)
store double %13, double* %6
br label %14
14: ; preds = %43, %2
%15 = load double, double* %6
store double %15, double* %7
%16 = load double, double* %7
%17 = load double, double* %3
%18 = load double, double* %7
%19 = fsub double %17, %18
%20 = load double, double* %4
%21 = load double, double* %7
%22 = call double @sin(double %21)
%23 = call double @llvm.fmuladd.f64(double %20, double %22, double %19)
%24 = load double, double* %4
%25 = load double, double* %7
%26 = call double @cos(double %25)
%27 = fneg double %24
%28 = call double @llvm.fmuladd.f64(double %27, double %26, double 1.000000e+00)
%29 = fdiv double %23, %28
%30 = fadd double %16, %29
store double %30, double* %6
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %33
33: ; preds = %14
%34 = load double, double* %6
%35 = load double, double* %7
%36 = fsub double %34, %35
%37 = call double @llvm.fabs.f64(double %36)
%38 = load double, double* %8
%39 = fcmp ogt double %37, %38
br i1 %39, label %40, label %43
40: ; preds = %33
%41 = load i32, i32* %5
%42 = icmp slt i32 %41, 100
br label %43
43: ; preds = %40, %33
%44 = phi i1 [ false, %33 ], [ %42, %40 ]
br i1 %44, label %14, label %45
45: ; preds = %43
%46 = load double, double* %6
ret double %46
}

LLVM IR (-O2):
define double @kepler(double %0, double %1) {
%3 = tail call double @sin(double %0)
%4 = tail call double @llvm.fmuladd.f64(double %1, double %3, double %0)
%5 = fneg double %1
br label %6
6: ; preds = %6, %2
%7 = phi double [ %4, %2 ], [ %15, %6 ]
%8 = phi i32 [ 0, %2 ], [ %16, %6 ]
%9 = fsub double %0, %7
%10 = tail call double @sin(double %7)
%11 = tail call double @llvm.fmuladd.f64(double %1, double %10, double %9)
%12 = tail call double @cos(double %7)
%13 = tail call double @llvm.fmuladd.f64(double %5, double %12, double 1.000000e+00)
%14 = fdiv double %11, %13
%15 = fadd double %7, %14
%16 = add nuw nsw i32 %8, 1
%17 = fsub double %15, %7
%18 = tail call double @llvm.fabs.f64(double %17)
%19 = fcmp ogt double %18, 1.000000e-08
%20 = icmp ult i32 %8, 99
%21 = select i1 %19, i1 %20, i1 false
br i1 %21, label %6, label %22
22: ; preds = %6
ret double %15
}