#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 */
scalar_t__ M_PI_4;
double log(int);
int pow(int, double);
double sin(double);
int tan(scalar_t__);
double __YGLatitudeISO(double lat, double e) {
  return log(tan(M_PI_4 + lat / 2) *
             pow((1 - e * sin(lat)) / (1 + e * sin(lat)), e / 2));
}


x86 assembly (clang, -O0):
<__YGLatitudeISO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    0x2e8f(%rip),%rax
cvtsi2sdq (%rax),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xe95(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <tan@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe49(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm1
movsd  0xe13(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x10(%rbp),%xmm0
movsd  0xdf2(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1060 <pow@plt>
mov    -0x14(%rbp),%edi
imul   %eax,%edi
call   1050 <log@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__YGLatitudeISO>:
push   %rbx
sub    $0x40,%rsp
movaps %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    0x2e91(%rip),%rax
cvtsi2sdq (%rax),%xmm2
movapd %xmm0,%xmm1
mulsd  0xe98(%rip),%xmm1
addsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rdi
call   1040 <tan@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x30(%rsp)
movaps 0xe81(%rip),%xmm0
xorps  0x10(%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movapd 0x10(%rsp),%xmm1
movapd 0x20(%rsp),%xmm3
unpcklpd %xmm1,%xmm3
movapd 0x30(%rsp),%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm3,%xmm2
addpd  0xe56(%rip),%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
divsd  %xmm0,%xmm2
cvttsd2si %xmm2,%edi
movapd %xmm1,%xmm0
mulsd  0xe1a(%rip),%xmm0
call   1060 <pow@plt>
imul   %eax,%ebx
mov    %ebx,%edi
add    $0x40,%rsp
pop    %rbx
jmp    1050 <log@plt>

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

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