#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 mh_eto(double ra, double tavg, double tmax, double tmin, double p) {
  double td, result;
  td = tmax - tmin;
  if (tavg > 100.0) {
    tavg = tavg - 273.15;
  }
  ra = ra * (84600.0 * 1000.0);
  result = 0.0013 * 0.408 * ra * (tavg + 17.0) * pow((td - 0.0123 * p), 0.76);
  return result;
}


x86 assembly (clang, -O0):
<mh_eto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    116d <mh_eto+0x5d>
movsd  -0x10(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xea1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe8c(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  0xe64(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe4c(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mh_eto>:
push   %rax
movsd  0xee7(%rip),%xmm6
addsd  %xmm1,%xmm6
movsd  0xee3(%rip),%xmm5
cmpltsd %xmm1,%xmm5
andpd  %xmm5,%xmm6
andnpd %xmm1,%xmm5
orpd   %xmm6,%xmm5
subsd  %xmm3,%xmm2
mulsd  0xece(%rip),%xmm0
mulsd  0xece(%rip),%xmm0
addsd  0xece(%rip),%xmm5
mulsd  %xmm5,%xmm0
movsd  %xmm0,(%rsp)
mulsd  0xec5(%rip),%xmm4
addsd  %xmm2,%xmm4
movsd  0xec1(%rip),%xmm1
movapd %xmm4,%xmm0
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mh_eto(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%13 = load double, double* %8
%14 = load double, double* %9
%15 = fsub double %13, %14
store double %15, double* %11
%16 = load double, double* %7
%17 = fcmp ogt double %16, 1.000000e+02
br i1 %17, label %18, label %21
18: ; preds = %5
%19 = load double, double* %7
%20 = fsub double %19, 2.731500e+02
store double %20, double* %7
br label %21
21: ; preds = %18, %5
%22 = load double, double* %6
%23 = fmul double %22, 8.460000e+07
store double %23, double* %6
%24 = load double, double* %6
%25 = fmul double 5.304000e-04, %24
%26 = load double, double* %7
%27 = fadd double %26, 1.700000e+01
%28 = fmul double %25, %27
%29 = load double, double* %11
%30 = load double, double* %10
%31 = call double @llvm.fmuladd.f64(double -1.230000e-02, double %30, double %29)
%32 = call double @pow(double %31, double 7.600000e-01)
%33 = fmul double %28, %32
store double %33, double* %12
%34 = load double, double* %12
ret double %34
}

LLVM IR (-O2):
define double @mh_eto(double %0, double %1, double %2, double %3, double %4) {
%6 = fcmp ogt double %1, 1.000000e+02
%7 = fadd double %1, -2.731500e+02
%8 = select i1 %6, double %7, double %1
%9 = fsub double %2, %3
%10 = fmul double %0, 8.460000e+07
%11 = fmul double %10, 5.304000e-04
%12 = fadd double %8, 1.700000e+01
%13 = fmul double %11, %12
%14 = tail call double @llvm.fmuladd.f64(double %4, double -1.230000e-02, double %9)
%15 = tail call double @pow(double %14, double 7.600000e-01)
%16 = fmul double %13, %15
ret double %16
}