#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) {
  float tmp = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
  return tmp * tmp * tmp * (tmp * (tmp * 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,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x10(%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
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %6
%9 = load float, float* %4
%10 = fsub float %8, %9
%11 = load float, float* %5
%12 = load float, float* %4
%13 = fsub float %11, %12
%14 = fdiv float %10, %13
%15 = call float @clamp(float %14, double 0.000000e+00, double 1.000000e+00)
store float %15, float* %7
%16 = load float, float* %7
%17 = load float, float* %7
%18 = fmul float %16, %17
%19 = load float, float* %7
%20 = fmul float %18, %19
%21 = fpext float %20 to double
%22 = load float, float* %7
%23 = fpext float %22 to double
%24 = load float, float* %7
%25 = fpext float %24 to double
%26 = call double @llvm.fmuladd.f64(double %25, double 6.000000e+00, double -1.500000e+01)
%27 = call double @llvm.fmuladd.f64(double %23, double %26, double 1.000000e+01)
%28 = fmul double %21, %27
%29 = fptrunc double %28 to float
ret float %29
}

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
}