#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 G(double T) {
  if (T >= -1.0) {
    if (T <= 0.0)
      return 255 * (-0.402 * T * T * T - 0.211 * T * T + 1.09 * T + 0.958);
    if (T <= 1.0)
      return 255 * (-0.542 * T * T * T + 1.37 * T * T - 1.28 * T + 0.941);
  }
  return 0;
}


x86 assembly (clang, -O0):
<G>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1231 <G+0x131>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11af <G+0xaf>
movsd  0xf1a(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xefb(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xebd(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xea5(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe71(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    1238 <G+0x138>
movsd  0xe51(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     122c <G+0x12c>
movsd  0xe66(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xe47(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe20(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe08(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xdf4(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    1238 <G+0x138>
jmp    1231 <G+0x131>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<G>:
xor    %eax,%eax
ucomisd 0xef6(%rip),%xmm0
jb     11b2 <G+0xb2>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    116a <G+0x6a>
movsd  0xf0e(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     11b2 <G+0xb2>
movsd  0xf04(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xefc(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm1
mulsd  0xef0(%rip),%xmm0
addsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
addsd  0xee8(%rip),%xmm0
jmp    11a6 <G+0xa6>
movsd  0xe96(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe8e(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm1
mulsd  0xe82(%rip),%xmm0
addsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
addsd  0xe7a(%rip),%xmm0
mulsd  0xe7a(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @G(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 %46
6: ; preds = %1
%7 = load double, double* %3
%8 = fcmp ole double %7, 0.000000e+00
br i1 %8, label %9, label %26
9: ; preds = %6
%10 = load double, double* %3
%11 = fmul double -4.020000e-01, %10
%12 = load double, double* %3
%13 = fmul double %11, %12
%14 = load double, double* %3
%15 = load double, double* %3
%16 = fmul double 2.110000e-01, %15
%17 = load double, double* %3
%18 = fmul double %16, %17
%19 = fneg double %18
%20 = call double @llvm.fmuladd.f64(double %13, double %14, double %19)
%21 = load double, double* %3
%22 = call double @llvm.fmuladd.f64(double 1.090000e+00, double %21, double %20)
%23 = fadd double %22, 0x3FEEA7EF9DB22D0E
%24 = fmul double 2.550000e+02, %23
%25 = fptosi double %24 to i32
store i32 %25, i32* %2
br label %47
26: ; preds = %6
%27 = load double, double* %3
%28 = fcmp ole double %27, 1.000000e+00
br i1 %28, label %29, label %45
29: ; preds = %26
%30 = load double, double* %3
%31 = fmul double -5.420000e-01, %30
%32 = load double, double* %3
%33 = fmul double %31, %32
%34 = load double, double* %3
%35 = load double, double* %3
%36 = fmul double 1.370000e+00, %35
%37 = load double, double* %3
%38 = fmul double %36, %37
%39 = call double @llvm.fmuladd.f64(double %33, double %34, double %38)
%40 = load double, double* %3
%41 = call double @llvm.fmuladd.f64(double -1.280000e+00, double %40, double %39)
%42 = fadd double %41, 9.410000e-01
%43 = fmul double 2.550000e+02, %42
%44 = fptosi double %43 to i32
store i32 %44, i32* %2
br label %47
45: ; preds = %26
br label %46
46: ; preds = %45, %1
store i32 0, i32* %2
br label %47
47: ; preds = %46, %29, %9
%48 = load i32, i32* %2
ret i32 %48
}

LLVM IR (-O2):
define i32 @G(double %0) {
%2 = fcmp ult double %0, -1.000000e+00
br i1 %2, label %27, label %3
3: ; preds = %1
%4 = fcmp ugt double %0, 0.000000e+00
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = fmul double %0, -4.020000e-01
%7 = fmul double %6, %0
%8 = fmul double %0, -2.110000e-01
%9 = fmul double %8, %0
%10 = tail call double @llvm.fmuladd.f64(double %7, double %0, double %9)
%11 = tail call double @llvm.fmuladd.f64(double %0, double 1.090000e+00, double %10)
%12 = fadd double %11, 0x3FEEA7EF9DB22D0E
%13 = fmul double %12, 2.550000e+02
%14 = fptosi double %13 to i32
br label %27
15: ; preds = %3
%16 = fcmp ugt double %0, 1.000000e+00
br i1 %16, label %27, label %17
17: ; preds = %15
%18 = fmul double %0, -5.420000e-01
%19 = fmul double %18, %0
%20 = fmul double %0, 1.370000e+00
%21 = fmul double %20, %0
%22 = tail call double @llvm.fmuladd.f64(double %19, double %0, double %21)
%23 = tail call double @llvm.fmuladd.f64(double %0, double -1.280000e+00, double %22)
%24 = fadd double %23, 9.410000e-01
%25 = fmul double %24, 2.550000e+02
%26 = fptosi double %25 to i32
br label %27
27: ; preds = %1, %15, %17, %5
%28 = phi i32 [ %14, %5 ], [ %26, %17 ], [ 0, %15 ], [ 0, %1 ]
ret i32 %28
}