#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 log(int);
int pow(int, double);
double sin(double const);
int tan(double);
double lambert_latitude_to_iso(double latitude, double e) {
  const double phi = latitude * 3.14159265358979323846 / 180.;
  const double s = sin(phi);
  return log(tan(0.25 * 3.14159265358979323846 + 0.5 * phi) *
             pow((1. - e * s) / (1. + e * s), 0.5 * e));
}


x86 assembly (clang, -O0):
<lambert_latitude_to_iso>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xec6(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe74(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe78(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <tan@plt>
mov    %eax,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe37(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe1d(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xe01(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1060 <pow@plt>
mov    -0x24(%rbp),%edi
imul   %eax,%edi
call   1050 <log@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lambert_latitude_to_iso>:
push   %rbx
sub    $0x30,%rsp
movaps %xmm1,0x20(%rsp)
mulsd  0xeae(%rip),%xmm0
divsd  0xeae(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movapd %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xe97(%rip),%xmm0
addsd  0xe97(%rip),%xmm0
call   1040 <tan@plt>
mov    %eax,%ebx
movapd 0xe90(%rip),%xmm1
movapd 0x20(%rsp),%xmm0
xorpd  %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
movapd 0x10(%rsp),%xmm2
unpcklpd %xmm2,%xmm2
mulpd  %xmm1,%xmm2
addpd  0xe7c(%rip),%xmm2
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
divsd  %xmm1,%xmm2
cvttsd2si %xmm2,%edi
mulsd  0xe44(%rip),%xmm0
call   1060 <pow@plt>
imul   %eax,%ebx
mov    %ebx,%edi
add    $0x30,%rsp
pop    %rbx
jmp    1050 <log@plt>

LLVM IR (-O0):
define double @lambert_latitude_to_iso(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = fmul double %7, 0x400921FB54442D18
%9 = fdiv double %8, 1.800000e+02
store double %9, double* %5
%10 = load double, double* %5
%11 = call double @sin(double %10)
store double %11, double* %6
%12 = load double, double* %5
%13 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %12, double 0x3FE921FB54442D18)
%14 = call i32 @tan(double %13)
%15 = load double, double* %4
%16 = load double, double* %6
%17 = fneg double %15
%18 = call double @llvm.fmuladd.f64(double %17, double %16, double 1.000000e+00)
%19 = load double, double* %4
%20 = load double, double* %6
%21 = call double @llvm.fmuladd.f64(double %19, double %20, double 1.000000e+00)
%22 = fdiv double %18, %21
%23 = fptosi double %22 to i32
%24 = load double, double* %4
%25 = fmul double 5.000000e-01, %24
%26 = call i32 @pow(i32 %23, double %25)
%27 = mul nsw i32 %14, %26
%28 = call double @log(i32 %27)
ret double %28
}

LLVM IR (-O2):
define double @lambert_latitude_to_iso(double %0, double %1) {
%3 = fmul double %0, 0x400921FB54442D18
%4 = fdiv double %3, 1.800000e+02
%5 = tail call double @sin(double %4)
%6 = tail call double @llvm.fmuladd.f64(double %4, double 5.000000e-01, double 0x3FE921FB54442D18)
%7 = tail call i32 @tan(double %6)
%8 = fneg double %1
%9 = insertelement <2 x double> poison, double %1, i64 1
%10 = insertelement <2 x double> %9, double %8, i64 0
%11 = insertelement <2 x double> poison, double %5, i64 0
%12 = shufflevector <2 x double> %11, <2 x double> poison, <2 x i32> zeroinitializer
%13 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %10, <2 x double> %12, <2 x double> <double 1.000000e+00, double 1.000000e+00>)
%14 = extractelement <2 x double> %13, i64 0
%15 = extractelement <2 x double> %13, i64 1
%16 = fdiv double %14, %15
%17 = fptosi double %16 to i32
%18 = fmul double %1, 5.000000e-01
%19 = tail call i32 @pow(i32 %17, double %18)
%20 = mul nsw i32 %19, %7
%21 = tail call double @log(i32 %20)
ret double %21
}