#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 powf(float, float);
float sinf(float);
float elastic_ease_in_out(float p) {
  float f = 0.0f;
  if (p < 0.5f) {
    f = 0.5f * sinf(13.0f * 1.5707963268f * (2.0f * p)) *
        powf(2.0f, 10.0f * ((2.0f * p) - 1.0f));
  } else {
    f = 0.5f * (sinf(-13.0f * 1.5707963268f * ((2.0f * p - 1.0f) + 1.0f)) *
                    powf(2.0f, -10.0f * (2.0f * p - 1.0f)) +
                2.0f);
  }
  return f;
}


x86 assembly (clang, -O0):
<elastic_ease_in_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xec3(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    11bd <elastic_ease_in_out+0x9d>
movss  0xeb5(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xec0(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1030 <sinf@plt>
movaps %xmm0,%xmm1
movss  0xe90(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
addss  %xmm0,%xmm0
movss  0xe82(%rip),%xmm1
addss  %xmm1,%xmm0
movss  0xe82(%rip),%xmm1
mulss  %xmm0,%xmm1
movss  0xe62(%rip),%xmm0
call   1040 <powf@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1248 <elastic_ease_in_out+0x128>
movss  -0x4(%rbp),%xmm1
addss  %xmm1,%xmm1
movss  0xe3e(%rip),%xmm0
addss  %xmm0,%xmm1
movss  0xe3a(%rip),%xmm0
addss  %xmm0,%xmm1
movss  0xe2a(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
addss  %xmm0,%xmm0
movss  0xe07(%rip),%xmm1
addss  %xmm1,%xmm0
movss  0xdf7(%rip),%xmm1
mulss  %xmm0,%xmm1
movss  0xde7(%rip),%xmm0
call   1040 <powf@plt>
movss  -0x10(%rbp),%xmm1
mulss  %xmm0,%xmm1
movss  0xdd1(%rip),%xmm0
addss  %xmm0,%xmm1
movss  0xdc1(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elastic_ease_in_out>:
push   %rax
movaps %xmm0,%xmm1
movss  0xed4(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    117b <elastic_ease_in_out+0x5b>
addss  %xmm1,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0xed5(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1030 <sinf@plt>
mulss  0xeac(%rip),%xmm0
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
addss  0xe9d(%rip),%xmm0
mulss  0xead(%rip),%xmm0
call   1040 <exp2f@plt>
mulss  (%rsp),%xmm0
pop    %rax
ret
addss  %xmm1,%xmm1
addss  0xe7d(%rip),%xmm1
movss  %xmm1,0x4(%rsp)
movss  0xe73(%rip),%xmm0
addss  %xmm1,%xmm0
mulss  0xe6b(%rip),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
mulss  0xe57(%rip),%xmm0
call   1040 <exp2f@plt>
mulss  (%rsp),%xmm0
addss  0xe49(%rip),%xmm0
mulss  0xe2d(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @elastic_ease_in_out(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0.000000e+00, float* %3
%4 = load float, float* %2
%5 = fcmp olt float %4, 5.000000e-01
br i1 %5, label %6, label %17
6: ; preds = %1
%7 = load float, float* %2
%8 = fmul float 2.000000e+00, %7
%9 = fmul float 0x40346B9C40000000, %8
%10 = call float @sinf(float %9)
%11 = fmul float 5.000000e-01, %10
%12 = load float, float* %2
%13 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %12, float -1.000000e+00)
%14 = fmul float 1.000000e+01, %13
%15 = call float @powf(float 2.000000e+00, float %14)
%16 = fmul float %11, %15
store float %16, float* %3
br label %29
17: ; preds = %1
%18 = load float, float* %2
%19 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %18, float -1.000000e+00)
%20 = fadd float %19, 1.000000e+00
%21 = fmul float 0xC0346B9C40000000, %20
%22 = call float @sinf(float %21)
%23 = load float, float* %2
%24 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %23, float -1.000000e+00)
%25 = fmul float -1.000000e+01, %24
%26 = call float @powf(float 2.000000e+00, float %25)
%27 = call float @llvm.fmuladd.f32(float %22, float %26, float 2.000000e+00)
%28 = fmul float 5.000000e-01, %27
store float %28, float* %3
br label %29
29: ; preds = %17, %6
%30 = load float, float* %3
ret float %30
}

LLVM IR (-O2):
define float @elastic_ease_in_out(float %0) {
%2 = fcmp olt float %0, 5.000000e-01
br i1 %2, label %3, label %12
3: ; preds = %1
%4 = fmul float %0, 2.000000e+00
%5 = fmul float %4, 0x40346B9C40000000
%6 = tail call float @sinf(float %5)
%7 = fmul float %6, 5.000000e-01
%8 = tail call float @llvm.fmuladd.f32(float %0, float 2.000000e+00, float -1.000000e+00)
%9 = fmul float %8, 1.000000e+01
%10 = tail call float @exp2f(float %9)
%11 = fmul float %7, %10
br label %21
12: ; preds = %1
%13 = tail call float @llvm.fmuladd.f32(float %0, float 2.000000e+00, float -1.000000e+00)
%14 = fadd float %13, 1.000000e+00
%15 = fmul float %14, 0xC0346B9C40000000
%16 = tail call float @sinf(float %15)
%17 = fmul float %13, -1.000000e+01
%18 = tail call float @exp2f(float %17)
%19 = tail call float @llvm.fmuladd.f32(float %16, float %18, float 2.000000e+00)
%20 = fmul float %19, 5.000000e-01
br label %21
21: ; preds = %12, %3
%22 = phi float [ %11, %3 ], [ %20, %12 ]
ret float %22
}