#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 sin(double);
double solve_kepler(double M_k, double e) {
  double X = 0;
  for (unsigned i = 0; i < 10; i++)
    X = e * sin(M_k + X);
  return M_k + X;
}


x86 assembly (clang, -O0):
<solve_kepler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jae    1173 <solve_kepler+0x63>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1131 <solve_kepler+0x21>
movsd  -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_kepler>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @solve_kepler(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %3
store double %1, double* %4
store double 0.000000e+00, double* %5
store i32 0, i32* %6
br label %7
7: ; preds = %17, %2
%8 = load i32, i32* %6
%9 = icmp ult i32 %8, 10
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load double, double* %4
%12 = load double, double* %3
%13 = load double, double* %5
%14 = fadd double %12, %13
%15 = call double @sin(double %14)
%16 = fmul double %11, %15
store double %16, double* %5
br label %17
17: ; preds = %10
%18 = load i32, i32* %6
%19 = add i32 %18, 1
store i32 %19, i32* %6
br label %7
20: ; preds = %7
%21 = load double, double* %3
%22 = load double, double* %5
%23 = fadd double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @solve_kepler(double %0, double %1) {
%3 = fadd double %0, 0.000000e+00
%4 = tail call double @sin(double %3)
%5 = fmul double %4, %1
%6 = fadd double %5, %0
%7 = tail call double @sin(double %6)
%8 = fmul double %7, %1
%9 = fadd double %8, %0
%10 = tail call double @sin(double %9)
%11 = fmul double %10, %1
%12 = fadd double %11, %0
%13 = tail call double @sin(double %12)
%14 = fmul double %13, %1
%15 = fadd double %14, %0
%16 = tail call double @sin(double %15)
%17 = fmul double %16, %1
%18 = fadd double %17, %0
%19 = tail call double @sin(double %18)
%20 = fmul double %19, %1
%21 = fadd double %20, %0
%22 = tail call double @sin(double %21)
%23 = fmul double %22, %1
%24 = fadd double %23, %0
%25 = tail call double @sin(double %24)
%26 = fmul double %25, %1
%27 = fadd double %26, %0
%28 = tail call double @sin(double %27)
%29 = fmul double %28, %1
%30 = fadd double %29, %0
%31 = tail call double @sin(double %30)
%32 = fmul double %31, %1
%33 = fadd double %32, %0
ret double %33
}