#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*/ Assert(char *, char *, int);
double GetSatVapPres(double);
double GetRelHumFromVapPres(double TDryBulb, double VapPres) {
  if (!(VapPres >= 0.)) {
    Assert("Partial pressure of water vapor in moist air is negative",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/psychrometrics/psychrolib/refs/heads/"
           "master/src/c/psychrolib.c",
           314);
  }
  return VapPres / GetSatVapPres(TDryBulb);
}


x86 assembly (clang, -O0):
<GetRelHumFromVapPres>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    115c <GetRelHumFromVapPres+0x3c>
lea    0xeb5(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x13a,%edx
call   1040 <Assert@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <GetSatVapPres@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRelHumFromVapPres>:
sub    $0x18,%rsp
xorpd  %xmm2,%xmm2
movsd  %xmm1,0x10(%rsp)
ucomisd %xmm2,%xmm1
jae    1158 <GetRelHumFromVapPres+0x38>
lea    0xec5(%rip),%rdi
lea    0xef7(%rip),%rsi
mov    $0x13a,%edx
movsd  %xmm0,0x8(%rsp)
call   1040 <Assert@plt>
movsd  0x8(%rsp),%xmm0
call   1030 <GetSatVapPres@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [57 x i8] c"Partial pressure of water vapor in moist air is negative\00"
@.str.1 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/psychrometrics/psychrolib/refs/heads/master/src/c/psychrolib.c\00"
define double @GetRelHumFromVapPres(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp oge double %5, 0.000000e+00
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @Assert(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 314)
br label %9
9: ; preds = %7, %2
%10 = load double, double* %4
%11 = load double, double* %3
%12 = call double @GetSatVapPres(double %11)
%13 = fdiv double %10, %12
ret double %13
}

LLVM IR (-O2):
@.str = [57 x i8] c"Partial pressure of water vapor in moist air is negative\00"
@.str.1 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/psychrometrics/psychrolib/refs/heads/master/src/c/psychrolib.c\00"
define double @GetRelHumFromVapPres(double %0, double %1) {
%3 = fcmp ult double %1, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @Assert(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 314)
br label %6
6: ; preds = %4, %2
%7 = tail call double @GetSatVapPres(double %0)
%8 = fdiv double %1, %7
ret double %8
}