#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*/ deg2rad(double);
double tan(int /*<<< orphan*/);
double atmospheric_refraction_correction(double pressure, double temperature,
                                         double atmos_refract, double e0) {
  double del_e = 0;
  if (e0 >= -1 * (0.26667 + atmos_refract))
    del_e = (pressure / 1010.0) * (283.0 / (273.0 + temperature)) * 1.02 /
            (60.0 * tan(deg2rad(e0 + 10.3 / (e0 + 5.11))));
  return del_e;
}


x86 assembly (clang, -O0):
<atmospheric_refraction_correction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm2
addsd  -0x18(%rbp),%xmm2
movsd  0xea2(%rip),%xmm1
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     11f6 <atmospheric_refraction_correction+0xd6>
movsd  -0x8(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm2
addsd  -0x10(%rbp),%xmm2
movsd  0xe9e(%rip),%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe86(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe68(%rip),%xmm2
addsd  -0x20(%rbp),%xmm2
movsd  0xe53(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
call   1030 <deg2rad@plt>
mov    %eax,%edi
call   1040 <tan@plt>
movaps %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
movsd  0xe27(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atmospheric_refraction_correction>:
sub    $0x18,%rsp
addsd  0xed4(%rip),%xmm2
xorpd  0xefc(%rip),%xmm2
xorpd  %xmm4,%xmm4
ucomisd %xmm2,%xmm3
jb     11b1 <atmospheric_refraction_correction+0x91>
addsd  0xec2(%rip),%xmm1
shufpd $0x2,0xef1(%rip),%xmm0
movapd 0xef9(%rip),%xmm2
unpcklpd %xmm1,%xmm2
divpd  %xmm2,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xe9d(%rip),%xmm1
movapd %xmm1,(%rsp)
movsd  0xe98(%rip),%xmm1
addsd  %xmm3,%xmm1
movsd  0xe94(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
call   1030 <deg2rad@plt>
mov    %eax,%edi
call   1040 <tan@plt>
movapd (%rsp),%xmm4
mulsd  0xe7b(%rip),%xmm0
divsd  %xmm0,%xmm4
movapd %xmm4,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @atmospheric_refraction_correction(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
store double 0.000000e+00, double* %9
%10 = load double, double* %8
%11 = load double, double* %7
%12 = fadd double 2.666700e-01, %11
%13 = fmul double -1.000000e+00, %12
%14 = fcmp oge double %10, %13
br i1 %14, label %15, label %32
15: ; preds = %4
%16 = load double, double* %5
%17 = fdiv double %16, 1.010000e+03
%18 = load double, double* %6
%19 = fadd double 2.730000e+02, %18
%20 = fdiv double 2.830000e+02, %19
%21 = fmul double %17, %20
%22 = fmul double %21, 1.020000e+00
%23 = load double, double* %8
%24 = load double, double* %8
%25 = fadd double %24, 5.110000e+00
%26 = fdiv double 1.030000e+01, %25
%27 = fadd double %23, %26
%28 = call i32 @deg2rad(double %27)
%29 = call double @tan(i32 %28)
%30 = fmul double 6.000000e+01, %29
%31 = fdiv double %22, %30
store double %31, double* %9
br label %32
32: ; preds = %15, %4
%33 = load double, double* %9
ret double %33
}

LLVM IR (-O2):
define double @atmospheric_refraction_correction(double %0, double %1, double %2, double %3) {
%5 = fadd double %2, 2.666700e-01
%6 = fneg double %5
%7 = fcmp ugt double %6, %3
br i1 %7, label %24, label %8
8: ; preds = %4
%9 = fadd double %1, 2.730000e+02
%10 = insertelement <2 x double> <double poison, double 2.830000e+02>, double %0, i64 0
%11 = insertelement <2 x double> <double 1.010000e+03, double poison>, double %9, i64 1
%12 = fdiv <2 x double> %10, %11
%13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%14 = fmul <2 x double> %12, %13
%15 = extractelement <2 x double> %14, i64 0
%16 = fmul double %15, 1.020000e+00
%17 = fadd double %3, 5.110000e+00
%18 = fdiv double 1.030000e+01, %17
%19 = fadd double %18, %3
%20 = tail call i32 @deg2rad(double %19)
%21 = tail call double @tan(i32 %20)
%22 = fmul double %21, 6.000000e+01
%23 = fdiv double %16, %22
br label %24
24: ; preds = %8, %4
%25 = phi double [ %23, %8 ], [ 0.000000e+00, %4 ]
ret double %25
}