#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 */
int M_PI;
int atan(int);
int exp(double);
int pow(int, double);
double sin(double);
double iter_pi(double pi, double L, double e) {
  return 2 * atan(pow((1 + e * sin(pi)) / (1 - e * sin(pi)), e / 2) * exp(L)) -
         M_PI / 2;
}


x86 assembly (clang, -O0):
<iter_pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe89(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe3c(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x18(%rbp),%xmm0
movsd  0xe1b(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1060 <pow@plt>
mov    %eax,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <exp@plt>
mov    -0x20(%rbp),%edi
imul   %eax,%edi
call   1040 <atan@plt>
shl    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    0x2dd5(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iter_pi>:
push   %rbx
sub    $0x30,%rsp
movaps %xmm2,0x20(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
movaps %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
movapd 0xe8f(%rip),%xmm1
movapd 0x20(%rsp),%xmm3
xorpd  %xmm3,%xmm1
movapd %xmm3,%xmm2
unpcklpd %xmm1,%xmm2
movapd 0x10(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
mulpd  %xmm2,%xmm1
addpd  0xe77(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
mulsd  0xe6f(%rip),%xmm3
movapd %xmm3,%xmm0
call   1060 <pow@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1050 <exp@plt>
imul   %eax,%ebx
mov    %ebx,%edi
call   1040 <atan@plt>
add    %eax,%eax
mov    0x2e0e(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
sub    %edx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @iter_pi(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %4
%9 = call double @sin(double %8)
%10 = call double @llvm.fmuladd.f64(double %7, double %9, double 1.000000e+00)
%11 = load double, double* %6
%12 = load double, double* %4
%13 = call double @sin(double %12)
%14 = fneg double %11
%15 = call double @llvm.fmuladd.f64(double %14, double %13, double 1.000000e+00)
%16 = fdiv double %10, %15
%17 = fptosi double %16 to i32
%18 = load double, double* %6
%19 = fdiv double %18, 2.000000e+00
%20 = call i32 @pow(i32 %17, double %19)
%21 = load double, double* %5
%22 = call i32 @exp(double %21)
%23 = mul nsw i32 %20, %22
%24 = call i32 @atan(i32 %23)
%25 = mul nsw i32 2, %24
%26 = load i32, i32* @M_PI
%27 = sdiv i32 %26, 2
%28 = sub nsw i32 %25, %27
%29 = sitofp i32 %28 to double
ret double %29
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @iter_pi(double %0, double %1, double %2) {
%4 = tail call double @sin(double %0)
%5 = tail call double @sin(double %0)
%6 = fneg double %2
%7 = insertelement <2 x double> poison, double %2, i64 0
%8 = insertelement <2 x double> %7, double %6, i64 1
%9 = insertelement <2 x double> poison, double %4, i64 0
%10 = insertelement <2 x double> %9, double %5, i64 1
%11 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %8, <2 x double> %10, <2 x double> <double 1.000000e+00, double 1.000000e+00>)
%12 = extractelement <2 x double> %11, i64 0
%13 = extractelement <2 x double> %11, i64 1
%14 = fdiv double %12, %13
%15 = fptosi double %14 to i32
%16 = fmul double %2, 5.000000e-01
%17 = tail call i32 @pow(i32 %15, double %16)
%18 = tail call i32 @exp(double %1)
%19 = mul nsw i32 %18, %17
%20 = tail call i32 @atan(i32 %19)
%21 = shl nsw i32 %20, 1
%22 = load i32, i32* @M_PI
%23 = sdiv i32 %22, -2
%24 = add i32 %23, %21
%25 = sitofp i32 %24 to double
ret double %25
}