#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 */
float clamp(float, double, double);
float smootherstep(float edge0, float edge1, float x) {
  x = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
  return x * x * x * (x * (x * 6.0 - 15.0) + 10.0);
}


x86 assembly (clang, -O0):
<smootherstep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
movsd  0xece(%rip),%xmm2
call   1030 <clamp@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  0xe87(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe83(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe63(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smootherstep>:
push   %rax
movaps %xmm2,%xmm3
subss  %xmm0,%xmm3
subss  %xmm0,%xmm1
divss  %xmm1,%xmm3
movsd  0xed8(%rip),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm3,%xmm0
call   1030 <clamp@plt>
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
movsd  0xebf(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  0xebb(%rip),%xmm3
mulss  %xmm0,%xmm1
mulsd  %xmm2,%xmm3
addsd  0xeb3(%rip),%xmm3
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  %xmm0,%xmm3
xorps  %xmm0,%xmm0
cvtsd2ss %xmm3,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @smootherstep(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = load float, float* %5
%11 = load float, float* %4
%12 = fsub float %10, %11
%13 = fdiv float %9, %12
%14 = call float @clamp(float %13, double 0.000000e+00, double 1.000000e+00)
store float %14, float* %6
%15 = load float, float* %6
%16 = load float, float* %6
%17 = fmul float %15, %16
%18 = load float, float* %6
%19 = fmul float %17, %18
%20 = fpext float %19 to double
%21 = load float, float* %6
%22 = fpext float %21 to double
%23 = load float, float* %6
%24 = fpext float %23 to double
%25 = call double @llvm.fmuladd.f64(double %24, double 6.000000e+00, double -1.500000e+01)
%26 = call double @llvm.fmuladd.f64(double %22, double %25, double 1.000000e+01)
%27 = fmul double %20, %26
%28 = fptrunc double %27 to float
ret float %28
}

LLVM IR (-O2):
define float @smootherstep(float %0, float %1, float %2) {
%4 = fsub float %2, %0
%5 = fsub float %1, %0
%6 = fdiv float %4, %5
%7 = tail call float @clamp(float %6, double 0.000000e+00, double 1.000000e+00)
%8 = fmul float %7, %7
%9 = fmul float %7, %8
%10 = fpext float %9 to double
%11 = fpext float %7 to double
%12 = tail call double @llvm.fmuladd.f64(double %11, double 6.000000e+00, double -1.500000e+01)
%13 = tail call double @llvm.fmuladd.f64(double %11, double %12, double 1.000000e+01)
%14 = fmul double %13, %10
%15 = fptrunc double %14 to float
ret float %15
}