#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 GetVapPresFromHumRatio(double HumRatio, double Pressure) {
  double VapPres, BoundedHumRatio;
  if (!(HumRatio >= 0.)) {
    Assert("Humidity ratio 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",
           606);
  }
  BoundedHumRatio = (((HumRatio) > (1e-7)) ? (HumRatio) : (1e-7));
  VapPres = Pressure * BoundedHumRatio / (0.621945 + BoundedHumRatio);
  return VapPres;
}


x86 assembly (clang, -O0):
<GetVapPresFromHumRatio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    114c <GetVapPresFromHumRatio+0x3c>
lea    0xed5(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0x25e,%edx
call   1030 <Assert@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xea7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1172 <GetVapPresFromHumRatio+0x62>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1184 <GetVapPresFromHumRatio+0x74>
movsd  0xe86(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1184 <GetVapPresFromHumRatio+0x74>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe68(%rip),%xmm1
addsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetVapPresFromHumRatio>:
sub    $0x18,%rsp
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jae    114e <GetVapPresFromHumRatio+0x3e>
lea    0xeeb(%rip),%rdi
lea    0xeff(%rip),%rsi
mov    $0x25e,%edx
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <Assert@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
maxsd  0xeaa(%rip),%xmm0
mulsd  %xmm0,%xmm1
addsd  0xea6(%rip),%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Humidity ratio 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 @GetVapPresFromHumRatio(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = fcmp oge double %7, 0.000000e+00
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @Assert(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 606)
br label %11
11: ; preds = %9, %2
%12 = load double, double* %3
%13 = fcmp ogt double %12, 0x3E7AD7F29ABCAF48
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load double, double* %3
br label %17
16: ; preds = %11
br label %17
17: ; preds = %16, %14
%18 = phi double [ %15, %14 ], [ 0x3E7AD7F29ABCAF48, %16 ]
store double %18, double* %6
%19 = load double, double* %4
%20 = load double, double* %6
%21 = fmul double %19, %20
%22 = load double, double* %6
%23 = fadd double 0x3FE3E6F9335D249E, %22
%24 = fdiv double %21, %23
store double %24, double* %5
%25 = load double, double* %5
ret double %25
}

LLVM IR (-O2):
@.str = [27 x i8] c"Humidity ratio 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 @GetVapPresFromHumRatio(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 ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 606)
br label %6
6: ; preds = %4, %2
%7 = fcmp ogt double %0, 0x3E7AD7F29ABCAF48
%8 = select i1 %7, double %0, double 0x3E7AD7F29ABCAF48
%9 = fmul double %8, %1
%10 = fadd double %8, 0x3FE3E6F9335D249E
%11 = fdiv double %9, %10
ret double %11
}