#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 sqrt(int);
float circularEaseInOutf(float p) {
  if (p < 0.5) {
    return 0.5 * (1 - sqrt(1 - 4 * (p * p)));
  } else {
    return 0.5 * (sqrt(-((2 * p) - 3) * ((2 * p) - 1)) + 1);
  }
}


x86 assembly (clang, -O0):
<circularEaseInOutf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    118a <circularEaseInOutf+0x7a>
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xec6(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xebe(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xe88(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11ea <circularEaseInOutf+0xda>
movss  -0x8(%rbp),%xmm0
addss  %xmm0,%xmm0
movss  0xe71(%rip),%xmm1
addss  %xmm1,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm1
movss  0xe4b(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <sqrt@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xe23(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circularEaseInOutf>:
push   %rax
movss  0xee7(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1146 <circularEaseInOutf+0x36>
mulss  %xmm0,%xmm0
mulss  0xee2(%rip),%xmm0
addss  0xede(%rip),%xmm0
cvttss2si %xmm0,%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
jmp    1175 <circularEaseInOutf+0x65>
addss  %xmm0,%xmm0
movss  0xeb2(%rip),%xmm1
addss  %xmm0,%xmm1
xorps  0xec3(%rip),%xmm1
addss  0xea3(%rip),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <sqrt@plt>
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xeac(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @circularEaseInOutf(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 %18
7: ; preds = %1
%8 = load float, float* %3
%9 = load float, float* %3
%10 = fmul float %8, %9
%11 = call float @llvm.fmuladd.f32(float -4.000000e+00, float %10, float 1.000000e+00)
%12 = fptosi float %11 to i32
%13 = call i32 @sqrt(i32 %12)
%14 = sub nsw i32 1, %13
%15 = sitofp i32 %14 to double
%16 = fmul double 5.000000e-01, %15
%17 = fptrunc double %16 to float
store float %17, float* %2
br label %31
18: ; preds = %1
%19 = load float, float* %3
%20 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %19, float -3.000000e+00)
%21 = fneg float %20
%22 = load float, float* %3
%23 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %22, float -1.000000e+00)
%24 = fmul float %21, %23
%25 = fptosi float %24 to i32
%26 = call i32 @sqrt(i32 %25)
%27 = add nsw i32 %26, 1
%28 = sitofp i32 %27 to double
%29 = fmul double 5.000000e-01, %28
%30 = fptrunc double %29 to float
store float %30, float* %2
br label %31
31: ; preds = %18, %7
%32 = load float, float* %2
ret float %32
}

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