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


x86 assembly (clang, -O0):
<qCF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeeb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe92(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    118a <qCF+0x6a>
movsd  0xea8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    123c <qCF+0x11c>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log10@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log10@plt>
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  -0x58(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log10@plt>
mov    $0x3,%edi
call   1030 <pow@plt>
movsd  -0x48(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qCF>:
sub    $0x18,%rsp
ucomisd 0xed4(%rip),%xmm0
jbe    113b <qCF+0x1b>
movsd  0xef2(%rip),%xmm0
add    $0x18,%rsp
ret
movsd  %xmm0,0x10(%rsp)
call   1040 <log10@plt>
mulsd  0xeba(%rip),%xmm0
addsd  0xeba(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <log10@plt>
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0xe9f(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <log10@plt>
mov    $0x3,%edi
call   1030 <pow@plt>
mulsd  0xe7e(%rip),%xmm0
addsd  0x8(%rsp),%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
%8 = alloca double
store double %0, double* %3
store double 9.803000e+01, double* %5
store double -3.645000e+01, double* %6
store double 3.138000e+00, double* %7
store double 6.776000e-02, double* %8
%9 = load double, double* %3
%10 = fcmp ogt double %9, 1.000000e+05
br i1 %10, label %11, label %12
11: ; preds = %1
store double 3.000000e+00, double* %2
br label %29
12: ; preds = %1
%13 = load double, double* %5
%14 = load double, double* %6
%15 = load double, double* %3
%16 = call double @log10(double %15)
%17 = call double @llvm.fmuladd.f64(double %14, double %16, double %13)
%18 = load double, double* %7
%19 = load double, double* %3
%20 = call double @log10(double %19)
%21 = call double @pow(double %20, i32 2)
%22 = call double @llvm.fmuladd.f64(double %18, double %21, double %17)
%23 = load double, double* %8
%24 = load double, double* %3
%25 = call double @log10(double %24)
%26 = call double @pow(double %25, i32 3)
%27 = call double @llvm.fmuladd.f64(double %23, double %26, double %22)
store double %27, double* %4
%28 = load double, double* %4
store double %28, double* %2
br label %29
29: ; preds = %12, %11
%30 = load double, double* %2
ret double %30
}

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