#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 FLT_EPSILON;
int atan(double const);
double exp(double);
double const fabs(double);
double const pow(int, double);
double sin(double);
double lambert_iso_to_latitude(double L, double e) {
  const double epsilon = FLT_EPSILON;
  const double eL = exp(L);
  double phi0 = 2. * atan(eL) - 0.5 * 3.14159265358979323846;
  for (;;) {
    const double s = sin(phi0);
    double phi1 = 2. * atan(pow((1. + e * s) / (1. - e * s), 0.5 * e) * eL) -
                  0.5 * 3.14159265358979323846;
    if (fabs(phi1 - phi0) <= epsilon)
      return phi1 / 3.14159265358979323846 * 180.;
    phi0 = phi1;
  }
}


x86 assembly (clang, -O0):
<lambert_iso_to_latitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    0x2e77(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <atan@plt>
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
movsd  0xe65(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe47(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
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  0xdfa(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1070 <pow@plt>
mulsd  -0x20(%rbp),%xmm0
call   1050 <atan@plt>
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
movsd  0xdce(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     127f <lambert_iso_to_latitude+0x12f>
movsd  -0x38(%rbp),%xmm0
movsd  0xdb7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xda3(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    11a4 <lambert_iso_to_latitude+0x54>

x86 assembly (clang, -O2):
<lambert_iso_to_latitude>:
sub    $0x38,%rsp
movaps %xmm1,(%rsp)
mov    0x2e91(%rip),%rax
movsd  (%rax),%xmm1
movsd  %xmm1,0x28(%rsp)
call   1050 <exp@plt>
movsd  %xmm0,0x20(%rsp)
call   1040 <atan@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
addsd  0xe84(%rip),%xmm0
movapd 0xe9c(%rip),%xmm1
movapd (%rsp),%xmm3
xorpd  %xmm3,%xmm1
movsd  0xe73(%rip),%xmm2
mulsd  %xmm3,%xmm2
movsd  %xmm2,0x18(%rsp)
unpcklpd %xmm1,%xmm3
movapd %xmm3,(%rsp)
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,0x30(%rsp)
call   1030 <sin@plt>
unpcklpd %xmm0,%xmm0
mulpd  (%rsp),%xmm0
addpd  0xe64(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0x18(%rsp),%xmm0
call   1060 <pow@plt>
mulsd  0x20(%rsp),%xmm0
call   1040 <atan@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
addsd  0xdfb(%rip),%xmm0
movapd %xmm0,%xmm1
subsd  0x30(%rsp),%xmm1
andpd  0xe29(%rip),%xmm1
movsd  0x28(%rsp),%xmm2
ucomisd %xmm1,%xmm2
jb     11b0 <lambert_iso_to_latitude+0x70>
divsd  0xde5(%rip),%xmm0
mulsd  0xde5(%rip),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
@FLT_EPSILON = global double 0.000000e+00
define double @lambert_iso_to_latitude(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
store double %0, double* %3
store double %1, double* %4
%10 = load double, double* @FLT_EPSILON
store double %10, double* %5
%11 = load double, double* %3
%12 = call double @exp(double %11)
store double %12, double* %6
%13 = load double, double* %6
%14 = call i32 @atan(double %13)
%15 = sitofp i32 %14 to double
%16 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %15, double 0xBFF921FB54442D18)
store double %16, double* %7
br label %17
17: ; preds = %47, %2
%18 = load double, double* %7
%19 = call double @sin(double %18)
store double %19, double* %8
%20 = load double, double* %4
%21 = load double, double* %8
%22 = call double @llvm.fmuladd.f64(double %20, double %21, double 1.000000e+00)
%23 = load double, double* %4
%24 = load double, double* %8
%25 = fneg double %23
%26 = call double @llvm.fmuladd.f64(double %25, double %24, double 1.000000e+00)
%27 = fdiv double %22, %26
%28 = fptosi double %27 to i32
%29 = load double, double* %4
%30 = fmul double 5.000000e-01, %29
%31 = call double @pow(i32 %28, double %30)
%32 = load double, double* %6
%33 = fmul double %31, %32
%34 = call i32 @atan(double %33)
%35 = sitofp i32 %34 to double
%36 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %35, double 0xBFF921FB54442D18)
store double %36, double* %9
%37 = load double, double* %9
%38 = load double, double* %7
%39 = fsub double %37, %38
%40 = call double @fabs(double %39)
%41 = load double, double* %5
%42 = fcmp ole double %40, %41
br i1 %42, label %43, label %47
43: ; preds = %17
%44 = load double, double* %9
%45 = fdiv double %44, 0x400921FB54442D18
%46 = fmul double %45, 1.800000e+02
ret double %46
47: ; preds = %17
%48 = load double, double* %9
store double %48, double* %7
br label %17
}

LLVM IR (-O2):
@FLT_EPSILON = global double 0.000000e+00
define double @lambert_iso_to_latitude(double %0, double %1) {
%3 = load double, double* @FLT_EPSILON
%4 = tail call double @exp(double %0)
%5 = tail call i32 @atan(double %4)
%6 = sitofp i32 %5 to double
%7 = tail call double @llvm.fmuladd.f64(double %6, double 2.000000e+00, double 0xBFF921FB54442D18)
%8 = fneg double %1
%9 = fmul double %1, 5.000000e-01
%10 = insertelement <2 x double> poison, double %1, i64 0
%11 = insertelement <2 x double> %10, double %8, i64 1
br label %12
12: ; preds = %12, %2
%13 = phi double [ %7, %2 ], [ %26, %12 ]
%14 = tail call double @sin(double %13)
%15 = insertelement <2 x double> poison, double %14, i64 0
%16 = shufflevector <2 x double> %15, <2 x double> poison, <2 x i32> zeroinitializer
%17 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %11, <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 = tail call double @pow(i32 %21, double %9)
%23 = fmul double %4, %22
%24 = tail call i32 @atan(double %23)
%25 = sitofp i32 %24 to double
%26 = tail call double @llvm.fmuladd.f64(double %25, double 2.000000e+00, double 0xBFF921FB54442D18)
%27 = fsub double %26, %13
%28 = tail call double @llvm.fabs.f64(double %27)
%29 = fcmp ugt double %28, %3
br i1 %29, label %12, label %30
30: ; preds = %12
%31 = fdiv double %26, 0x400921FB54442D18
%32 = fmul double %31, 1.800000e+02
ret double %32
}