#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 */
float atmos_geopotential_alt(float);
float correct(int /*<<< orphan*/, float);
int /*<<< orphan*/ dewpoint(float, float);
float powf(double, float);
float atmos_press_adjust(float Z2, float Z1, float T1, float RH1) {
  float C, L, Tmv, Hd;
  Hd = atmos_geopotential_alt(Z1) - atmos_geopotential_alt(Z2);
  L = Hd / 400.0;
  if (RH1 >= 0.0)
    C = correct(dewpoint(RH1, T1), Z1);
  Tmv = T1 + L + C + 273.15;
  return (powf(10.0, Hd / (67.442 * Tmv)));
}


x86 assembly (clang, -O0):
<atmos_press_adjust>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <atmos_geopotential_alt@plt>
movss  %xmm0,-0x24(%rbp)
movss  -0x4(%rbp),%xmm0
call   1050 <atmos_geopotential_alt@plt>
movaps %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe69(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11da <atmos_press_adjust+0x9a>
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1040 <dewpoint@plt>
mov    %eax,%edi
movss  -0x8(%rbp),%xmm0
call   1060 <correct@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe23(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x1c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xdf4(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm1
movsd  0xdd8(%rip),%xmm0
call   1030 <powf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atmos_press_adjust>:
sub    $0x18,%rsp
movss  %xmm3,0x14(%rsp)
movss  %xmm2,0x8(%rsp)
movss  %xmm0,0x10(%rsp)
movss  %xmm1,0xc(%rsp)
movaps %xmm1,%xmm0
call   1050 <atmos_geopotential_alt@plt>
movss  %xmm0,0x4(%rsp)
movss  0x10(%rsp),%xmm0
call   1050 <atmos_geopotential_alt@plt>
movss  0x14(%rsp),%xmm1
movss  0x4(%rsp),%xmm2
subss  %xmm0,%xmm2
movss  %xmm2,0x4(%rsp)
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jb     11ae <atmos_press_adjust+0x6e>
movaps %xmm1,%xmm0
movss  0x8(%rsp),%xmm1
call   1040 <dewpoint@plt>
mov    %eax,%edi
movss  0xc(%rsp),%xmm0
call   1060 <correct@plt>
movss  0x4(%rsp),%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
divss  0xe3d(%rip),%xmm2
addss  0x8(%rsp),%xmm2
addss  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
addsd  0xe2c(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe24(%rip),%xmm0
divsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
movsd  0xe1c(%rip),%xmm0
add    $0x18,%rsp
jmp    1030 <powf@plt>

LLVM IR (-O0):
define float @atmos_press_adjust(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%13 = load float, float* %6
%14 = call float @atmos_geopotential_alt(float %13)
%15 = load float, float* %5
%16 = call float @atmos_geopotential_alt(float %15)
%17 = fsub float %14, %16
store float %17, float* %12
%18 = load float, float* %12
%19 = fpext float %18 to double
%20 = fdiv double %19, 4.000000e+02
%21 = fptrunc double %20 to float
store float %21, float* %10
%22 = load float, float* %8
%23 = fpext float %22 to double
%24 = fcmp oge double %23, 0.000000e+00
br i1 %24, label %25, label %31
25: ; preds = %4
%26 = load float, float* %8
%27 = load float, float* %7
%28 = call i32 @dewpoint(float %26, float %27)
%29 = load float, float* %6
%30 = call float @correct(i32 %28, float %29)
store float %30, float* %9
br label %31
31: ; preds = %25, %4
%32 = load float, float* %7
%33 = load float, float* %10
%34 = fadd float %32, %33
%35 = load float, float* %9
%36 = fadd float %34, %35
%37 = fpext float %36 to double
%38 = fadd double %37, 2.731500e+02
%39 = fptrunc double %38 to float
store float %39, float* %11
%40 = load float, float* %12
%41 = fpext float %40 to double
%42 = load float, float* %11
%43 = fpext float %42 to double
%44 = fmul double 6.744200e+01, %43
%45 = fdiv double %41, %44
%46 = fptrunc double %45 to float
%47 = call float @powf(double 1.000000e+01, float %46)
ret float %47
}

LLVM IR (-O2):
define float @atmos_press_adjust(float %0, float %1, float %2, float %3) {
%5 = tail call float @atmos_geopotential_alt(float %1)
%6 = tail call float @atmos_geopotential_alt(float %0)
%7 = fsub float %5, %6
%8 = fcmp ult float %3, 0.000000e+00
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = tail call i32 @dewpoint(float %3, float %2)
%11 = tail call float @correct(i32 %10, float %1)
br label %12
12: ; preds = %9, %4
%13 = phi float [ %11, %9 ], [ undef, %4 ]
%14 = fpext float %7 to double
%15 = fdiv float %7, 4.000000e+02
%16 = fadd float %15, %2
%17 = fadd float %16, %13
%18 = fpext float %17 to double
%19 = fadd double %18, 2.731500e+02
%20 = fptrunc double %19 to float
%21 = fpext float %20 to double
%22 = fmul double %21, 6.744200e+01
%23 = fdiv double %14, %22
%24 = fptrunc double %23 to float
%25 = tail call float @powf(double 1.000000e+01, float %24)
ret float %25
}