#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 q1(double indice) {
  if (indice <= 100000) {
    return 98.24024 - (34.7145 * (log10(indice))) +
           (2.614267 * pow(log10(indice), 2)) +
           (0.107821 * pow(log10(indice), 3));
  } else {
    return 3.0;
  }
}


x86 assembly (clang, -O0):
<q1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xecb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11c8 <q1+0xa8>
movsd  -0x10(%rbp),%xmm0
call   1040 <log10@plt>
movsd  0xece(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeca(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log10@plt>
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  -0x20(%rbp),%xmm1
movsd  0xe90(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log10@plt>
mov    $0x3,%edi
call   1030 <pow@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xe5a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11d5 <q1+0xb5>
movsd  0xe38(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q1>:
sub    $0x18,%rsp
movsd  0xed4(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    113f <q1+0x1f>
movsd  0xeee(%rip),%xmm0
add    $0x18,%rsp
ret
movsd  %xmm0,0x10(%rsp)
call   1040 <log10@plt>
mulsd  0xeb6(%rip),%xmm0
addsd  0xeb6(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <log10@plt>
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0xe9b(%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  0xe7a(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @q1(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ole double %4, 1.000000e+05
br i1 %5, label %6, label %18
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @log10(double %7)
%9 = call double @llvm.fmuladd.f64(double -3.471450e+01, double %8, double 0x40588F601797CC3A)
%10 = load double, double* %3
%11 = call double @log10(double %10)
%12 = call double @pow(double %11, i32 2)
%13 = call double @llvm.fmuladd.f64(double 0x4004EA04D12018A4, double %12, double %9)
%14 = load double, double* %3
%15 = call double @log10(double %14)
%16 = call double @pow(double %15, i32 3)
%17 = call double @llvm.fmuladd.f64(double 1.078210e-01, double %16, double %13)
store double %17, double* %2
br label %19
18: ; preds = %1
store double 3.000000e+00, double* %2
br label %19
19: ; preds = %18, %6
%20 = load double, double* %2
ret double %20
}

LLVM IR (-O2):
define double @q1(double %0) {
%2 = fcmp ugt 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.471450e+01, double 0x40588F601797CC3A)
%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 0x4004EA04D12018A4, 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 1.078210e-01, double %8)
br label %12
12: ; preds = %1, %3
%13 = phi double [ %11, %3 ], [ 3.000000e+00, %1 ]
ret double %13
}