#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 cos(double);
double exp(double);
double sqrt(double);
double Xext(double scaleH, double zend, double Press) {
  return Press / 1013.0 /
         (cos(zend) + 0.01 * sqrt(scaleH / 1000.0) *
                          exp(-30.0 / sqrt(scaleH / 1000.0) * cos(zend)));
}


x86 assembly (clang, -O0):
<Xext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe8f(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe83(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe65(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe49(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xext>:
sub    $0x28,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x18(%rsp)
movapd %xmm1,%xmm0
call   1040 <cos@plt>
movsd  (%rsp),%xmm2
movsd  %xmm0,0x20(%rsp)
divsd  0xea7(%rip),%xmm2
sqrtsd %xmm2,%xmm3
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm2
movapd %xmm3,%xmm1
jae    119a <Xext+0x6a>
movapd %xmm2,%xmm0
movsd  %xmm2,(%rsp)
movsd  %xmm3,0x8(%rsp)
call   1050 <sqrt@plt>
xorpd  %xmm4,%xmm4
movsd  0x8(%rsp),%xmm3
movsd  (%rsp),%xmm2
movapd %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
divsd  0xe58(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
mulsd  0xe5a(%rip),%xmm1
movsd  %xmm1,(%rsp)
ucomisd %xmm4,%xmm2
jae    11ce <Xext+0x9e>
movapd %xmm2,%xmm0
call   1050 <sqrt@plt>
movapd %xmm0,%xmm3
movsd  0xe42(%rip),%xmm0
divsd  %xmm3,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0x8(%rsp),%xmm0
call   1030 <exp@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x20(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @Xext(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = fdiv double %7, 1.013000e+03
%9 = load double, double* %5
%10 = call double @cos(double %9)
%11 = load double, double* %4
%12 = fdiv double %11, 1.000000e+03
%13 = call double @sqrt(double %12)
%14 = fmul double 1.000000e-02, %13
%15 = load double, double* %4
%16 = fdiv double %15, 1.000000e+03
%17 = call double @sqrt(double %16)
%18 = fdiv double -3.000000e+01, %17
%19 = load double, double* %5
%20 = call double @cos(double %19)
%21 = fmul double %18, %20
%22 = call double @exp(double %21)
%23 = call double @llvm.fmuladd.f64(double %14, double %22, double %10)
%24 = fdiv double %8, %23
ret double %24
}

LLVM IR (-O2):
define double @Xext(double %0, double %1, double %2) {
%4 = fdiv double %2, 1.013000e+03
%5 = tail call double @cos(double %1)
%6 = fdiv double %0, 1.000000e+03
%7 = tail call double @sqrt(double %6)
%8 = fmul double %7, 1.000000e-02
%9 = tail call double @sqrt(double %6)
%10 = fdiv double -3.000000e+01, %9
%11 = tail call double @cos(double %1)
%12 = fmul double %10, %11
%13 = tail call double @exp(double %12)
%14 = tail call double @llvm.fmuladd.f64(double %8, double %13, double %5)
%15 = fdiv double %4, %14
ret double %15
}