#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 */
double BounceEaseIn(float);
double BounceEaseOut(float);
float BounceEaseInOut(float p) {
  if (p < 0.5) {
    return 0.5 * BounceEaseIn(p * 2);
  } else {
    return 0.5 * BounceEaseOut(p * 2 - 1) + 0.5;
  }
}


x86 assembly (clang, -O0):
<BounceEaseInOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1177 <BounceEaseInOut+0x57>
movss  0xebc(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
call   1030 <BounceEaseIn@plt>
movaps %xmm0,%xmm1
movsd  0xe9b(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11aa <BounceEaseInOut+0x8a>
movss  -0x8(%rbp),%xmm0
addss  %xmm0,%xmm0
movss  0xe80(%rip),%xmm1
addss  %xmm1,%xmm0
call   1040 <BounceEaseOut@plt>
movsd  0xe67(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BounceEaseInOut>:
push   %rax
movss  0xed7(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1141 <BounceEaseInOut+0x21>
addss  %xmm0,%xmm0
call   1030 <BounceEaseIn@plt>
mulsd  0xec9(%rip),%xmm0
jmp    1162 <BounceEaseInOut+0x42>
addss  %xmm0,%xmm0
addss  0xeb7(%rip),%xmm0
call   1040 <BounceEaseOut@plt>
movsd  0xeae(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @BounceEaseInOut(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, 5.000000e-01
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load float, float* %3
%9 = fmul float %8, 2.000000e+00
%10 = call double @BounceEaseIn(float %9)
%11 = fmul double 5.000000e-01, %10
%12 = fptrunc double %11 to float
store float %12, float* %2
br label %19
13: ; preds = %1
%14 = load float, float* %3
%15 = call float @llvm.fmuladd.f32(float %14, float 2.000000e+00, float -1.000000e+00)
%16 = call double @BounceEaseOut(float %15)
%17 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %16, double 5.000000e-01)
%18 = fptrunc double %17 to float
store float %18, float* %2
br label %19
19: ; preds = %13, %7
%20 = load float, float* %2
ret float %20
}

LLVM IR (-O2):
define float @BounceEaseInOut(float %0) {
%2 = fcmp olt float %0, 5.000000e-01
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fmul float %0, 2.000000e+00
%5 = tail call double @BounceEaseIn(float %4)
%6 = fmul double %5, 5.000000e-01
br label %11
7: ; preds = %1
%8 = tail call float @llvm.fmuladd.f32(float %0, float 2.000000e+00, float -1.000000e+00)
%9 = tail call double @BounceEaseOut(float %8)
%10 = tail call double @llvm.fmuladd.f64(double %9, double 5.000000e-01, double 5.000000e-01)
br label %11
11: ; preds = %7, %3
%12 = phi double [ %6, %3 ], [ %10, %7 ]
%13 = fptrunc double %12 to float
ret float %13
}