#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 log(float);
float hr202l_100(int adc, float T) {
  float a, b, c;
  float tt = T * T;
  a = 112.016090 - 0.360150168 * T + 1.156667e-03 * tt;
  b = -12.725041 - 0.066866381 * T - 1.365699e-04 * tt;
  c = 0.373017 - 0.006363128 * T + 5.289157e-05 * tt;
  float logR;
  logR = log((float)100 / ((float)1023 / ((float)adc) - 1));
  return a + b * logR + c * logR * logR;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xf08(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xf04(%rip),%xmm0
addsd  %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedf(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xead(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xea9(%rip),%xmm0
addsd  %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe84(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe52(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe4e(%rip),%xmm0
addsd  %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe29(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  0xe03(%rip),%xmm1
divss  %xmm0,%xmm1
movss  0xdf3(%rip),%xmm0
subss  %xmm0,%xmm1
movss  0xde3(%rip),%xmm0
divss  %xmm1,%xmm0
call   1030 <log@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
sub    $0x18,%rsp
cvtss2sd %xmm0,%xmm1
mulss  %xmm0,%xmm0
movsd  0xedc(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xed8(%rip),%xmm2
cvtss2sd %xmm0,%xmm0
movsd  0xed4(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
xorps  %xmm2,%xmm2
cvtsd2ss %xmm3,%xmm2
movss  %xmm2,0x14(%rsp)
movsd  0xebf(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xebb(%rip),%xmm2
movsd  0xebb(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
xorps  %xmm2,%xmm2
cvtsd2ss %xmm3,%xmm2
movss  %xmm2,0x10(%rsp)
mulsd  0xea6(%rip),%xmm1
addsd  0xea6(%rip),%xmm1
mulsd  0xea6(%rip),%xmm0
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %edi,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
movss  0xe91(%rip),%xmm2
divss  %xmm1,%xmm2
addss  0xe89(%rip),%xmm2
movss  0xe85(%rip),%xmm0
divss  %xmm2,%xmm0
call   1030 <log@plt>
movss  0x10(%rsp),%xmm1
mulss  %xmm0,%xmm1
addss  0x14(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @hr202l_100(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%10 = load float, float* %4
%11 = load float, float* %4
%12 = fmul float %10, %11
store float %12, float* %8
%13 = load float, float* %4
%14 = fpext float %13 to double
%15 = call double @llvm.fmuladd.f64(double 0xBFD70CB34A4D5EB6, double %14, double 0x405C01079E59F2BB)
%16 = load float, float* %8
%17 = fpext float %16 to double
%18 = call double @llvm.fmuladd.f64(double 0x3F52F369BBFDBEFF, double %17, double %15)
%19 = fptrunc double %18 to float
store float %19, float* %5
%20 = load float, float* %4
%21 = fpext float %20 to double
%22 = call double @llvm.fmuladd.f64(double 0xBFB11E27B798CCDA, double %21, double 0xC029733892EE84AD)
%23 = load float, float* %8
%24 = fpext float %23 to double
%25 = call double @llvm.fmuladd.f64(double 0xBF21E686821BC0D4, double %24, double %22)
%26 = fptrunc double %25 to float
store float %26, float* %6
%27 = load float, float* %4
%28 = fpext float %27 to double
%29 = call double @llvm.fmuladd.f64(double 0xBF7A10392A906EC5, double %28, double 3.730170e-01)
%30 = load float, float* %8
%31 = fpext float %30 to double
%32 = call double @llvm.fmuladd.f64(double 0x3F0BBAFC81CF852F, double %31, double %29)
%33 = fptrunc double %32 to float
store float %33, float* %7
%34 = load i32, i32* %3
%35 = sitofp i32 %34 to float
%36 = fdiv float 1.023000e+03, %35
%37 = fsub float %36, 1.000000e+00
%38 = fdiv float 1.000000e+02, %37
%39 = call float @log(float %38)
store float %39, float* %9
%40 = load float, float* %5
%41 = load float, float* %6
%42 = load float, float* %9
%43 = call float @llvm.fmuladd.f32(float %41, float %42, float %40)
%44 = load float, float* %7
%45 = load float, float* %9
%46 = fmul float %44, %45
%47 = load float, float* %9
%48 = call float @llvm.fmuladd.f32(float %46, float %47, float %43)
ret float %48
}

LLVM IR (-O2):
define float @hr202l_100(i32 %0, float %1) {
%3 = fmul float %1, %1
%4 = fpext float %1 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double 0xBFD70CB34A4D5EB6, double 0x405C01079E59F2BB)
%6 = fpext float %3 to double
%7 = tail call double @llvm.fmuladd.f64(double %6, double 0x3F52F369BBFDBEFF, double %5)
%8 = fptrunc double %7 to float
%9 = tail call double @llvm.fmuladd.f64(double %4, double 0xBFB11E27B798CCDA, double 0xC029733892EE84AD)
%10 = tail call double @llvm.fmuladd.f64(double %6, double 0xBF21E686821BC0D4, double %9)
%11 = fptrunc double %10 to float
%12 = tail call double @llvm.fmuladd.f64(double %4, double 0xBF7A10392A906EC5, double 3.730170e-01)
%13 = tail call double @llvm.fmuladd.f64(double %6, double 0x3F0BBAFC81CF852F, double %12)
%14 = fptrunc double %13 to float
%15 = sitofp i32 %0 to float
%16 = fdiv float 1.023000e+03, %15
%17 = fadd float %16, -1.000000e+00
%18 = fdiv float 1.000000e+02, %17
%19 = tail call float @log(float %18)
%20 = tail call float @llvm.fmuladd.f32(float %11, float %19, float %8)
%21 = fmul float %19, %14
%22 = tail call float @llvm.fmuladd.f32(float %21, float %19, float %20)
ret float %22
}