#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(long);
float ntctemp_getSH(long adcresistence, float A, float B, float C) {
  float t;
  t = log(adcresistence);
  t = 1 / (A + (B * t) + (C * t * t * t));
  t = t - 273.15;
  return t;
}


x86 assembly (clang, -O0):
<ntctemp_getSH>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <log@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  0xe94(%rip),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe72(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntctemp_getSH>:
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x10(%rsp)
call   1030 <log@plt>
movss  0xc(%rsp),%xmm1
mulss  %xmm0,%xmm1
addss  0x10(%rsp),%xmm1
movaps %xmm1,%xmm2
movss  0x14(%rsp),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
addss  %xmm2,%xmm1
movss  0xea4(%rip),%xmm0
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xe9c(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @ntctemp_getSH(i64 %0, float %1, float %2, float %3) {
%5 = alloca i64
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store i64 %0, i64* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%10 = load i64, i64* %5
%11 = call float @log(i64 %10)
store float %11, float* %9
%12 = load float, float* %6
%13 = load float, float* %7
%14 = load float, float* %9
%15 = call float @llvm.fmuladd.f32(float %13, float %14, float %12)
%16 = load float, float* %8
%17 = load float, float* %9
%18 = fmul float %16, %17
%19 = load float, float* %9
%20 = fmul float %18, %19
%21 = load float, float* %9
%22 = call float @llvm.fmuladd.f32(float %20, float %21, float %15)
%23 = fdiv float 1.000000e+00, %22
store float %23, float* %9
%24 = load float, float* %9
%25 = fpext float %24 to double
%26 = fsub double %25, 2.731500e+02
%27 = fptrunc double %26 to float
store float %27, float* %9
%28 = load float, float* %9
ret float %28
}

LLVM IR (-O2):
define float @ntctemp_getSH(i64 %0, float %1, float %2, float %3) {
%5 = tail call float @log(i64 %0)
%6 = tail call float @llvm.fmuladd.f32(float %2, float %5, float %1)
%7 = fmul float %5, %3
%8 = fmul float %5, %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %5, float %6)
%10 = fdiv float 1.000000e+00, %9
%11 = fpext float %10 to double
%12 = fadd double %11, -2.731500e+02
%13 = fptrunc double %12 to float
ret float %13
}