#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 HalfBackEaseInOut(float p) {
  if (p < 0.5) {
    return p;
  } 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):
<HalfBackEaseInOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1147 <HalfBackEaseInOut+0x37>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11f9 <HalfBackEaseInOut+0xe9>
movss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm1
movss  0xeb4(%rip),%xmm0
addss  %xmm0,%xmm1
movss  0xea4(%rip),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mov    0x2e4c(%rip),%rax
mulss  (%rax),%xmm0
call   1030 <sin@plt>
movss  -0x18(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0x10(%rbp),%xmm0
mulss  %xmm3,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  0xe30(%rip),%xmm0
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe18(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HalfBackEaseInOut>:
push   %rax
movss  0xee7(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     1197 <HalfBackEaseInOut+0x87>
addss  %xmm0,%xmm0
addss  0xeda(%rip),%xmm0
movss  0xed6(%rip),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movaps %xmm1,%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,0x4(%rsp)
mov    0x2e99(%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
movss  0xe8d(%rip),%xmm0
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe85(%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 @HalfBackEaseInOut(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fcmp olt double %6, 5.000000e-01
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load float, float* %3
store float %9, float* %2
br label %30
10: ; preds = %1
%11 = load float, float* %3
%12 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %11, float -1.000000e+00)
%13 = fsub float 1.000000e+00, %12
store float %13, float* %4
%14 = load float, float* %4
%15 = load float, float* %4
%16 = fmul float %14, %15
%17 = load float, float* %4
%18 = load float, float* %4
%19 = load float, float* %4
%20 = load float, float* @M_PI
%21 = fmul float %19, %20
%22 = call float @sin(float %21)
%23 = fmul float %18, %22
%24 = fneg float %23
%25 = call float @llvm.fmuladd.f32(float %16, float %17, float %24)
%26 = fsub float 1.000000e+00, %25
%27 = fpext float %26 to double
%28 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %27, double 5.000000e-01)
%29 = fptrunc double %28 to float
store float %29, float* %2
br label %30
30: ; preds = %10, %8
%31 = load float, float* %2
ret float %31
}

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