#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 */
double log10(double);
double pow(double, int);
double qCF(double CF) {
  if (CF > 100000)
    return 3.0;
  double l10 = log10(CF);
  double B = -36.45 * l10;
  double C = 3.138 * pow(l10, 2);
  double D = 0.06776 * pow(l10, 3);
  return 98.03 + B + C + D;
}


x86 assembly (clang, -O0):
<qCF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1156 <qCF+0x36>
movsd  0xedc(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11d9 <qCF+0xb9>
movsd  -0x10(%rbp),%xmm0
call   1040 <log10@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb3(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe87(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe5c(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe43(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qCF>:
sub    $0x18,%rsp
ucomisd 0xedc(%rip),%xmm0
jbe    113b <qCF+0x1b>
movsd  0xeca(%rip),%xmm0
add    $0x18,%rsp
ret
call   1040 <log10@plt>
movsd  %xmm0,(%rsp)
movsd  0xec3(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0xeaf(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
mulsd  0xe9a(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
addsd  0xe94(%rip),%xmm1
addsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @qCF(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
%8 = load double, double* %3
%9 = fcmp ogt double %8, 1.000000e+05
br i1 %9, label %10, label %11
10: ; preds = %1
store double 3.000000e+00, double* %2
br label %28
11: ; preds = %1
%12 = load double, double* %3
%13 = call double @log10(double %12)
store double %13, double* %4
%14 = load double, double* %4
%15 = fmul double -3.645000e+01, %14
store double %15, double* %5
%16 = load double, double* %4
%17 = call double @pow(double %16, i32 2)
%18 = fmul double 3.138000e+00, %17
store double %18, double* %6
%19 = load double, double* %4
%20 = call double @pow(double %19, i32 3)
%21 = fmul double 6.776000e-02, %20
store double %21, double* %7
%22 = load double, double* %5
%23 = fadd double 9.803000e+01, %22
%24 = load double, double* %6
%25 = fadd double %23, %24
%26 = load double, double* %7
%27 = fadd double %25, %26
store double %27, double* %2
br label %28
28: ; preds = %11, %10
%29 = load double, double* %2
ret double %29
}

LLVM IR (-O2):
define double @qCF(double %0) {
%2 = fcmp ogt double %0, 1.000000e+05
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = tail call double @log10(double %0)
%5 = fmul double %4, 3.645000e+01
%6 = tail call double @pow(double %4, i32 2)
%7 = fmul double %6, 3.138000e+00
%8 = tail call double @pow(double %4, i32 3)
%9 = fmul double %8, 6.776000e-02
%10 = fsub double 9.803000e+01, %5
%11 = fadd double %10, %7
%12 = fadd double %11, %9
br label %13
13: ; preds = %1, %3
%14 = phi double [ %12, %3 ], [ 3.000000e+00, %1 ]
ret double %14
}