#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 */
typedef int uint8_t;

/* Variables and functions */
uint8_t B(double T) {
  if (T >= -1.0) {
    if (T <= -0.7)
      return 255 * (0);
    if (T <= 0.0)
      return 255 * (0.0117 * T * T * T + 2.05 * T * T + 2.85 * T + 1.00);
    if (T <= 1.0)
      return 255 * (1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<B>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11db <B+0xdb>
movsd  0xee0(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     113f <B+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    11e2 <B+0xe2>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11b7 <B+0xb7>
movsd  0xedb(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xebc(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe95(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe75(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe71(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    11e2 <B+0xe2>
movsd  0xe51(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11d6 <B+0xd6>
movl   $0xff,-0x4(%rbp)
jmp    11e2 <B+0xe2>
jmp    11db <B+0xdb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<B>:
ucomisd 0xef8(%rip),%xmm0
jae    110e <B+0xe>
xor    %eax,%eax
jmp    113b <B+0x3b>
xor    %eax,%eax
movsd  0xef0(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    113b <B+0x3b>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    113c <B+0x3c>
mov    $0xff,%eax
movsd  0xef3(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     110a <B+0xa>
ret
movsd  0xecc(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xec4(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm1
mulsd  0xeb8(%rip),%xmm0
addsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
addsd  0xeb0(%rip),%xmm0
mulsd  0xeb0(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @B(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, -1.000000e+00
br i1 %5, label %6, label %34
6: ; preds = %1
%7 = load double, double* %3
%8 = fcmp ole double %7, 0xBFE6666666666666
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 0, i32* %2
br label %35
10: ; preds = %6
%11 = load double, double* %3
%12 = fcmp ole double %11, 0.000000e+00
br i1 %12, label %13, label %29
13: ; preds = %10
%14 = load double, double* %3
%15 = fmul double 1.170000e-02, %14
%16 = load double, double* %3
%17 = fmul double %15, %16
%18 = load double, double* %3
%19 = load double, double* %3
%20 = fmul double 2.050000e+00, %19
%21 = load double, double* %3
%22 = fmul double %20, %21
%23 = call double @llvm.fmuladd.f64(double %17, double %18, double %22)
%24 = load double, double* %3
%25 = call double @llvm.fmuladd.f64(double 2.850000e+00, double %24, double %23)
%26 = fadd double %25, 1.000000e+00
%27 = fmul double 2.550000e+02, %26
%28 = fptosi double %27 to i32
store i32 %28, i32* %2
br label %35
29: ; preds = %10
%30 = load double, double* %3
%31 = fcmp ole double %30, 1.000000e+00
br i1 %31, label %32, label %33
32: ; preds = %29
store i32 255, i32* %2
br label %35
33: ; preds = %29
br label %34
34: ; preds = %33, %1
store i32 0, i32* %2
br label %35
35: ; preds = %34, %32, %13, %9
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
define i32 @B(double %0) {
%2 = fcmp ult double %0, -1.000000e+00
br i1 %2, label %19, label %3
3: ; preds = %1
%4 = fcmp ugt double %0, 0xBFE6666666666666
br i1 %4, label %5, label %20
5: ; preds = %3
%6 = fcmp ugt double %0, 0.000000e+00
br i1 %6, label %17, label %7
7: ; preds = %5
%8 = fmul double %0, 1.170000e-02
%9 = fmul double %8, %0
%10 = fmul double %0, 2.050000e+00
%11 = fmul double %10, %0
%12 = tail call double @llvm.fmuladd.f64(double %9, double %0, double %11)
%13 = tail call double @llvm.fmuladd.f64(double %0, double 2.850000e+00, double %12)
%14 = fadd double %13, 1.000000e+00
%15 = fmul double %14, 2.550000e+02
%16 = fptosi double %15 to i32
br label %20
17: ; preds = %5
%18 = fcmp ugt double %0, 1.000000e+00
br i1 %18, label %19, label %20
19: ; preds = %17, %1
br label %20
20: ; preds = %17, %3, %19, %7
%21 = phi i32 [ %16, %7 ], [ 0, %19 ], [ 0, %3 ], [ 255, %17 ]
ret i32 %21
}