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


x86 assembly (clang, -O0):
<exponential_ease_in_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed1(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    117c <exponential_ease_in_out+0x6c>
movss  -0x4(%rbp),%xmm1
movss  0xed2(%rip),%xmm0
mulss  %xmm0,%xmm1
movss  0xeca(%rip),%xmm0
addss  %xmm0,%xmm1
movss  0xeae(%rip),%xmm0
call   1030 <powf@plt>
movaps %xmm0,%xmm1
movss  0xe92(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    11c3 <exponential_ease_in_out+0xb3>
movss  -0x4(%rbp),%xmm1
movss  0xe87(%rip),%xmm0
mulss  %xmm0,%xmm1
movss  0xe7f(%rip),%xmm0
addss  %xmm0,%xmm1
movss  0xe6b(%rip),%xmm0
call   1030 <powf@plt>
movss  0xe56(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe4e(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponential_ease_in_out>:
push   %rax
movss  0xee7(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    113d <exponential_ease_in_out+0x2d>
mulss  0xeee(%rip),%xmm0
addss  0xeea(%rip),%xmm0
call   1030 <exp2f@plt>
mulss  0xec5(%rip),%xmm0
pop    %rax
ret
mulss  0xebf(%rip),%xmm0
addss  0xebb(%rip),%xmm0
call   1030 <exp2f@plt>
mulss  0xeb2(%rip),%xmm0
addss  0xeae(%rip),%xmm0
pop    %rax
ret

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

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