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


x86 assembly (clang, -O0):
<backEaseInOutf>:
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    11cb <backEaseInOutf+0xbb>
movss  0xed0(%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
mov    0x2e6f(%rip),%rax
mulss  (%rax),%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  0xe47(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    127d <backEaseInOutf+0x16d>
movss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm1
movss  0xe30(%rip),%xmm0
addss  %xmm0,%xmm1
movss  0xe20(%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
mov    0x2dc8(%rip),%rax
mulss  (%rax),%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  0xdac(%rip),%xmm0
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd94(%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):
<backEaseInOutf>:
push   %rax
movaps %xmm0,%xmm1
movss  0xee4(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1173 <backEaseInOutf+0x63>
addss  %xmm1,%xmm1
movss  %xmm1,(%rsp)
movaps %xmm1,%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,0x4(%rsp)
mov    0x2eaa(%rip),%rax
movss  (%rax),%xmm0
mulss  %xmm1,%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  0xe9f(%rip),%xmm0
jmp    11e8 <backEaseInOutf+0xd8>
addss  %xmm1,%xmm1
addss  0xe85(%rip),%xmm1
movss  0xe81(%rip),%xmm2
subss  %xmm1,%xmm2
movss  %xmm2,(%rsp)
movaps %xmm2,%xmm0
mulss  %xmm2,%xmm0
movss  %xmm0,0x4(%rsp)
mov    0x2e44(%rip),%rax
movss  (%rax),%xmm0
mulss  %xmm2,%xmm0
call   1030 <sin@plt>
movss  (%rsp),%xmm2
mulss  %xmm2,%xmm0
movss  0x4(%rsp),%xmm1
mulss  %xmm2,%xmm1
subss  %xmm0,%xmm1
movss  0xe38(%rip),%xmm0
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe30(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @backEaseInOutf(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 %27
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 = load float, float* @M_PI
%19 = fmul float %17, %18
%20 = call float @sin(float %19)
%21 = fmul float %16, %20
%22 = fneg float %21
%23 = call float @llvm.fmuladd.f32(float %14, float %15, float %22)
%24 = fpext float %23 to double
%25 = fmul double 5.000000e-01, %24
%26 = fptrunc double %25 to float
store float %26, float* %2
br label %47
27: ; preds = %1
%28 = load float, float* %3
%29 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %28, float -1.000000e+00)
%30 = fsub float 1.000000e+00, %29
store float %30, float* %5
%31 = load float, float* %5
%32 = load float, float* %5
%33 = fmul float %31, %32
%34 = load float, float* %5
%35 = load float, float* %5
%36 = load float, float* %5
%37 = load float, float* @M_PI
%38 = fmul float %36, %37
%39 = call float @sin(float %38)
%40 = fmul float %35, %39
%41 = fneg float %40
%42 = call float @llvm.fmuladd.f32(float %33, float %34, float %41)
%43 = fsub float 1.000000e+00, %42
%44 = fpext float %43 to double
%45 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %44, double 5.000000e-01)
%46 = fptrunc double %45 to float
store float %46, float* %2
br label %47
47: ; preds = %27, %9
%48 = load float, float* %2
ret float %48
}

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