#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 M_PI;
double sin(double);
double backEaseInOutd(double p) {
  if (p < 0.5) {
    double f = 2 * p;
    return 0.5 * (f * f * f - f * sin(f * M_PI));
  } else {
    double f = (1 - (2 * p - 1));
    return 0.5 * (1 - (f * f * f - f * sin(f * M_PI))) + 0.5;
  }
}


x86 assembly (clang, -O0):
<backEaseInOutd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11c5 <backEaseInOutd+0xb5>
movsd  0xee0(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    0x2e77(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
movsd  -0x38(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe49(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1279 <backEaseInOutd+0x169>
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xe3a(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe26(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    0x2dce(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xda8(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xd94(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backEaseInOutd>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
movsd  0xee0(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    117b <backEaseInOutd+0x6b>
addsd  %xmm1,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
mov    0x2ea3(%rip),%rax
movsd  (%rax),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  %xmm2,%xmm1
subsd  %xmm0,%xmm1
mulsd  0xe8e(%rip),%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret
addsd  %xmm1,%xmm1
addsd  0xe81(%rip),%xmm1
movsd  0xe81(%rip),%xmm2
subsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rsp)
mov    0x2e3a(%rip),%rax
movsd  (%rax),%xmm0
mulsd  %xmm2,%xmm0
call   1030 <sin@plt>
movsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  %xmm2,%xmm1
subsd  %xmm0,%xmm1
movsd  0xe35(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xe19(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @backEaseInOutd(double %0) {
%2 = fcmp olt double %0, 5.000000e-01
br i1 %2, label %3, label %13
3: ; preds = %1
%4 = fmul double %0, 2.000000e+00
%5 = fmul double %4, %4
%6 = load double, double* @M_PI
%7 = fmul double %4, %6
%8 = tail call double @sin(double %7)
%9 = fneg double %4
%10 = fmul double %8, %9
%11 = tail call double @llvm.fmuladd.f64(double %5, double %4, double %10)
%12 = fmul double %11, 5.000000e-01
br label %25
13: ; preds = %1
%14 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double -1.000000e+00)
%15 = fsub double 1.000000e+00, %14
%16 = fmul double %15, %15
%17 = load double, double* @M_PI
%18 = fmul double %15, %17
%19 = tail call double @sin(double %18)
%20 = fneg double %15
%21 = fmul double %19, %20
%22 = tail call double @llvm.fmuladd.f64(double %16, double %15, double %21)
%23 = fsub double 1.000000e+00, %22
%24 = tail call double @llvm.fmuladd.f64(double %23, double 5.000000e-01, double 5.000000e-01)
br label %25
25: ; preds = %13, %3
%26 = phi double [ %12, %3 ], [ %24, %13 ]
ret double %26
}