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


x86 assembly (clang, -O0):
<ST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1150 <ST+0x30>
movl   $0x20,-0x4(%rbp)
jmp    11b7 <ST+0x97>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  0xeac(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe98(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  0xe7b(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe66(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ST>:
push   %rax
mov    $0x20,%eax
ucomisd 0xed2(%rip),%xmm0
ja     1189 <ST+0x69>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm0,(%rsp)
jb     1145 <ST+0x25>
sqrtsd %xmm0,%xmm0
jmp    114a <ST+0x2a>
call   1040 <sqrt@plt>
mulsd  0xeb6(%rip),%xmm0
movsd  0xeb6(%rip),%xmm1
mulsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
movsd  (%rsp),%xmm1
mulsd  0xe9f(%rip),%xmm1
mulsd  0xe9f(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ST(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp ogt double %5, 5.000000e+02
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 32, i32* %2
br label %20
8: ; preds = %1
%9 = load double, double* %3
%10 = load double, double* %3
%11 = call double @sqrt(double %10)
%12 = fmul double 3.009000e-02, %11
%13 = call double @llvm.fmuladd.f64(double -1.070000e-03, double %9, double %12)
%14 = call double @exp(double %13)
%15 = load double, double* %3
%16 = fmul double -1.185000e-01, %15
%17 = call double @llvm.fmuladd.f64(double 8.026000e+01, double %14, double %16)
store double %17, double* %4
%18 = load double, double* %4
%19 = fptosi double %18 to i32
store i32 %19, i32* %2
br label %20
20: ; preds = %8, %7
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @ST(double %0) {
%2 = fcmp ogt double %0, 5.000000e+02
br i1 %2, label %11, 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)
%10 = fptosi double %9 to i32
br label %11
11: ; preds = %1, %3
%12 = phi i32 [ %10, %3 ], [ 32, %1 ]
ret i32 %12
}