#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 log10(float);
float calc_dewpoint(float h, float t) {
  float k, dew_point;
  k = (log10(h) - 2) / 0.4343 + (17.62 * t) / (243.12 + t);
  dew_point = 243.12 * k / (17.62 - k);
  return dew_point;
}


x86 assembly (clang, -O0):
<calc_dewpoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log10@plt>
sub    $0x2,%eax
cvtsi2sd %eax,%xmm0
movsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xeb0(%rip),%xmm1
mulsd  %xmm2,%xmm1
movss  -0x8(%rbp),%xmm2
cvtss2sd %xmm2,%xmm3
movsd  0xea3(%rip),%xmm2
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe7d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe60(%rip),%xmm1
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_dewpoint>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1030 <log10@plt>
add    $0xfffffffe,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xec8(%rip),%xmm2
movaps %xmm1,%xmm3
mulsd  %xmm2,%xmm3
movsd  0xec1(%rip),%xmm4
addsd  %xmm4,%xmm1
shufpd $0x2,0xebc(%rip),%xmm1
unpcklpd %xmm0,%xmm3
divpd  %xmm1,%xmm3
movapd %xmm3,%xmm0
unpckhpd %xmm3,%xmm0
addsd  %xmm3,%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm0,%xmm4
subsd  %xmm0,%xmm2
divsd  %xmm2,%xmm4
xorps  %xmm0,%xmm0
cvtsd2ss %xmm4,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @calc_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 = call i32 @log10(float %7)
%9 = sub nsw i32 %8, 2
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 4.343000e-01
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = fmul double 1.762000e+01, %13
%15 = load float, float* %4
%16 = fpext float %15 to double
%17 = fadd double 2.431200e+02, %16
%18 = fdiv double %14, %17
%19 = fadd double %11, %18
%20 = fptrunc double %19 to float
store float %20, float* %5
%21 = load float, float* %5
%22 = fpext float %21 to double
%23 = fmul double 2.431200e+02, %22
%24 = load float, float* %5
%25 = fpext float %24 to double
%26 = fsub double 1.762000e+01, %25
%27 = fdiv double %23, %26
%28 = fptrunc double %27 to float
store float %28, float* %6
%29 = load float, float* %6
ret float %29
}

LLVM IR (-O2):
define float @calc_dewpoint(float %0, float %1) {
%3 = tail call i32 @log10(float %0)
%4 = add nsw i32 %3, -2
%5 = sitofp i32 %4 to double
%6 = fpext float %1 to double
%7 = fmul double %6, 1.762000e+01
%8 = fadd double %6, 2.431200e+02
%9 = insertelement <2 x double> poison, double %7, i64 0
%10 = insertelement <2 x double> %9, double %5, i64 1
%11 = insertelement <2 x double> <double poison, double 4.343000e-01>, double %8, i64 0
%12 = fdiv <2 x double> %10, %11
%13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%14 = fadd <2 x double> %12, %13
%15 = extractelement <2 x double> %14, i64 0
%16 = fptrunc double %15 to float
%17 = fpext float %16 to double
%18 = fmul double %17, 2.431200e+02
%19 = fsub double 1.762000e+01, %17
%20 = fdiv double %18, %19
%21 = fptrunc double %20 to float
ret float %21
}