#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 asin(int);
double pow(int, int);
double sin(double);
double Tween_ElasticInOutEasing(double k) {
  double s;
  double a = 0.1;
  double p = 0.4;
  if (k == 0) {
    return 0;
  }
  if (k == 1) {
    return 1;
  }
  if (!a || a < 1) {
    a = 1;
    s = p / 4;
  } else {
    s = p * asin(1 / a) / (2 * 3.14159265);
  }
  k *= 2;
  if (k < 1) {
    k -= 1;
    return -0.5 * (a * pow(2, 10 * k) * sin((k - s) * (2 * 3.14159265) / p));
  }
  k -= 1;
  return a * pow(2, -10 * k) * sin((k - s) * (2 * 3.14159265) / p) * 0.5 + 1;
}


x86 assembly (clang, -O0):
<Tween_ElasticInOutEasing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeae(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    117c <Tween_ElasticInOutEasing+0x4c>
jp     117c <Tween_ElasticInOutEasing+0x4c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1385 <Tween_ElasticInOutEasing+0x255>
movsd  -0x10(%rbp),%xmm0
movsd  0xe87(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11ab <Tween_ElasticInOutEasing+0x7b>
jp     11ab <Tween_ElasticInOutEasing+0x7b>
movsd  0xe6f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1385 <Tween_ElasticInOutEasing+0x255>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11c8 <Tween_ElasticInOutEasing+0x98>
jp     11c8 <Tween_ElasticInOutEasing+0x98>
jmp    11db <Tween_ElasticInOutEasing+0xab>
movsd  0xe40(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1203 <Tween_ElasticInOutEasing+0xd3>
movsd  0xe2d(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe2b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1240 <Tween_ElasticInOutEasing+0x110>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xdfb(%rip),%xmm0
divsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <asin@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xde1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xde0(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xdb6(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    12f0 <Tween_ElasticInOutEasing+0x1c0>
movsd  -0x10(%rbp),%xmm0
movsd  0xd9e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xdbb(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xd55(%rip),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xd5e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1385 <Tween_ElasticInOutEasing+0x255>
movsd  -0x10(%rbp),%xmm0
movsd  0xd13(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xd20(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xcca(%rip),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xcc0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc94(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tween_ElasticInOutEasing>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1139 <Tween_ElasticInOutEasing+0x19>
jp     1139 <Tween_ElasticInOutEasing+0x19>
add    $0x18,%rsp
ret
movsd  0xebf(%rip),%xmm0
ucomisd %xmm0,%xmm1
jne    1149 <Tween_ElasticInOutEasing+0x29>
jnp    1134 <Tween_ElasticInOutEasing+0x14>
addsd  %xmm1,%xmm1
movsd  0xeab(%rip),%xmm0
ucomisd %xmm1,%xmm0
addsd  0xea7(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
jbe    11bf <Tween_ElasticInOutEasing+0x9f>
movsd  0xec7(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0xe81(%rip),%xmm0
mulsd  0xe81(%rip),%xmm0
divsd  0xe81(%rip),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
mulsd  0xe86(%rip),%xmm0
add    $0x18,%rsp
ret
movsd  0xe49(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0xe2b(%rip),%xmm0
mulsd  0xe2b(%rip),%xmm0
divsd  0xe2b(%rip),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
mulsd  0xe20(%rip),%xmm0
addsd  0xde8(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @Tween_ElasticInOutEasing(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double 1.000000e-01, double* %5
store double 4.000000e-01, double* %6
%7 = load double, double* %3
%8 = fcmp oeq double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %1
store double 0.000000e+00, double* %2
br label %72
10: ; preds = %1
%11 = load double, double* %3
%12 = fcmp oeq double %11, 1.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %10
store double 1.000000e+00, double* %2
br label %72
14: ; preds = %10
%15 = load double, double* %5
%16 = fcmp une double %15, 0.000000e+00
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load double, double* %5
%19 = fcmp olt double %18, 1.000000e+00
br i1 %19, label %20, label %23
20: ; preds = %17, %14
store double 1.000000e+00, double* %5
%21 = load double, double* %6
%22 = fdiv double %21, 4.000000e+00
store double %22, double* %4
br label %31
23: ; preds = %17
%24 = load double, double* %6
%25 = load double, double* %5
%26 = fdiv double 1.000000e+00, %25
%27 = fptosi double %26 to i32
%28 = call double @asin(i32 %27)
%29 = fmul double %24, %28
%30 = fdiv double %29, 0x401921FB53C8D4F1
store double %30, double* %4
br label %31
31: ; preds = %23, %20
%32 = load double, double* %3
%33 = fmul double %32, 2.000000e+00
store double %33, double* %3
%34 = load double, double* %3
%35 = fcmp olt double %34, 1.000000e+00
br i1 %35, label %36, label %54
36: ; preds = %31
%37 = load double, double* %3
%38 = fsub double %37, 1.000000e+00
store double %38, double* %3
%39 = load double, double* %5
%40 = load double, double* %3
%41 = fmul double 1.000000e+01, %40
%42 = fptosi double %41 to i32
%43 = call double @pow(i32 2, i32 %42)
%44 = fmul double %39, %43
%45 = load double, double* %3
%46 = load double, double* %4
%47 = fsub double %45, %46
%48 = fmul double %47, 0x401921FB53C8D4F1
%49 = load double, double* %6
%50 = fdiv double %48, %49
%51 = call double @sin(double %50)
%52 = fmul double %44, %51
%53 = fmul double -5.000000e-01, %52
store double %53, double* %2
br label %72
54: ; preds = %31
%55 = load double, double* %3
%56 = fsub double %55, 1.000000e+00
store double %56, double* %3
%57 = load double, double* %5
%58 = load double, double* %3
%59 = fmul double -1.000000e+01, %58
%60 = fptosi double %59 to i32
%61 = call double @pow(i32 2, i32 %60)
%62 = fmul double %57, %61
%63 = load double, double* %3
%64 = load double, double* %4
%65 = fsub double %63, %64
%66 = fmul double %65, 0x401921FB53C8D4F1
%67 = load double, double* %6
%68 = fdiv double %66, %67
%69 = call double @sin(double %68)
%70 = fmul double %62, %69
%71 = call double @llvm.fmuladd.f64(double %70, double 5.000000e-01, double 1.000000e+00)
store double %71, double* %2
br label %72
72: ; preds = %54, %36, %13, %9
%73 = load double, double* %2
ret double %73
}

LLVM IR (-O2):
define double @Tween_ElasticInOutEasing(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %29, label %3
3: ; preds = %1
%4 = fcmp oeq double %0, 1.000000e+00
br i1 %4, label %29, label %5
5: ; preds = %3
%6 = fmul double %0, 2.000000e+00
%7 = fcmp olt double %6, 1.000000e+00
%8 = fadd double %6, -1.000000e+00
br i1 %7, label %9, label %19
9: ; preds = %5
%10 = fmul double %8, 1.000000e+01
%11 = fptosi double %10 to i32
%12 = tail call double @pow(i32 2, i32 %11)
%13 = fadd double %8, -1.000000e-01
%14 = fmul double %13, 0x401921FB53C8D4F1
%15 = fdiv double %14, 4.000000e-01
%16 = tail call double @sin(double %15)
%17 = fmul double %12, %16
%18 = fmul double %17, -5.000000e-01
br label %29
19: ; preds = %5
%20 = fmul double %8, -1.000000e+01
%21 = fptosi double %20 to i32
%22 = tail call double @pow(i32 2, i32 %21)
%23 = fadd double %8, -1.000000e-01
%24 = fmul double %23, 0x401921FB53C8D4F1
%25 = fdiv double %24, 4.000000e-01
%26 = tail call double @sin(double %25)
%27 = fmul double %22, %26
%28 = tail call double @llvm.fmuladd.f64(double %27, double 5.000000e-01, double 1.000000e+00)
br label %29
29: ; preds = %3, %1, %19, %9
%30 = phi double [ %18, %9 ], [ %28, %19 ], [ 0.000000e+00, %1 ], [ 1.000000e+00, %3 ]
ret double %30
}