#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 ANTweenTimingFunctionCircInOut(float time, float begin, float change,
                                     float duration) {
  time /= duration / 2;
  if (time < 1) {
    return -change / 2 * (sqrt(1 - time * time) - 1) + begin;
  } else {
    time -= 2;
    return change / 2 * (sqrt(1 - time * time) + 1) + begin;
  }
}


x86 assembly (clang, -O0):
<ANTweenTimingFunctionCircInOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
movss  -0x14(%rbp),%xmm1
movss  0xecb(%rip),%xmm0
divss  %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xead(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11d3 <ANTweenTimingFunctionCircInOut+0xc3>
movss  -0x10(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xe8d(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xe5d(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <sqrt@plt>
movss  -0x18(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2ss %eax,%xmm2
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    124d <ANTweenTimingFunctionCircInOut+0x13d>
movss  -0x8(%rbp),%xmm0
movss  0xe24(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xe0e(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xdde(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <sqrt@plt>
movss  -0x1c(%rbp),%xmm0
add    $0x1,%eax
cvtsi2ss %eax,%xmm2
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANTweenTimingFunctionCircInOut>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
mulss  0xedd(%rip),%xmm3
divss  %xmm3,%xmm0
movss  0xed5(%rip),%xmm1
xor    %eax,%eax
xor    %ebx,%ebx
ucomiss %xmm0,%xmm1
seta   %cl
setbe  %dl
ja     1146 <ANTweenTimingFunctionCircInOut+0x36>
addss  0xec2(%rip),%xmm0
mov    %dl,%bl
mov    %cl,%al
lea    0xebb(%rip),%rcx
mulss  (%rcx,%rax,4),%xmm2
movss  %xmm2,0x8(%rsp)
mulss  %xmm0,%xmm0
subss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
call   1030 <sqrt@plt>
lea    (%rax,%rbx,2),%eax
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x8(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

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

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