#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_ElasticInEasing(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 -= 1;
  return -(a * pow(2, 10 * k) * sin((k - s) * (2 * 3.14159265) / p));
}


x86 assembly (clang, -O0):
<Tween_ElasticInEasing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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_ElasticInEasing+0x4c>
jp     117c <Tween_ElasticInEasing+0x4c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12d4 <Tween_ElasticInEasing+0x1a4>
movsd  -0x10(%rbp),%xmm0
movsd  0xe87(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11ab <Tween_ElasticInEasing+0x7b>
jp     11ab <Tween_ElasticInEasing+0x7b>
movsd  0xe6f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12d4 <Tween_ElasticInEasing+0x1a4>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11c8 <Tween_ElasticInEasing+0x98>
jp     11c8 <Tween_ElasticInEasing+0x98>
jmp    11db <Tween_ElasticInEasing+0xab>
movsd  0xe40(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1203 <Tween_ElasticInEasing+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_ElasticInEasing+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  -0x10(%rbp),%xmm0
movsd  0xdc3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xdc0(%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  0xd7a(%rip),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tween_ElasticInEasing>:
sub    $0x28,%rsp
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1130 <Tween_ElasticInEasing+0x10>
jnp    11a7 <Tween_ElasticInEasing+0x87>
movsd  0xec8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1140 <Tween_ElasticInEasing+0x20>
jnp    11a7 <Tween_ElasticInEasing+0x87>
addsd  0xec0(%rip),%xmm0
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
movsd  0xeb6(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
movapd %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0xe98(%rip),%xmm0
mulsd  0xe98(%rip),%xmm0
divsd  0xe98(%rip),%xmm0
call   1030 <sin@plt>
movapd 0x10(%rsp),%xmm1
xorpd  0xe8d(%rip),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @Tween_ElasticInEasing(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 %49
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 %49
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 = fsub double %32, 1.000000e+00
store double %33, double* %3
%34 = load double, double* %5
%35 = load double, double* %3
%36 = fmul double 1.000000e+01, %35
%37 = fptosi double %36 to i32
%38 = call double @pow(i32 2, i32 %37)
%39 = fmul double %34, %38
%40 = load double, double* %3
%41 = load double, double* %4
%42 = fsub double %40, %41
%43 = fmul double %42, 0x401921FB53C8D4F1
%44 = load double, double* %6
%45 = fdiv double %43, %44
%46 = call double @sin(double %45)
%47 = fmul double %39, %46
%48 = fneg double %47
store double %48, double* %2
br label %49
49: ; preds = %31, %13, %9
%50 = load double, double* %2
ret double %50
}

LLVM IR (-O2):
define double @Tween_ElasticInEasing(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = fcmp oeq double %0, 1.000000e+00
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = fadd double %0, -1.000000e+00
%7 = fmul double %6, 1.000000e+01
%8 = fptosi double %7 to i32
%9 = tail call double @pow(i32 2, i32 %8)
%10 = fadd double %6, -1.000000e-01
%11 = fmul double %10, 0x401921FB53C8D4F1
%12 = fdiv double %11, 4.000000e-01
%13 = tail call double @sin(double %12)
%14 = fneg double %9
%15 = fmul double %13, %14
br label %16
16: ; preds = %3, %1, %5
%17 = phi double [ %15, %5 ], [ 0.000000e+00, %1 ], [ 1.000000e+00, %3 ]
ret double %17
}