#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 e_cf(double cf) {
  if (cf > 100000)
    return 3.0;
  else {
    double a, b, c, lg;
    lg = log10(cf);
    a = -36.45 * lg;
    b = 3.138 * pow(lg, 2);
    c = 0.06776 * pow(lg, 3);
    return 98.03 + a + b + c;
  }
}


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

x86 assembly (clang, -O2):
<e_cf>:
sub    $0x18,%rsp
ucomisd 0xedc(%rip),%xmm0
jbe    113b <e_cf+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 @e_cf(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* %7
%14 = load double, double* %7
%15 = fmul double -3.645000e+01, %14
store double %15, double* %4
%16 = load double, double* %7
%17 = call double @pow(double %16, i32 2)
%18 = fmul double 3.138000e+00, %17
store double %18, double* %5
%19 = load double, double* %7
%20 = call double @pow(double %19, i32 3)
%21 = fmul double 6.776000e-02, %20
store double %21, double* %6
%22 = load double, double* %4
%23 = fadd double 9.803000e+01, %22
%24 = load double, double* %5
%25 = fadd double %23, %24
%26 = load double, double* %6
%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 @e_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 = 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
}