#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 pow(double, int);
double q6(double indice) {
  double A = 0.0003869, B = 0.1815, C = 0.01081;
  if (indice <= -5)
    return 1;
  if (indice > 15)
    return 9;
  indice = (1 / ((A * pow((indice + B), 2)) + C));
  return indice;
}


x86 assembly (clang, -O0):
<q6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xef3(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xede(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeb4(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1169 <q6+0x59>
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11e0 <q6+0xd0>
movsd  -0x10(%rbp),%xmm0
movsd  0xeaa(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1192 <q6+0x82>
movsd  0xea8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11e0 <q6+0xd0>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe5b(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q6>:
push   %rax
movsd  0xeef(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1133 <q6+0x23>
ucomisd 0xef1(%rip),%xmm0
jbe    113d <q6+0x2d>
movsd  0xedf(%rip),%xmm0
pop    %rax
ret
movsd  0xec5(%rip),%xmm0
pop    %rax
ret
addsd  0xedb(%rip),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movapd %xmm0,%xmm1
mulsd  0xecd(%rip),%xmm1
addsd  0xecd(%rip),%xmm1
movsd  0xe95(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @q6(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double 3.869000e-04, double* %4
store double 1.815000e-01, double* %5
store double 1.081000e-02, double* %6
%7 = load double, double* %3
%8 = fcmp ole double %7, -5.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %1
store double 1.000000e+00, double* %2
br label %24
10: ; preds = %1
%11 = load double, double* %3
%12 = fcmp ogt double %11, 1.500000e+01
br i1 %12, label %13, label %14
13: ; preds = %10
store double 9.000000e+00, double* %2
br label %24
14: ; preds = %10
%15 = load double, double* %4
%16 = load double, double* %3
%17 = load double, double* %5
%18 = fadd double %16, %17
%19 = call double @pow(double %18, i32 2)
%20 = load double, double* %6
%21 = call double @llvm.fmuladd.f64(double %15, double %19, double %20)
%22 = fdiv double 1.000000e+00, %21
store double %22, double* %3
%23 = load double, double* %3
store double %23, double* %2
br label %24
24: ; preds = %14, %13, %9
%25 = load double, double* %2
ret double %25
}

LLVM IR (-O2):
define double @q6(double %0) {
%2 = fcmp ugt double %0, -5.000000e+00
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = fcmp ogt double %0, 1.500000e+01
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = fadd double %0, 1.815000e-01
%7 = tail call double @pow(double %6, i32 2)
%8 = tail call double @llvm.fmuladd.f64(double %7, double 3.869000e-04, double 1.081000e-02)
%9 = fdiv double 1.000000e+00, %8
br label %10
10: ; preds = %3, %1, %5
%11 = phi double [ %9, %5 ], [ 1.000000e+00, %1 ], [ 9.000000e+00, %3 ]
ret double %11
}