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


x86 assembly (clang, -O0):
<qST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%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    118a <qST+0x6a>
movsd  0xea8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1208 <qST+0xe8>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qST>:
push   %rax
ucomisd 0xed7(%rip),%xmm0
jbe    1135 <qST+0x15>
movsd  0xef5(%rip),%xmm0
pop    %rax
ret
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm0,(%rsp)
jb     114a <qST+0x2a>
sqrtsd %xmm0,%xmm0
jmp    114f <qST+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 @qST(double %0) {
%2 = alloca double
%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 8.026000e+01, double* %5
store double -1.070000e-03, double* %6
store double 3.009000e-02, double* %7
store double -1.185000e-01, double* %8
%9 = load double, double* %3
%10 = fcmp ogt double %9, 5.000000e+02
br i1 %10, label %11, label %12
11: ; preds = %1
store double 3.200000e+01, double* %2
br label %27
12: ; preds = %1
%13 = load double, double* %5
%14 = load double, double* %6
%15 = load double, double* %3
%16 = load double, double* %7
%17 = load double, double* %3
%18 = call double @sqrt(double %17)
%19 = fmul double %16, %18
%20 = call double @llvm.fmuladd.f64(double %14, double %15, double %19)
%21 = call double @exp(double %20)
%22 = load double, double* %8
%23 = load double, double* %3
%24 = fmul double %22, %23
%25 = call double @llvm.fmuladd.f64(double %13, double %21, double %24)
store double %25, double* %4
%26 = load double, double* %4
store double %26, double* %2
br label %27
27: ; preds = %12, %11
%28 = load double, double* %2
ret double %28
}

LLVM IR (-O2):
define double @qST(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.200000e+01, %1 ]
ret double %11
}