#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 GetHumRatioFromVapPres(double VapPres, double Pressure) {
  double HumRatio;
  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",
           589);
  }
  HumRatio = 0.621945 * VapPres / (Pressure - VapPres);
  return (((HumRatio) > (1e-7)) ? (HumRatio) : (1e-7));
}


x86 assembly (clang, -O0):
<GetHumRatioFromVapPres>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    114c <GetHumRatioFromVapPres+0x3c>
lea    0xed5(%rip),%rdi
lea    0xf07(%rip),%rsi
mov    $0x24d,%edx
call   1030 <Assert@plt>
movsd  0xeb4(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe87(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1192 <GetHumRatioFromVapPres+0x82>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11a4 <GetHumRatioFromVapPres+0x94>
movsd  0xe66(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11a4 <GetHumRatioFromVapPres+0x94>
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetHumRatioFromVapPres>:
sub    $0x18,%rsp
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jae    114e <GetHumRatioFromVapPres+0x3e>
lea    0xeeb(%rip),%rdi
lea    0xf1d(%rip),%rsi
mov    $0x24d,%edx
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
call   1030 <Assert@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
subsd  %xmm0,%xmm1
mulsd  0xea6(%rip),%xmm0
divsd  %xmm1,%xmm0
maxsd  0xea2(%rip),%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 @GetHumRatioFromVapPres(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fcmp oge double %6, 0.000000e+00
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = 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 589)
br label %10
10: ; preds = %8, %2
%11 = load double, double* %3
%12 = fmul double 0x3FE3E6F9335D249E, %11
%13 = load double, double* %4
%14 = load double, double* %3
%15 = fsub double %13, %14
%16 = fdiv double %12, %15
store double %16, double* %5
%17 = load double, double* %5
%18 = fcmp ogt double %17, 0x3E7AD7F29ABCAF48
br i1 %18, label %19, label %21
19: ; preds = %10
%20 = load double, double* %5
br label %22
21: ; preds = %10
br label %22
22: ; preds = %21, %19
%23 = phi double [ %20, %19 ], [ 0x3E7AD7F29ABCAF48, %21 ]
ret double %23
}

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 @GetHumRatioFromVapPres(double %0, double %1) {
%3 = fcmp ult double %0, 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 589)
br label %6
6: ; preds = %4, %2
%7 = fmul double %0, 0x3FE3E6F9335D249E
%8 = fsub double %1, %0
%9 = fdiv double %7, %8
%10 = fcmp ogt double %9, 0x3E7AD7F29ABCAF48
%11 = select i1 %10, double %9, double 0x3E7AD7F29ABCAF48
ret double %11
}