#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_2;
int atan(int);
int exp(double);
double fabs(double);
int pow(int, double);
double sin(double);
double __YGLatitudeFromLatitudeISO(double lat_iso, double e, double eps) {
  double phi_0 = 2 * atan(exp(lat_iso)) - M_PI_2;
  double phi_i =
      2 * atan(pow((1 + e * sin(phi_0)) / (1 - e * sin(phi_0)), e / 2.0) *
               exp(lat_iso)) -
      M_PI_2;
  double delta;
  while (delta = fabs(phi_i - phi_0), delta > eps) {
    phi_0 = phi_i;
    phi_i = 2 * atan(pow((1 + e * sin(phi_0)) / (1 - e * sin(phi_0)), e / 2.0) *
                     exp(lat_iso)) -
            M_PI_2;
  }
  return phi_i;
}


x86 assembly (clang, -O0):
<__YGLatitudeFromLatitudeISO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <exp@plt>
mov    %eax,%edi
call   1040 <atan@plt>
shl    $0x1,%eax
mov    0x2e76(%rip),%rcx
sub    (%rcx),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe63(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x48(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe16(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x10(%rbp),%xmm0
movsd  0xdf5(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1060 <pow@plt>
mov    %eax,-0x34(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <exp@plt>
mov    -0x34(%rbp),%edi
imul   %eax,%edi
call   1040 <atan@plt>
shl    $0x1,%eax
mov    0x2db2(%rip),%rcx
sub    (%rcx),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movaps 0xdbe(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    133e <__YGLatitudeFromLatitudeISO+0x1fe>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd6b(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xd1e(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x10(%rbp),%xmm0
movsd  0xcfd(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1060 <pow@plt>
mov    %eax,-0x54(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <exp@plt>
mov    -0x54(%rbp),%edi
imul   %eax,%edi
call   1040 <atan@plt>
shl    $0x1,%eax
mov    0x2cba(%rip),%rcx
sub    (%rcx),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1241 <__YGLatitudeFromLatitudeISO+0x101>
movsd  -0x28(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__YGLatitudeFromLatitudeISO>:
push   %r14
push   %rbx
sub    $0x58,%rsp
movsd  %xmm2,0x18(%rsp)
movaps %xmm1,0x20(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1050 <exp@plt>
mov    %eax,%edi
call   1040 <atan@plt>
add    %eax,%eax
mov    0x2e7b(%rip),%r14
sub    (%r14),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movapd %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movapd 0xe65(%rip),%xmm1
movapd 0x20(%rsp),%xmm3
xorpd  %xmm3,%xmm1
movapd %xmm3,%xmm2
unpcklpd %xmm1,%xmm2
movapd 0x30(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
movapd %xmm2,0x40(%rsp)
mulpd  %xmm2,%xmm1
addpd  0xe47(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
mulsd  0xe4f(%rip),%xmm3
movapd %xmm3,0x20(%rsp)
movapd %xmm3,%xmm0
call   1060 <pow@plt>
mov    %eax,%ebx
movsd  0x10(%rsp),%xmm0
call   1050 <exp@plt>
imul   %eax,%ebx
mov    %ebx,%edi
call   1040 <atan@plt>
movsd  0x18(%rsp),%xmm2
add    %eax,%eax
sub    (%r14),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movapd %xmm1,%xmm0
subsd  0x8(%rsp),%xmm0
andpd  0xdf5(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    12dd <__YGLatitudeFromLatitudeISO+0x19d>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1030 <sin@plt>
movapd %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movapd 0x30(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
mulpd  0x40(%rsp),%xmm1
addpd  0xd98(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
movaps 0x20(%rsp),%xmm0
call   1060 <pow@plt>
mov    %eax,%ebx
movsd  0x10(%rsp),%xmm0
call   1050 <exp@plt>
imul   %eax,%ebx
mov    %ebx,%edi
call   1040 <atan@plt>
movsd  0x18(%rsp),%xmm2
add    %eax,%eax
sub    (%r14),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm0,%xmm1
subsd  0x8(%rsp),%xmm1
andpd  0xd53(%rip),%xmm1
ucomisd %xmm2,%xmm1
movapd %xmm0,%xmm1
ja     1240 <__YGLatitudeFromLatitudeISO+0x100>
jmp    12e1 <__YGLatitudeFromLatitudeISO+0x1a1>
movapd %xmm1,%xmm0
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@M_PI_2 = global i32 0
define double @__YGLatitudeFromLatitudeISO(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%10 = load double, double* %4
%11 = call i32 @exp(double %10)
%12 = call i32 @atan(i32 %11)
%13 = mul nsw i32 2, %12
%14 = load i32, i32* @M_PI_2
%15 = sub nsw i32 %13, %14
%16 = sitofp i32 %15 to double
store double %16, double* %7
%17 = load double, double* %5
%18 = load double, double* %7
%19 = call double @sin(double %18)
%20 = call double @llvm.fmuladd.f64(double %17, double %19, double 1.000000e+00)
%21 = load double, double* %5
%22 = load double, double* %7
%23 = call double @sin(double %22)
%24 = fneg double %21
%25 = call double @llvm.fmuladd.f64(double %24, double %23, double 1.000000e+00)
%26 = fdiv double %20, %25
%27 = fptosi double %26 to i32
%28 = load double, double* %5
%29 = fdiv double %28, 2.000000e+00
%30 = call i32 @pow(i32 %27, double %29)
%31 = load double, double* %4
%32 = call i32 @exp(double %31)
%33 = mul nsw i32 %30, %32
%34 = call i32 @atan(i32 %33)
%35 = mul nsw i32 2, %34
%36 = load i32, i32* @M_PI_2
%37 = sub nsw i32 %35, %36
%38 = sitofp i32 %37 to double
store double %38, double* %8
br label %39
39: ; preds = %47, %3
%40 = load double, double* %8
%41 = load double, double* %7
%42 = fsub double %40, %41
%43 = call double @llvm.fabs.f64(double %42)
store double %43, double* %9
%44 = load double, double* %9
%45 = load double, double* %6
%46 = fcmp ogt double %44, %45
br i1 %46, label %47, label %71
47: ; preds = %39
%48 = load double, double* %8
store double %48, double* %7
%49 = load double, double* %5
%50 = load double, double* %7
%51 = call double @sin(double %50)
%52 = call double @llvm.fmuladd.f64(double %49, double %51, double 1.000000e+00)
%53 = load double, double* %5
%54 = load double, double* %7
%55 = call double @sin(double %54)
%56 = fneg double %53
%57 = call double @llvm.fmuladd.f64(double %56, double %55, double 1.000000e+00)
%58 = fdiv double %52, %57
%59 = fptosi double %58 to i32
%60 = load double, double* %5
%61 = fdiv double %60, 2.000000e+00
%62 = call i32 @pow(i32 %59, double %61)
%63 = load double, double* %4
%64 = call i32 @exp(double %63)
%65 = mul nsw i32 %62, %64
%66 = call i32 @atan(i32 %65)
%67 = mul nsw i32 2, %66
%68 = load i32, i32* @M_PI_2
%69 = sub nsw i32 %67, %68
%70 = sitofp i32 %69 to double
store double %70, double* %8
br label %39
71: ; preds = %39
%72 = load double, double* %8
ret double %72
}

LLVM IR (-O2):
@M_PI_2 = global i32 0
define double @__YGLatitudeFromLatitudeISO(double %0, double %1, double %2) {
%4 = tail call i32 @exp(double %0)
%5 = tail call i32 @atan(i32 %4)
%6 = shl nsw i32 %5, 1
%7 = load i32, i32* @M_PI_2
%8 = sub nsw i32 %6, %7
%9 = sitofp i32 %8 to double
%10 = tail call double @sin(double %9)
%11 = tail call double @sin(double %9)
%12 = fneg double %1
%13 = insertelement <2 x double> poison, double %1, i64 0
%14 = insertelement <2 x double> %13, double %12, i64 1
%15 = insertelement <2 x double> poison, double %10, i64 0
%16 = insertelement <2 x double> %15, double %11, i64 1
%17 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %14, <2 x double> %16, <2 x double> <double 1.000000e+00, double 1.000000e+00>)
%18 = extractelement <2 x double> %17, i64 0
%19 = extractelement <2 x double> %17, i64 1
%20 = fdiv double %18, %19
%21 = fptosi double %20 to i32
%22 = fmul double %1, 5.000000e-01
%23 = tail call i32 @pow(i32 %21, double %22)
%24 = tail call i32 @exp(double %0)
%25 = mul nsw i32 %24, %23
%26 = tail call i32 @atan(i32 %25)
%27 = shl nsw i32 %26, 1
%28 = load i32, i32* @M_PI_2
%29 = sub nsw i32 %27, %28
%30 = sitofp i32 %29 to double
%31 = fsub double %30, %9
%32 = tail call double @llvm.fabs.f64(double %31)
%33 = fcmp ogt double %32, %2
br i1 %33, label %34, label %56
34: ; preds = %3, %34
%35 = phi double [ %52, %34 ], [ %30, %3 ]
%36 = tail call double @sin(double %35)
%37 = tail call double @sin(double %35)
%38 = insertelement <2 x double> poison, double %36, i64 0
%39 = insertelement <2 x double> %38, double %37, i64 1
%40 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %14, <2 x double> %39, <2 x double> <double 1.000000e+00, double 1.000000e+00>)
%41 = extractelement <2 x double> %40, i64 0
%42 = extractelement <2 x double> %40, i64 1
%43 = fdiv double %41, %42
%44 = fptosi double %43 to i32
%45 = tail call i32 @pow(i32 %44, double %22)
%46 = tail call i32 @exp(double %0)
%47 = mul nsw i32 %46, %45
%48 = tail call i32 @atan(i32 %47)
%49 = shl nsw i32 %48, 1
%50 = load i32, i32* @M_PI_2
%51 = sub nsw i32 %49, %50
%52 = sitofp i32 %51 to double
%53 = fsub double %52, %35
%54 = tail call double @llvm.fabs.f64(double %53)
%55 = fcmp ogt double %54, %2
br i1 %55, label %34, label %56
56: ; preds = %34, %3
%57 = phi double [ %30, %3 ], [ %52, %34 ]
ret double %57
}