#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 sin(float);
float BackEaseInOut(float p) {
  if (p < 0.5) {
    float f = 2 * p;
    return 0.5 * (f * f * f - f * sin(f * 3.14159265358979323846));
  } else {
    float f = (1 - (2 * p - 1));
    return 0.5 * (1 - (f * f * f - f * sin(f * 3.14159265358979323846))) + 0.5;
  }
}


x86 assembly (clang, -O0):
<BackEaseInOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11d4 <BackEaseInOut+0xc4>
movss  0xed8(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8a(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sin@plt>
movss  -0x1c(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0x14(%rbp),%xmm0
mulss  %xmm3,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe3e(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    128f <BackEaseInOut+0x17f>
movss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm1
movss  0xe2f(%rip),%xmm0
addss  %xmm0,%xmm1
movss  0xe1f(%rip),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdda(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sin@plt>
movss  -0x28(%rbp),%xmm1
movss  -0x24(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0x20(%rbp),%xmm0
mulss  %xmm3,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  0xda2(%rip),%xmm0
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd82(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BackEaseInOut>:
push   %rax
movss  0xee7(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1171 <BackEaseInOut+0x61>
addss  %xmm0,%xmm0
movss  %xmm0,(%rsp)
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
cvtss2sd %xmm0,%xmm0
mulsd  0xed0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sin@plt>
movss  (%rsp),%xmm2
mulss  %xmm2,%xmm0
movss  0x4(%rsp),%xmm1
mulss  %xmm2,%xmm1
subss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  0xea9(%rip),%xmm0
jmp    11ea <BackEaseInOut+0xda>
addss  %xmm0,%xmm0
addss  0xe87(%rip),%xmm0
movss  0xe83(%rip),%xmm2
subss  %xmm0,%xmm2
movss  %xmm2,(%rsp)
movaps %xmm2,%xmm0
mulss  %xmm2,%xmm0
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
mulsd  0xe66(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sin@plt>
movss  (%rsp),%xmm2
mulss  %xmm2,%xmm0
movss  0x4(%rsp),%xmm1
mulss  %xmm2,%xmm1
subss  %xmm0,%xmm1
movss  0xe36(%rip),%xmm0
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe36(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @BackEaseInOut(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = fcmp olt double %7, 5.000000e-01
br i1 %8, label %9, label %28
9: ; preds = %1
%10 = load float, float* %3
%11 = fmul float 2.000000e+00, %10
store float %11, float* %4
%12 = load float, float* %4
%13 = load float, float* %4
%14 = fmul float %12, %13
%15 = load float, float* %4
%16 = load float, float* %4
%17 = load float, float* %4
%18 = fpext float %17 to double
%19 = fmul double %18, 0x400921FB54442D18
%20 = fptrunc double %19 to float
%21 = call float @sin(float %20)
%22 = fmul float %16, %21
%23 = fneg float %22
%24 = call float @llvm.fmuladd.f32(float %14, float %15, float %23)
%25 = fpext float %24 to double
%26 = fmul double 5.000000e-01, %25
%27 = fptrunc double %26 to float
store float %27, float* %2
br label %49
28: ; preds = %1
%29 = load float, float* %3
%30 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %29, float -1.000000e+00)
%31 = fsub float 1.000000e+00, %30
store float %31, float* %5
%32 = load float, float* %5
%33 = load float, float* %5
%34 = fmul float %32, %33
%35 = load float, float* %5
%36 = load float, float* %5
%37 = load float, float* %5
%38 = fpext float %37 to double
%39 = fmul double %38, 0x400921FB54442D18
%40 = fptrunc double %39 to float
%41 = call float @sin(float %40)
%42 = fmul float %36, %41
%43 = fneg float %42
%44 = call float @llvm.fmuladd.f32(float %34, float %35, float %43)
%45 = fsub float 1.000000e+00, %44
%46 = fpext float %45 to double
%47 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %46, double 5.000000e-01)
%48 = fptrunc double %47 to float
store float %48, float* %2
br label %49
49: ; preds = %28, %9
%50 = load float, float* %2
ret float %50
}

LLVM IR (-O2):
define float @BackEaseInOut(float %0) {
%2 = fcmp olt float %0, 5.000000e-01
br i1 %2, label %3, label %15
3: ; preds = %1
%4 = fmul float %0, 2.000000e+00
%5 = fmul float %4, %4
%6 = fpext float %4 to double
%7 = fmul double %6, 0x400921FB54442D18
%8 = fptrunc double %7 to float
%9 = tail call float @sin(float %8)
%10 = fneg float %4
%11 = fmul float %9, %10
%12 = tail call float @llvm.fmuladd.f32(float %5, float %4, float %11)
%13 = fpext float %12 to double
%14 = fmul double %13, 5.000000e-01
br label %29
15: ; preds = %1
%16 = tail call float @llvm.fmuladd.f32(float %0, float 2.000000e+00, float -1.000000e+00)
%17 = fsub float 1.000000e+00, %16
%18 = fmul float %17, %17
%19 = fpext float %17 to double
%20 = fmul double %19, 0x400921FB54442D18
%21 = fptrunc double %20 to float
%22 = tail call float @sin(float %21)
%23 = fneg float %17
%24 = fmul float %22, %23
%25 = tail call float @llvm.fmuladd.f32(float %18, float %17, float %24)
%26 = fsub float 1.000000e+00, %25
%27 = fpext float %26 to double
%28 = tail call double @llvm.fmuladd.f64(double %27, double 5.000000e-01, double 5.000000e-01)
br label %29
29: ; preds = %15, %3
%30 = phi double [ %14, %3 ], [ %28, %15 ]
%31 = fptrunc double %30 to float
ret float %31
}