#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 */
int M_PI_2;
int pow(int, int);
int sin(int);
float ElasticEaseInOut(float p) {
  if (p < 0.5) {
    return 0.5 * sin(13 * M_PI_2 * (2 * p)) * pow(2, 10 * ((2 * p) - 1));
  } else {
    return 0.5 *
           (sin(-13 * M_PI_2 * ((2 * p - 1) + 1)) * pow(2, -10 * (2 * p - 1)) +
            2);
  }
}


x86 assembly (clang, -O0):
<ElasticEaseInOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11cf <ElasticEaseInOut+0xaf>
mov    0x2e99(%rip),%rax
imul   $0xd,(%rax),%eax
cvtsi2ss %eax,%xmm0
movss  0xeba(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <sin@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe84(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm1
movss  0xe76(%rip),%xmm0
addss  %xmm0,%xmm1
movss  0xe72(%rip),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1264 <ElasticEaseInOut+0x144>
mov    0x2e12(%rip),%rax
imul   $0xfffffff3,(%rax),%eax
cvtsi2ss %eax,%xmm0
movss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm1
movss  0xe1b(%rip),%xmm2
addss  %xmm2,%xmm1
movss  0xe13(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <sin@plt>
mov    %eax,-0x14(%rbp)
movss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm1
movss  0xdea(%rip),%xmm0
addss  %xmm0,%xmm1
movss  0xdda(%rip),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
add    $0x2,%eax
cvtsi2sd %eax,%xmm1
movsd  0xda9(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ElasticEaseInOut>:
push   %rbx
sub    $0x10,%rsp
movss  0xed3(%rip),%xmm1
ucomiss %xmm0,%xmm1
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
jbe    11a7 <ElasticEaseInOut+0x87>
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rcx,4),%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
addss  %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xeaa(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x4(%rsp),%xmm0
addss  0xe82(%rip),%xmm0
mulss  0xe86(%rip),%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0x8(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
jmp    120c <ElasticEaseInOut+0xec>
imul   $0xfffffff3,%eax,%eax
cvtsi2ss %eax,%xmm2
addss  %xmm0,%xmm0
addss  0xe4a(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
movss  0xe40(%rip),%xmm1
addss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
cvttss2si %xmm1,%edi
call   1030 <sin@plt>
mov    %eax,%ebx
movss  0x4(%rsp),%xmm0
mulss  0xe23(%rip),%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
imul   %ebx,%eax
add    $0x2,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xe0c(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI_2 = global i32 0
define float @ElasticEaseInOut(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 %26
7: ; preds = %1
%8 = load i32, i32* @M_PI_2
%9 = mul nsw i32 13, %8
%10 = sitofp i32 %9 to float
%11 = load float, float* %3
%12 = fmul float 2.000000e+00, %11
%13 = fmul float %10, %12
%14 = fptosi float %13 to i32
%15 = call i32 @sin(i32 %14)
%16 = sitofp i32 %15 to double
%17 = fmul double 5.000000e-01, %16
%18 = load float, float* %3
%19 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %18, float -1.000000e+00)
%20 = fmul float 1.000000e+01, %19
%21 = fptosi float %20 to i32
%22 = call i32 @pow(i32 2, i32 %21)
%23 = sitofp i32 %22 to double
%24 = fmul double %17, %23
%25 = fptrunc double %24 to float
store float %25, float* %2
br label %46
26: ; preds = %1
%27 = load i32, i32* @M_PI_2
%28 = mul nsw i32 -13, %27
%29 = sitofp i32 %28 to float
%30 = load float, float* %3
%31 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %30, float -1.000000e+00)
%32 = fadd float %31, 1.000000e+00
%33 = fmul float %29, %32
%34 = fptosi float %33 to i32
%35 = call i32 @sin(i32 %34)
%36 = load float, float* %3
%37 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %36, float -1.000000e+00)
%38 = fmul float -1.000000e+01, %37
%39 = fptosi float %38 to i32
%40 = call i32 @pow(i32 2, i32 %39)
%41 = mul nsw i32 %35, %40
%42 = add nsw i32 %41, 2
%43 = sitofp i32 %42 to double
%44 = fmul double 5.000000e-01, %43
%45 = fptrunc double %44 to float
store float %45, float* %2
br label %46
46: ; preds = %26, %7
%47 = load float, float* %2
ret float %47
}

LLVM IR (-O2):
@M_PI_2 = global i32 0
define float @ElasticEaseInOut(float %0) {
%2 = fcmp olt float %0, 5.000000e-01
%3 = load i32, i32* @M_PI_2
br i1 %2, label %4, label %18
4: ; preds = %1
%5 = mul nsw i32 %3, 13
%6 = sitofp i32 %5 to float
%7 = fmul float %0, 2.000000e+00
%8 = fmul float %7, %6
%9 = fptosi float %8 to i32
%10 = tail call i32 @sin(i32 %9)
%11 = sitofp i32 %10 to double
%12 = fmul double %11, 5.000000e-01
%13 = tail call float @llvm.fmuladd.f32(float %0, float 2.000000e+00, float -1.000000e+00)
%14 = fmul float %13, 1.000000e+01
%15 = fptosi float %14 to i32
%16 = tail call i32 @pow(i32 2, i32 %15)
%17 = sitofp i32 %16 to double
br label %32
18: ; preds = %1
%19 = mul nsw i32 %3, -13
%20 = sitofp i32 %19 to float
%21 = tail call float @llvm.fmuladd.f32(float %0, float 2.000000e+00, float -1.000000e+00)
%22 = fadd float %21, 1.000000e+00
%23 = fmul float %22, %20
%24 = fptosi float %23 to i32
%25 = tail call i32 @sin(i32 %24)
%26 = fmul float %21, -1.000000e+01
%27 = fptosi float %26 to i32
%28 = tail call i32 @pow(i32 2, i32 %27)
%29 = mul nsw i32 %28, %25
%30 = add nsw i32 %29, 2
%31 = sitofp i32 %30 to double
br label %32
32: ; preds = %18, %4
%33 = phi double [ 5.000000e-01, %18 ], [ %17, %4 ]
%34 = phi double [ %31, %18 ], [ %12, %4 ]
%35 = fmul double %34, %33
%36 = fptrunc double %35 to float
ret float %36
}