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


x86 assembly (clang, -O0):
<Tween_ElasticOutEasing>:
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_ElasticOutEasing+0x4c>
jp     117c <Tween_ElasticOutEasing+0x4c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12b3 <Tween_ElasticOutEasing+0x183>
movsd  -0x10(%rbp),%xmm0
movsd  0xe87(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11ab <Tween_ElasticOutEasing+0x7b>
jp     11ab <Tween_ElasticOutEasing+0x7b>
movsd  0xe6f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12b3 <Tween_ElasticOutEasing+0x183>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11c8 <Tween_ElasticOutEasing+0x98>
jp     11c8 <Tween_ElasticOutEasing+0x98>
jmp    11db <Tween_ElasticOutEasing+0xab>
movsd  0xe40(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1203 <Tween_ElasticOutEasing+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_ElasticOutEasing+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  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xdd6(%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  0xd90(%rip),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd66(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tween_ElasticOutEasing>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1139 <Tween_ElasticOutEasing+0x19>
jp     1139 <Tween_ElasticOutEasing+0x19>
add    $0x18,%rsp
ret
movsd  0xebf(%rip),%xmm0
ucomisd %xmm0,%xmm1
jne    1149 <Tween_ElasticOutEasing+0x29>
jnp    1134 <Tween_ElasticOutEasing+0x14>
movsd  0xeb7(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
movsd  %xmm1,0x8(%rsp)
call   1040 <pow@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0xe93(%rip),%xmm0
mulsd  0xe93(%rip),%xmm0
divsd  0xe93(%rip),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0xe60(%rip),%xmm0
add    $0x18,%rsp
ret

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

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