#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 /*<<< orphan*/ ln_deg_to_rad(double);
double sin(int /*<<< orphan*/);
double tan(int /*<<< orphan*/);
double ln_get_refraction_adj(double altitude, double atm_pres, double temp) {
  long double R;
  R = 1.0 / tan(ln_deg_to_rad(altitude + (7.31 / (altitude + 4.4))));
  R -= 0.06 * sin(ln_deg_to_rad(14.7 * (R / 60.0) + 13.0));
  R *= ((atm_pres / 1010.0) * (283.0 / (273.0 + temp)));
  R /= 60.0;
  return R;
}


x86 assembly (clang, -O0):
<ln_get_refraction_adj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeac(%rip),%xmm1
movaps %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  0xea5(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
call   1050 <ln_deg_to_rad@plt>
mov    %eax,%edi
call   1040 <tan@plt>
movaps %xmm0,%xmm1
movsd  0xe8e(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
fldl   -0x38(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
flds   0xea6(%rip)
fld    %st(0)
fstpt  -0x64(%rbp)
fdivrp %st,%st(1)
fldl   0xe71(%rip)
fmulp  %st,%st(1)
flds   0xe95(%rip)
faddp  %st,%st(1)
fstpl  -0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1050 <ln_deg_to_rad@plt>
mov    %eax,%edi
call   1030 <sin@plt>
fldt   -0x64(%rbp)
movsd  0xe50(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
fldl   -0x48(%rbp)
fldt   -0x30(%rbp)
faddp  %st,%st(1)
fstpt  -0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe37(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0xe2e(%rip),%xmm1
addsd  %xmm1,%xmm2
movsd  0xe2a(%rip),%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
fldl   -0x50(%rbp)
fldt   -0x30(%rbp)
fmulp  %st,%st(1)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fdivp  %st,%st(1)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fstpl  -0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_refraction_adj>:
sub    $0x68,%rsp
movaps %xmm2,0x40(%rsp)
movaps %xmm1,0x50(%rsp)
movsd  0xeba(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb6(%rip),%xmm2
divsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
call   1050 <ln_deg_to_rad@plt>
mov    %eax,%edi
call   1040 <tan@plt>
movsd  0xea2(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
fldl   0x18(%rsp)
fld    %st(0)
fstpt  0x28(%rsp)
flds   0xea8(%rip)
fld    %st(0)
fstpt  0x34(%rsp)
fdivrp %st,%st(1)
fmull  0xe82(%rip)
fadds  0xe98(%rip)
fstpl  0x10(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <ln_deg_to_rad@plt>
mov    %eax,%edi
call   1030 <sin@plt>
mulsd  0xe66(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
fldt   0x28(%rsp)
faddl  0x8(%rsp)
movapd 0x40(%rsp),%xmm2
addsd  0xe52(%rip),%xmm2
movapd 0x50(%rsp),%xmm1
shufpd $0x2,0xe5b(%rip),%xmm1
movapd 0xe63(%rip),%xmm0
unpcklpd %xmm2,%xmm0
divpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
fmull  0x20(%rsp)
fldt   0x34(%rsp)
fdivrp %st,%st(1)
fstpl  (%rsp)
movsd  (%rsp),%xmm0
add    $0x68,%rsp
ret

LLVM IR (-O0):
define double @ln_get_refraction_adj(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca x86_fp80
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %4
%10 = fadd double %9, 4.400000e+00
%11 = fdiv double 7.310000e+00, %10
%12 = fadd double %8, %11
%13 = call i32 @ln_deg_to_rad(double %12)
%14 = call double @tan(i32 %13)
%15 = fdiv double 1.000000e+00, %14
%16 = fpext double %15 to x86_fp80
store x86_fp80 %16, x86_fp80* %7
%17 = load x86_fp80, x86_fp80* %7
%18 = fdiv x86_fp80 %17, 0xK4004F000000000000000
%19 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 0xK4002EB33333333333000, x86_fp80 %18, x86_fp80 0xK4002D000000000000000)
%20 = fptrunc x86_fp80 %19 to double
%21 = call i32 @ln_deg_to_rad(double %20)
%22 = call double @sin(i32 %21)
%23 = fmul double 6.000000e-02, %22
%24 = fpext double %23 to x86_fp80
%25 = load x86_fp80, x86_fp80* %7
%26 = fsub x86_fp80 %25, %24
store x86_fp80 %26, x86_fp80* %7
%27 = load double, double* %5
%28 = fdiv double %27, 1.010000e+03
%29 = load double, double* %6
%30 = fadd double 2.730000e+02, %29
%31 = fdiv double 2.830000e+02, %30
%32 = fmul double %28, %31
%33 = fpext double %32 to x86_fp80
%34 = load x86_fp80, x86_fp80* %7
%35 = fmul x86_fp80 %34, %33
store x86_fp80 %35, x86_fp80* %7
%36 = load x86_fp80, x86_fp80* %7
%37 = fdiv x86_fp80 %36, 0xK4004F000000000000000
store x86_fp80 %37, x86_fp80* %7
%38 = load x86_fp80, x86_fp80* %7
%39 = fptrunc x86_fp80 %38 to double
ret double %39
}

LLVM IR (-O2):
define double @ln_get_refraction_adj(double %0, double %1, double %2) {
%4 = fadd double %0, 4.400000e+00
%5 = fdiv double 7.310000e+00, %4
%6 = fadd double %5, %0
%7 = tail call i32 @ln_deg_to_rad(double %6)
%8 = tail call double @tan(i32 %7)
%9 = fdiv double 1.000000e+00, %8
%10 = fpext double %9 to x86_fp80
%11 = fdiv x86_fp80 %10, 0xK4004F000000000000000
%12 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %11, x86_fp80 0xK4002EB33333333333000, x86_fp80 0xK4002D000000000000000)
%13 = fptrunc x86_fp80 %12 to double
%14 = tail call i32 @ln_deg_to_rad(double %13)
%15 = tail call double @sin(i32 %14)
%16 = fmul double %15, 6.000000e-02
%17 = fpext double %16 to x86_fp80
%18 = fsub x86_fp80 %10, %17
%19 = fadd double %2, 2.730000e+02
%20 = insertelement <2 x double> <double poison, double 2.830000e+02>, double %1, i64 0
%21 = insertelement <2 x double> <double 1.010000e+03, double poison>, double %19, i64 1
%22 = fdiv <2 x double> %20, %21
%23 = shufflevector <2 x double> %22, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%24 = fmul <2 x double> %22, %23
%25 = extractelement <2 x double> %24, i64 0
%26 = fpext double %25 to x86_fp80
%27 = fmul x86_fp80 %18, %26
%28 = fdiv x86_fp80 %27, 0xK4004F000000000000000
%29 = fptrunc x86_fp80 %28 to double
ret double %29
}