#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 log(long);
float ntctemp_getB(long adcresistence, int beta, float adctref, int adcrref) {
  float t;
  t = beta /
      (beta / (float)(adctref + 273.15) + log(adcresistence / (float)adcrref));
  t = t - 273.15;
  return t;
}


x86 assembly (clang, -O0):
<ntctemp_getB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeb9(%rip),%xmm2
addsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%rdi
call   1030 <log@plt>
movss  -0x20(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
cvtsi2ss %eax,%xmm2
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe63(%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_getB>:
push   %rax
cvtsi2ss %esi,%xmm2
movss  %xmm2,0x4(%rsp)
cvtss2sd %xmm0,%xmm0
addsd  0xed9(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtsi2ss %rdi,%xmm1
movaps %xmm2,%xmm3
xorps  %xmm2,%xmm2
cvtsi2ss %edx,%xmm2
divss  %xmm0,%xmm3
movss  %xmm3,(%rsp)
divss  %xmm2,%xmm1
cvttss2si %xmm1,%rdi
call   1030 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
addss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addsd  0xe92(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ntctemp_getB(i64 %0, i32 %1, float %2, i32 %3) {
%5 = alloca i64
%6 = alloca i32
%7 = alloca float
%8 = alloca i32
%9 = alloca float
store i64 %0, i64* %5
store i32 %1, i32* %6
store float %2, float* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = sitofp i32 %10 to float
%12 = load i32, i32* %6
%13 = sitofp i32 %12 to float
%14 = load float, float* %7
%15 = fpext float %14 to double
%16 = fadd double %15, 2.731500e+02
%17 = fptrunc double %16 to float
%18 = fdiv float %13, %17
%19 = load i64, i64* %5
%20 = sitofp i64 %19 to float
%21 = load i32, i32* %8
%22 = sitofp i32 %21 to float
%23 = fdiv float %20, %22
%24 = fptosi float %23 to i64
%25 = call i32 @log(i64 %24)
%26 = sitofp i32 %25 to float
%27 = fadd float %18, %26
%28 = fdiv float %11, %27
store float %28, float* %9
%29 = load float, float* %9
%30 = fpext float %29 to double
%31 = fsub double %30, 2.731500e+02
%32 = fptrunc double %31 to float
store float %32, float* %9
%33 = load float, float* %9
ret float %33
}

LLVM IR (-O2):
define float @ntctemp_getB(i64 %0, i32 %1, float %2, i32 %3) {
%5 = sitofp i32 %1 to float
%6 = fpext float %2 to double
%7 = fadd double %6, 2.731500e+02
%8 = fptrunc double %7 to float
%9 = fdiv float %5, %8
%10 = sitofp i64 %0 to float
%11 = sitofp i32 %3 to float
%12 = fdiv float %10, %11
%13 = fptosi float %12 to i64
%14 = tail call i32 @log(i64 %13)
%15 = sitofp i32 %14 to float
%16 = fadd float %9, %15
%17 = fdiv float %5, %16
%18 = fpext float %17 to double
%19 = fadd double %18, -2.731500e+02
%20 = fptrunc double %19 to float
ret float %20
}