#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 pow(int, int);
int sin(int);
float ElasticEaseInOut(float p) {
  if (p < 0.5) {
    return 0.5 * sin(13 * 1.57079632679489661923 * (2 * p)) *
           pow(2, 10 * ((2 * p) - 1));
  } else {
    return 0.5 * (sin(-13 * 1.57079632679489661923 * ((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    11cd <ElasticEaseInOut+0xad>
movss  0xed8(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeaf(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe86(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm1
movss  0xe88(%rip),%xmm0
addss  %xmm0,%xmm1
movss  0xe84(%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    125d <ElasticEaseInOut+0x13d>
movss  -0x8(%rbp),%xmm0
addss  %xmm0,%xmm0
movss  0xe3e(%rip),%xmm1
addss  %xmm1,%xmm0
movss  0xe36(%rip),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe0e(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mov    %eax,-0x14(%rbp)
movss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm1
movss  0xe01(%rip),%xmm0
addss  %xmm0,%xmm1
movss  0xdf1(%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  0xdb0(%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
jbe    119c <ElasticEaseInOut+0x7c>
addss  %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
mulsd  0xedd(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xebd(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x4(%rsp),%xmm0
addss  0xe8d(%rip),%xmm0
mulss  0xe91(%rip),%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0x8(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
jmp    1202 <ElasticEaseInOut+0xe2>
addss  %xmm0,%xmm0
addss  0xe5c(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
movss  0xe52(%rip),%xmm1
addss  %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xe52(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sin@plt>
mov    %eax,%ebx
movss  0x4(%rsp),%xmm0
mulss  0xe2d(%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  0xe1e(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

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

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