#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 */
double pow(double, double);
double humidityIndex(double t, double e, double r, double missval) {
  static const double tmin = 26.0;
  static const double rmin = 40.0;
  if (t < tmin || r < rmin)
    return missval;
  return t + (5.0 / 9.0) *
                 ((0.01 * r * e * 6.112 * pow(10.0, (7.5 * t) / (237.7 + t))) -
                  10.0);
}


x86 assembly (clang, -O0):
<humidityIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  0xecc(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     1152 <humidityIndex+0x42>
movsd  0xec1(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1161 <humidityIndex+0x51>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11eb <humidityIndex+0xdb>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xecd(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xeb3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe9a(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe85(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe6c(%rip),%xmm0
call   1030 <pow@plt>
movsd  -0x38(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm2,%xmm0
movsd  0xe46(%rip),%xmm2
addsd  %xmm2,%xmm0
movsd  0xe32(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<humidityIndex>:
sub    $0x18,%rsp
movapd %xmm0,%xmm4
movsd  0xee0(%rip),%xmm0
ucomisd %xmm4,%xmm0
ja     119e <humidityIndex+0x8e>
movsd  0xeda(%rip),%xmm0
ucomisd %xmm2,%xmm0
ja     119e <humidityIndex+0x8e>
mulsd  0xed4(%rip),%xmm2
mulsd  %xmm1,%xmm2
mulsd  0xed0(%rip),%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  0xeca(%rip),%xmm1
mulsd  %xmm4,%xmm1
movsd  0xec6(%rip),%xmm0
addsd  %xmm4,%xmm0
divsd  %xmm0,%xmm1
movsd  0xebe(%rip),%xmm0
movsd  %xmm4,0x10(%rsp)
call   1030 <pow@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0xead(%rip),%xmm0
mulsd  0xead(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret
movaps %xmm3,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@humidityIndex.tmin = internal constant double 2.600000e+01
@humidityIndex.rmin = internal constant double 4.000000e+01
define double @humidityIndex(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%10 = load double, double* %6
%11 = fcmp olt double %10, 2.600000e+01
br i1 %11, label %15, label %12
12: ; preds = %4
%13 = load double, double* %8
%14 = fcmp olt double %13, 4.000000e+01
br i1 %14, label %15, label %17
15: ; preds = %12, %4
%16 = load double, double* %9
store double %16, double* %5
br label %32
17: ; preds = %12
%18 = load double, double* %6
%19 = load double, double* %8
%20 = fmul double 1.000000e-02, %19
%21 = load double, double* %7
%22 = fmul double %20, %21
%23 = fmul double %22, 6.112000e+00
%24 = load double, double* %6
%25 = fmul double 7.500000e+00, %24
%26 = load double, double* %6
%27 = fadd double 2.377000e+02, %26
%28 = fdiv double %25, %27
%29 = call double @pow(double 1.000000e+01, double %28)
%30 = call double @llvm.fmuladd.f64(double %23, double %29, double -1.000000e+01)
%31 = call double @llvm.fmuladd.f64(double 0x3FE1C71C71C71C72, double %30, double %18)
store double %31, double* %5
br label %32
32: ; preds = %17, %15
%33 = load double, double* %5
ret double %33
}

LLVM IR (-O2):
define double @humidityIndex(double %0, double %1, double %2, double %3) {
%5 = fcmp olt double %0, 2.600000e+01
%6 = fcmp olt double %2, 4.000000e+01
%7 = or i1 %5, %6
br i1 %7, label %18, label %8
8: ; preds = %4
%9 = fmul double %2, 1.000000e-02
%10 = fmul double %9, %1
%11 = fmul double %10, 6.112000e+00
%12 = fmul double %0, 7.500000e+00
%13 = fadd double %0, 2.377000e+02
%14 = fdiv double %12, %13
%15 = tail call double @pow(double 1.000000e+01, double %14)
%16 = tail call double @llvm.fmuladd.f64(double %11, double %15, double -1.000000e+01)
%17 = tail call double @llvm.fmuladd.f64(double %16, double 0x3FE1C71C71C71C72, double %0)
br label %18
18: ; preds = %4, %8
%19 = phi double [ %17, %8 ], [ %3, %4 ]
ret double %19
}