#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 exp(double);
double sqrt(double);
double q8(double indice) {
  double A = 80.26, B = -0.00107, C = 0.03009, D = -0.1185;
  if (indice > 500)
    return 30.0;
  indice = (A * exp((B * indice) + (C * sqrt(indice)))) + (D * indice);
  return indice;
}


x86 assembly (clang, -O0):
<q8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeeb(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe92(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    118a <q8+0x6a>
movsd  0xea8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1208 <q8+0xe8>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q8>:
push   %rax
ucomisd 0xed7(%rip),%xmm0
jbe    1135 <q8+0x15>
movsd  0xef5(%rip),%xmm0
pop    %rax
ret
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm0,(%rsp)
jb     114a <q8+0x2a>
sqrtsd %xmm0,%xmm0
jmp    114f <q8+0x2f>
call   1040 <sqrt@plt>
mulsd  0xeb1(%rip),%xmm0
movsd  0xeb1(%rip),%xmm1
mulsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
movsd  (%rsp),%xmm1
mulsd  0xe9a(%rip),%xmm1
mulsd  0xe9a(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @q8(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
store double 8.026000e+01, double* %4
store double -1.070000e-03, double* %5
store double 3.009000e-02, double* %6
store double -1.185000e-01, double* %7
%8 = load double, double* %3
%9 = fcmp ogt double %8, 5.000000e+02
br i1 %9, label %10, label %11
10: ; preds = %1
store double 3.000000e+01, double* %2
br label %26
11: ; preds = %1
%12 = load double, double* %4
%13 = load double, double* %5
%14 = load double, double* %3
%15 = load double, double* %6
%16 = load double, double* %3
%17 = call double @sqrt(double %16)
%18 = fmul double %15, %17
%19 = call double @llvm.fmuladd.f64(double %13, double %14, double %18)
%20 = call double @exp(double %19)
%21 = load double, double* %7
%22 = load double, double* %3
%23 = fmul double %21, %22
%24 = call double @llvm.fmuladd.f64(double %12, double %20, double %23)
store double %24, double* %3
%25 = load double, double* %3
store double %25, double* %2
br label %26
26: ; preds = %11, %10
%27 = load double, double* %2
ret double %27
}

LLVM IR (-O2):
define double @q8(double %0) {
%2 = fcmp ogt double %0, 5.000000e+02
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call double @sqrt(double %0)
%5 = fmul double %4, 3.009000e-02
%6 = tail call double @llvm.fmuladd.f64(double %0, double -1.070000e-03, double %5)
%7 = tail call double @exp(double %6)
%8 = fmul double %0, -1.185000e-01
%9 = tail call double @llvm.fmuladd.f64(double %7, double 8.026000e+01, double %8)
br label %10
10: ; preds = %1, %3
%11 = phi double [ %9, %3 ], [ 3.000000e+01, %1 ]
ret double %11
}