#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 pow(int, int);
float exponentialEaseInOutf(float p) {
  if (p == 0.0 || p == 1.0)
    return p;
  if (p < 0.5) {
    return 0.5 * pow(2, (20 * p) - 10);
  } else {
    return -0.5 * pow(2, (-20 * p) + 10) + 1;
  }
}


x86 assembly (clang, -O0):
<exponentialEaseInOutf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    113e <exponentialEaseInOutf+0x2e>
jp     113e <exponentialEaseInOutf+0x2e>
jmp    115f <exponentialEaseInOutf+0x4f>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    116e <exponentialEaseInOutf+0x5e>
jp     116e <exponentialEaseInOutf+0x5e>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    121d <exponentialEaseInOutf+0x10d>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe89(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11d1 <exponentialEaseInOutf+0xc1>
movss  -0x8(%rbp),%xmm0
movss  0xe8a(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe82(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe49(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    121d <exponentialEaseInOutf+0x10d>
movss  -0x8(%rbp),%xmm0
movss  0xe3a(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe32(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0xe0c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdf0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponentialEaseInOutf>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    111b <exponentialEaseInOutf+0xb>
jnp    118d <exponentialEaseInOutf+0x7d>
ucomiss 0xede(%rip),%xmm0
jne    1126 <exponentialEaseInOutf+0x16>
jnp    118d <exponentialEaseInOutf+0x7d>
movss  0xed6(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    115b <exponentialEaseInOutf+0x4b>
mulss  0xed5(%rip),%xmm0
addss  0xed1(%rip),%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0xecf(%rip),%xmm0
jmp    1189 <exponentialEaseInOutf+0x79>
mulss  0xea5(%rip),%xmm0
addss  0xea1(%rip),%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0xe97(%rip),%xmm0
addsd  0xe97(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @exponentialEaseInOutf(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 oeq double %5, 0.000000e+00
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fcmp oeq double %9, 1.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %7, %1
%12 = load float, float* %3
store float %12, float* %2
br label %31
13: ; preds = %7
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = fcmp olt double %15, 5.000000e-01
br i1 %16, label %17, label %24
17: ; preds = %13
%18 = load float, float* %3
%19 = call float @llvm.fmuladd.f32(float 2.000000e+01, float %18, float -1.000000e+01)
%20 = fptosi float %19 to i32
%21 = call double @pow(i32 2, i32 %20)
%22 = fmul double 5.000000e-01, %21
%23 = fptrunc double %22 to float
store float %23, float* %2
br label %31
24: ; preds = %13
%25 = load float, float* %3
%26 = call float @llvm.fmuladd.f32(float -2.000000e+01, float %25, float 1.000000e+01)
%27 = fptosi float %26 to i32
%28 = call double @pow(i32 2, i32 %27)
%29 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %28, double 1.000000e+00)
%30 = fptrunc double %29 to float
store float %30, float* %2
br label %31
31: ; preds = %24, %17, %11
%32 = load float, float* %2
ret float %32
}

LLVM IR (-O2):
define float @exponentialEaseInOutf(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
%3 = fcmp oeq float %0, 1.000000e+00
%4 = or i1 %2, %3
br i1 %4, label %19, label %5
5: ; preds = %1
%6 = fcmp olt float %0, 5.000000e-01
br i1 %6, label %7, label %13
7: ; preds = %5
%8 = tail call float @llvm.fmuladd.f32(float %0, float 2.000000e+01, float -1.000000e+01)
%9 = fptosi float %8 to i32
%10 = tail call double @pow(i32 2, i32 %9)
%11 = fmul double %10, 5.000000e-01
%12 = fptrunc double %11 to float
br label %19
13: ; preds = %5
%14 = tail call float @llvm.fmuladd.f32(float %0, float -2.000000e+01, float 1.000000e+01)
%15 = fptosi float %14 to i32
%16 = tail call double @pow(i32 2, i32 %15)
%17 = tail call double @llvm.fmuladd.f64(double %16, double -5.000000e-01, double 1.000000e+00)
%18 = fptrunc double %17 to float
br label %19
19: ; preds = %1, %13, %7
%20 = phi float [ %12, %7 ], [ %18, %13 ], [ %0, %1 ]
ret float %20
}