#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 */
float bolton(float);
float logf(float);
float dewpoint(float rh, float t) {
  float l, rhd;
  if (rh < 0.0)
    rhd = 0.0;
  else if (rh > 100.0)
    rhd = 1.0;
  else
    rhd = rh / 100.0;
  l = logf(bolton(t) * rhd / 6.112);
  return (l * 243.5 / (17.67 - l));
}


x86 assembly (clang, -O0):
<dewpoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1155 <dewpoint+0x35>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11a5 <dewpoint+0x85>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1182 <dewpoint+0x62>
movss  0xea8(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11a0 <dewpoint+0x80>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe6d(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11a5 <dewpoint+0x85>
movss  -0x8(%rbp),%xmm0
call   1040 <bolton@plt>
mulss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe58(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <logf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe10(%rip),%xmm1
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dewpoint>:
push   %rax
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
ja     1147 <dewpoint+0x27>
ucomiss 0xed4(%rip),%xmm0
jbe    113c <dewpoint+0x1c>
movss  0xec6(%rip),%xmm2
jmp    1147 <dewpoint+0x27>
divss  0xec0(%rip),%xmm0
movaps %xmm0,%xmm2
movss  %xmm2,0x4(%rsp)
movaps %xmm1,%xmm0
call   1040 <bolton@plt>
mulss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xea1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <logf@plt>
cvtss2sd %xmm0,%xmm0
movsd  0xe94(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe90(%rip),%xmm2
subsd  %xmm0,%xmm2
divsd  %xmm2,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @dewpoint(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %2
store float 0.000000e+00, float* %6
br label %22
11: ; preds = %2
%12 = load float, float* %3
%13 = fpext float %12 to double
%14 = fcmp ogt double %13, 1.000000e+02
br i1 %14, label %15, label %16
15: ; preds = %11
store float 1.000000e+00, float* %6
br label %21
16: ; preds = %11
%17 = load float, float* %3
%18 = fpext float %17 to double
%19 = fdiv double %18, 1.000000e+02
%20 = fptrunc double %19 to float
store float %20, float* %6
br label %21
21: ; preds = %16, %15
br label %22
22: ; preds = %21, %10
%23 = load float, float* %4
%24 = call float @bolton(float %23)
%25 = load float, float* %6
%26 = fmul float %24, %25
%27 = fpext float %26 to double
%28 = fdiv double %27, 6.112000e+00
%29 = fptrunc double %28 to float
%30 = call float @logf(float %29)
store float %30, float* %5
%31 = load float, float* %5
%32 = fpext float %31 to double
%33 = fmul double %32, 2.435000e+02
%34 = load float, float* %5
%35 = fpext float %34 to double
%36 = fsub double 1.767000e+01, %35
%37 = fdiv double %33, %36
%38 = fptrunc double %37 to float
ret float %38
}

LLVM IR (-O2):
define float @dewpoint(float %0, float %1) {
%3 = fcmp olt float %0, 0.000000e+00
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = fcmp ogt float %0, 1.000000e+02
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = fdiv float %0, 1.000000e+02
br label %8
8: ; preds = %4, %2, %6
%9 = phi float [ %7, %6 ], [ 0.000000e+00, %2 ], [ 1.000000e+00, %4 ]
%10 = tail call float @bolton(float %1)
%11 = fmul float %9, %10
%12 = fpext float %11 to double
%13 = fdiv double %12, 6.112000e+00
%14 = fptrunc double %13 to float
%15 = tail call float @logf(float %14)
%16 = fpext float %15 to double
%17 = fmul double %16, 2.435000e+02
%18 = fsub double 1.767000e+01, %16
%19 = fdiv double %17, %18
%20 = fptrunc double %19 to float
ret float %20
}