#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 GetVapPresFromRelHum(double TDryBulb, double RelHum) {
  if (!(RelHum >= 0. && RelHum <= 1.)) {
    Assert("Relative humidity is outside range [0,1]",
           "/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",
           302);
  }
  return RelHum * GetSatVapPres(TDryBulb);
}


x86 assembly (clang, -O0):
<GetVapPresFromRelHum>:
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
jb     1157 <GetVapPresFromRelHum+0x37>
movsd  0xeb4(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jae    116f <GetVapPresFromRelHum+0x4f>
lea    0xeaa(%rip),%rdi
lea    0xecc(%rip),%rsi
mov    $0x12e,%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
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetVapPresFromRelHum>:
sub    $0x18,%rsp
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
movsd  %xmm1,0x10(%rsp)
jb     1142 <GetVapPresFromRelHum+0x22>
movsd  0xec4(%rip),%xmm2
ucomisd %xmm1,%xmm2
jae    1166 <GetVapPresFromRelHum+0x46>
lea    0xebf(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x12e,%edx
movsd  %xmm0,0x8(%rsp)
call   1040 <Assert@plt>
movsd  0x8(%rsp),%xmm0
call   1030 <GetSatVapPres@plt>
mulsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Relative humidity is outside range [0,1]\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 @GetVapPresFromRelHum(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 %7, label %10
7: ; preds = %2
%8 = load double, double* %4
%9 = fcmp ole double %8, 1.000000e+00
br i1 %9, label %12, label %10
10: ; preds = %7, %2
%11 = call i32 @Assert(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 302)
br label %12
12: ; preds = %10, %7
%13 = load double, double* %4
%14 = load double, double* %3
%15 = call double @GetSatVapPres(double %14)
%16 = fmul double %13, %15
ret double %16
}

LLVM IR (-O2):
@.str = [41 x i8] c"Relative humidity is outside range [0,1]\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 @GetVapPresFromRelHum(double %0, double %1) {
%3 = fcmp oge double %1, 0.000000e+00
%4 = fcmp ole double %1, 1.000000e+00
%5 = and i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @Assert(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 302)
br label %8
8: ; preds = %2, %6
%9 = tail call double @GetSatVapPres(double %0)
%10 = fmul double %9, %1
ret double %10
}