#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);
double JHKeyframeAnimationFunctionEaseInOutCirc(double t, double b, double c,
                                                double d) {
  if ((t /= d / 2) < 1)
    return -c / 2 * (sqrt(1 - t * t) - 1) + b;
  return c / 2 * (sqrt(1 - (t -= 2) * t) + 1) + b;
}


x86 assembly (clang, -O0):
<JHKeyframeAnimationFunctionEaseInOutCirc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,-0x10(%rbp)
movsd  0xead(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11e7 <JHKeyframeAnimationFunctionEaseInOutCirc+0xd7>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe87(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe49(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movsd  -0x30(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2sd %eax,%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1266 <JHKeyframeAnimationFunctionEaseInOutCirc+0x156>
movsd  -0x20(%rbp),%xmm0
movsd  0xe14(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xdfe(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xdc5(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movsd  -0x38(%rbp),%xmm0
add    $0x1,%eax
cvtsi2sd %eax,%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<JHKeyframeAnimationFunctionEaseInOutCirc>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
mulsd  0xedd(%rip),%xmm3
divsd  %xmm3,%xmm0
movsd  0xed9(%rip),%xmm1
xor    %eax,%eax
xor    %ebx,%ebx
ucomisd %xmm0,%xmm1
seta   %cl
setbe  %dl
ja     1147 <JHKeyframeAnimationFunctionEaseInOutCirc+0x37>
addsd  0xec9(%rip),%xmm0
mov    %dl,%bl
mov    %cl,%al
lea    0xec6(%rip),%rcx
mulsd  (%rcx,%rax,8),%xmm2
movsd  %xmm2,(%rsp)
mulsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sqrt@plt>
lea    (%rax,%rbx,2),%eax
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @JHKeyframeAnimationFunctionEaseInOutCirc(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%10 = load double, double* %9
%11 = fdiv double %10, 2.000000e+00
%12 = load double, double* %6
%13 = fdiv double %12, %11
store double %13, double* %6
%14 = fcmp olt double %13, 1.000000e+00
br i1 %14, label %15, label %29
15: ; preds = %4
%16 = load double, double* %8
%17 = fneg double %16
%18 = fdiv double %17, 2.000000e+00
%19 = load double, double* %6
%20 = load double, double* %6
%21 = fneg double %19
%22 = call double @llvm.fmuladd.f64(double %21, double %20, double 1.000000e+00)
%23 = fptosi double %22 to i32
%24 = call i32 @sqrt(i32 %23)
%25 = sub nsw i32 %24, 1
%26 = sitofp i32 %25 to double
%27 = load double, double* %7
%28 = call double @llvm.fmuladd.f64(double %18, double %26, double %27)
store double %28, double* %5
br label %43
29: ; preds = %4
%30 = load double, double* %8
%31 = fdiv double %30, 2.000000e+00
%32 = load double, double* %6
%33 = fsub double %32, 2.000000e+00
store double %33, double* %6
%34 = load double, double* %6
%35 = fneg double %33
%36 = call double @llvm.fmuladd.f64(double %35, double %34, double 1.000000e+00)
%37 = fptosi double %36 to i32
%38 = call i32 @sqrt(i32 %37)
%39 = add nsw i32 %38, 1
%40 = sitofp i32 %39 to double
%41 = load double, double* %7
%42 = call double @llvm.fmuladd.f64(double %31, double %40, double %41)
store double %42, double* %5
br label %43
43: ; preds = %29, %15
%44 = load double, double* %5
ret double %44
}

LLVM IR (-O2):
define double @JHKeyframeAnimationFunctionEaseInOutCirc(double %0, double %1, double %2, double %3) {
%5 = fmul double %3, 5.000000e-01
%6 = fdiv double %0, %5
%7 = fcmp olt double %6, 1.000000e+00
%8 = fadd double %6, -2.000000e+00
%9 = select i1 %7, double %6, double %8
%10 = select i1 %7, i32 -1, i32 1
%11 = select i1 %7, double -5.000000e-01, double 5.000000e-01
%12 = fmul double %11, %2
%13 = fneg double %9
%14 = tail call double @llvm.fmuladd.f64(double %13, double %9, double 1.000000e+00)
%15 = fptosi double %14 to i32
%16 = tail call i32 @sqrt(i32 %15)
%17 = add nsw i32 %16, %10
%18 = sitofp i32 %17 to double
%19 = tail call double @llvm.fmuladd.f64(double %12, double %18, double %1)
ret double %19
}