#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 atan2(double const, double const);
double sin(double const);
double approx_lat_from_parallax(const double rho_cos_phi,
                                const double rho_sin_phi,
                                const double axis_ratio) {
  const double flattening = 1. - axis_ratio;
  const double phi = atan2(rho_sin_phi, rho_cos_phi);
  const double lat =
      phi + flattening * (sin(phi * 2.) + .5 * flattening * sin(phi * 4.));
  return (lat);
}


x86 assembly (clang, -O0):
<approx_lat_from_parallax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xed9(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe97(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  0xe78(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe5e(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <sin@plt>
movsd  -0x50(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm4
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<approx_lat_from_parallax>:
sub    $0x28,%rsp
movaps %xmm0,%xmm3
movsd  0xed1(%rip),%xmm0
subsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rsp)
movapd %xmm1,%xmm0
movaps %xmm3,%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,0x8(%rsp)
addsd  %xmm0,%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0xea6(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0xe9a(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0x18(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @approx_lat_from_parallax(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* %6
%11 = fsub double 1.000000e+00, %10
store double %11, double* %7
%12 = load double, double* %5
%13 = load double, double* %4
%14 = call double @atan2(double %12, double %13)
store double %14, double* %8
%15 = load double, double* %8
%16 = load double, double* %7
%17 = load double, double* %8
%18 = fmul double %17, 2.000000e+00
%19 = call double @sin(double %18)
%20 = load double, double* %7
%21 = fmul double 5.000000e-01, %20
%22 = load double, double* %8
%23 = fmul double %22, 4.000000e+00
%24 = call double @sin(double %23)
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %19)
%26 = call double @llvm.fmuladd.f64(double %16, double %25, double %15)
store double %26, double* %9
%27 = load double, double* %9
ret double %27
}

LLVM IR (-O2):
define double @approx_lat_from_parallax(double %0, double %1, double %2) {
%4 = fsub double 1.000000e+00, %2
%5 = tail call double @atan2(double %1, double %0)
%6 = fmul double %5, 2.000000e+00
%7 = tail call double @sin(double %6)
%8 = fmul double %4, 5.000000e-01
%9 = fmul double %5, 4.000000e+00
%10 = tail call double @sin(double %9)
%11 = tail call double @llvm.fmuladd.f64(double %8, double %10, double %7)
%12 = tail call double @llvm.fmuladd.f64(double %4, double %11, double %5)
ret double %12
}