#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);
CF(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):
<CF>:
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    1184 <CF+0x64>
movl   $0x3,-0x4(%rbp)
jmp    1234 <CF+0x114>
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)
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CF>:
sub    $0x18,%rsp
mov    $0x3,%eax
ucomisd 0xecf(%rip),%xmm0
ja     11a4 <CF+0x84>
movsd  %xmm0,0x10(%rsp)
call   1040 <log10@plt>
mulsd  0xec2(%rip),%xmm0
addsd  0xec2(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <log10@plt>
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0xea7(%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  0xe86(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @CF(double %0) {
%2 = alloca i32
%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 i32 3, i32* %2
br label %30
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
%29 = fptosi double %28 to i32
store i32 %29, i32* %2
br label %30
30: ; preds = %12, %11
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @CF(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 = 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)
%12 = fptosi double %11 to i32
br label %13
13: ; preds = %1, %3
%14 = phi i32 [ %12, %3 ], [ 3, %1 ]
ret i32 %14
}