#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 */
int /*<<< orphan*/ max(float, float);
float min(float, int /*<<< orphan*/);
int pow(float, float);
float DoubleCubicSeatWithLinearBlend(float x, float a, float b) {
  float epsilon = 0.00001f;
  float min_param_a = 0.f + epsilon;
  float max_param_a = 1.f - epsilon;
  float min_param_b = 0.f;
  float max_param_b = 1.f;
  a = min(max_param_a, max(min_param_a, a));
  b = min(max_param_b, max(min_param_b, b));
  b = 1.f - b;
  float y = 0.f;
  if (x <= a) {
    y = b * x + (1 - b) * a * (1 - pow(1 - x / a, 3.f));
  } else {
    y = b * x + (1 - b) * (a + (1 - a) * pow((x - a) / (1 - a), 3.f));
  }
  return y;
}


x86 assembly (clang, -O0):
<DoubleCubicSeatWithLinearBlend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  0xeb5(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe97(%rip),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xe7d(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <max@plt>
movss  -0x2c(%rbp),%xmm0
mov    %eax,%edi
call   1030 <min@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1040 <max@plt>
movss  -0x28(%rbp),%xmm0
mov    %eax,%edi
call   1030 <min@plt>
movss  %xmm0,-0xc(%rbp)
movss  0xe1c(%rip),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1289 <DoubleCubicSeatWithLinearBlend+0x159>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  0xddb(%rip),%xmm0
subss  -0xc(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x4(%rbp),%xmm1
divss  -0x8(%rbp),%xmm1
movss  0xdba(%rip),%xmm0
subss  %xmm1,%xmm0
movss  0xdb6(%rip),%xmm1
call   1050 <pow@plt>
movss  -0x38(%rbp),%xmm1
movss  -0x34(%rbp),%xmm0
movss  -0x30(%rbp),%xmm2
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    1329 <DoubleCubicSeatWithLinearBlend+0x1f9>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  0xd5b(%rip),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x48(%rbp)
movss  0xd3f(%rip),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  0xd23(%rip),%xmm1
subss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  0xd1a(%rip),%xmm1
call   1050 <pow@plt>
movss  -0x4c(%rbp),%xmm3
movss  -0x48(%rbp),%xmm4
movss  -0x44(%rbp),%xmm1
movss  -0x40(%rbp),%xmm0
movss  -0x3c(%rbp),%xmm2
cvtsi2ss %eax,%xmm5
mulss  %xmm5,%xmm3
addss  %xmm4,%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoubleCubicSeatWithLinearBlend>:
sub    $0x18,%rsp
movss  %xmm2,0xc(%rsp)
movss  %xmm0,0x4(%rsp)
movss  0xeb8(%rip),%xmm0
call   1040 <max@plt>
movss  0xeaf(%rip),%xmm0
mov    %eax,%edi
call   1030 <min@plt>
movss  %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
call   1040 <max@plt>
movss  0xe90(%rip),%xmm0
mov    %eax,%edi
call   1030 <min@plt>
movss  0xe81(%rip),%xmm3
movss  0x10(%rsp),%xmm2
movaps %xmm3,%xmm1
subss  %xmm0,%xmm1
ucomiss 0x4(%rsp),%xmm2
movaps %xmm3,%xmm0
movss  %xmm1,0xc(%rsp)
subss  %xmm1,%xmm0
jae    11f2 <DoubleCubicSeatWithLinearBlend+0xc2>
subss  %xmm2,%xmm3
movss  %xmm3,0x14(%rsp)
movss  %xmm0,0x8(%rsp)
movss  0x4(%rsp),%xmm0
subss  %xmm2,%xmm0
divss  %xmm3,%xmm0
movss  0xe3e(%rip),%xmm1
call   1050 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x14(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
mulss  %xmm0,%xmm1
jmp    122e <DoubleCubicSeatWithLinearBlend+0xfe>
mulss  %xmm2,%xmm0
movss  %xmm0,0x8(%rsp)
movss  0x4(%rsp),%xmm0
divss  %xmm2,%xmm0
subss  %xmm0,%xmm3
movss  0xdfa(%rip),%xmm1
movaps %xmm3,%xmm0
call   1050 <pow@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
mulss  0x8(%rsp),%xmm1
movss  0xc(%rsp),%xmm0
mulss  0x4(%rsp),%xmm0
addss  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @DoubleCubicSeatWithLinearBlend(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
store float 0x3EE4F8B580000000, float* %7
%13 = load float, float* %7
%14 = fadd float 0.000000e+00, %13
store float %14, float* %8
%15 = load float, float* %7
%16 = fsub float 1.000000e+00, %15
store float %16, float* %9
store float 0.000000e+00, float* %10
store float 1.000000e+00, float* %11
%17 = load float, float* %9
%18 = load float, float* %8
%19 = load float, float* %5
%20 = call i32 @max(float %18, float %19)
%21 = call float @min(float %17, i32 %20)
store float %21, float* %5
%22 = load float, float* %11
%23 = load float, float* %10
%24 = load float, float* %6
%25 = call i32 @max(float %23, float %24)
%26 = call float @min(float %22, i32 %25)
store float %26, float* %6
%27 = load float, float* %6
%28 = fsub float 1.000000e+00, %27
store float %28, float* %6
store float 0.000000e+00, float* %12
%29 = load float, float* %4
%30 = load float, float* %5
%31 = fcmp ole float %29, %30
br i1 %31, label %32, label %48
32: ; preds = %3
%33 = load float, float* %6
%34 = load float, float* %4
%35 = load float, float* %6
%36 = fsub float 1.000000e+00, %35
%37 = load float, float* %5
%38 = fmul float %36, %37
%39 = load float, float* %4
%40 = load float, float* %5
%41 = fdiv float %39, %40
%42 = fsub float 1.000000e+00, %41
%43 = call i32 @pow(float %42, float 3.000000e+00)
%44 = sub nsw i32 1, %43
%45 = sitofp i32 %44 to float
%46 = fmul float %38, %45
%47 = call float @llvm.fmuladd.f32(float %33, float %34, float %46)
store float %47, float* %12
br label %67
48: ; preds = %3
%49 = load float, float* %6
%50 = load float, float* %4
%51 = load float, float* %6
%52 = fsub float 1.000000e+00, %51
%53 = load float, float* %5
%54 = load float, float* %5
%55 = fsub float 1.000000e+00, %54
%56 = load float, float* %4
%57 = load float, float* %5
%58 = fsub float %56, %57
%59 = load float, float* %5
%60 = fsub float 1.000000e+00, %59
%61 = fdiv float %58, %60
%62 = call i32 @pow(float %61, float 3.000000e+00)
%63 = sitofp i32 %62 to float
%64 = call float @llvm.fmuladd.f32(float %55, float %63, float %53)
%65 = fmul float %52, %64
%66 = call float @llvm.fmuladd.f32(float %49, float %50, float %65)
store float %66, float* %12
br label %67
67: ; preds = %48, %32
%68 = load float, float* %12
ret float %68
}

LLVM IR (-O2):
define float @DoubleCubicSeatWithLinearBlend(float %0, float %1, float %2) {
%4 = tail call i32 @max(float 0x3EE4F8B580000000, float %1)
%5 = tail call float @min(float 0x3FEFFFEB00000000, i32 %4)
%6 = tail call i32 @max(float 0.000000e+00, float %2)
%7 = tail call float @min(float 1.000000e+00, i32 %6)
%8 = fsub float 1.000000e+00, %7
%9 = fcmp ult float %5, %0
%10 = fsub float 1.000000e+00, %8
br i1 %9, label %19, label %11
11: ; preds = %3
%12 = fmul float %5, %10
%13 = fdiv float %0, %5
%14 = fsub float 1.000000e+00, %13
%15 = tail call i32 @pow(float %14, float 3.000000e+00)
%16 = sub nsw i32 1, %15
%17 = sitofp i32 %16 to float
%18 = fmul float %12, %17
br label %27
19: ; preds = %3
%20 = fsub float 1.000000e+00, %5
%21 = fsub float %0, %5
%22 = fdiv float %21, %20
%23 = tail call i32 @pow(float %22, float 3.000000e+00)
%24 = sitofp i32 %23 to float
%25 = tail call float @llvm.fmuladd.f32(float %20, float %24, float %5)
%26 = fmul float %10, %25
br label %27
27: ; preds = %19, %11
%28 = phi float [ %26, %19 ], [ %18, %11 ]
%29 = tail call float @llvm.fmuladd.f32(float %8, float %0, float %28)
ret float %29
}