#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 M_PI;
float fabs(float);
float pow(int, float);
float sin(float);
float elasticIn(float fraction, float start, float delta, float amplitude,
                int bounces, float damping) {
  if (fraction == 0 || delta == 0)
    return start;
  if (fraction == 1)
    return start + delta;
  if (amplitude < fabs(delta))
    amplitude = delta;
  float period = 1 / (bounces + 0.25);
  return amplitude * pow(2, damping * (fraction - 1)) *
             sin(fraction * (2 * M_PI) / period) +
         start;
}


x86 assembly (clang, -O0):
<elasticIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
mov    %edi,-0x18(%rbp)
movss  %xmm4,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1170 <elasticIn+0x40>
jp     1170 <elasticIn+0x40>
jmp    1187 <elasticIn+0x57>
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1196 <elasticIn+0x66>
jp     1196 <elasticIn+0x66>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1294 <elasticIn+0x164>
movss  -0x8(%rbp),%xmm0
movss  0xe5d(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    11c6 <elasticIn+0x96>
jp     11c6 <elasticIn+0x96>
movss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1294 <elasticIn+0x164>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
movss  -0x24(%rbp),%xmm1
ucomiss %xmm1,%xmm0
jbe    11f2 <elasticIn+0xc2>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
cvtsi2sdl -0x18(%rbp),%xmm1
movsd  0xe11(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xdfd(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xdcc(%rip),%xmm2
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x2c(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
mov    0x2d85(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
divss  -0x20(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm2
movss  -0x28(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elasticIn>:
sub    $0x28,%rsp
movaps %xmm0,%xmm5
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm5
jne    1131 <elasticIn+0x11>
jnp    1147 <elasticIn+0x27>
ucomiss %xmm0,%xmm2
jne    1138 <elasticIn+0x18>
jnp    1147 <elasticIn+0x27>
ucomiss 0xec1(%rip),%xmm5
jne    114f <elasticIn+0x2f>
jp     114f <elasticIn+0x2f>
addss  %xmm2,%xmm1
movaps %xmm1,%xmm0
add    $0x28,%rsp
ret
movaps 0xeba(%rip),%xmm0
andps  %xmm2,%xmm0
movaps %xmm3,%xmm6
cmpltss %xmm0,%xmm6
andps  %xmm6,%xmm2
andnps %xmm3,%xmm6
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
addsd  0xeaa(%rip),%xmm0
movss  %xmm1,0xc(%rsp)
movsd  0xea4(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0x8(%rsp)
orps   %xmm2,%xmm6
movaps %xmm6,0x10(%rsp)
movss  0xe5f(%rip),%xmm0
addss  %xmm5,%xmm0
mulss  %xmm4,%xmm0
mov    $0x2,%edi
movss  %xmm5,0x4(%rsp)
call   1040 <pow@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
mulss  0x10(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
mulss  0x4(%rsp),%xmm1
divss  0x8(%rsp),%xmm1
movaps %xmm1,%xmm0
call   1030 <sin@plt>
mulss  0x10(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @elasticIn(float %0, float %1, float %2, float %3, i32 %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca i32
%13 = alloca float
%14 = alloca float
store float %0, float* %8
store float %1, float* %9
store float %2, float* %10
store float %3, float* %11
store i32 %4, i32* %12
store float %5, float* %13
%15 = load float, float* %8
%16 = fcmp oeq float %15, 0.000000e+00
br i1 %16, label %20, label %17
17: ; preds = %6
%18 = load float, float* %10
%19 = fcmp oeq float %18, 0.000000e+00
br i1 %19, label %20, label %22
20: ; preds = %17, %6
%21 = load float, float* %9
store float %21, float* %7
br label %59
22: ; preds = %17
%23 = load float, float* %8
%24 = fcmp oeq float %23, 1.000000e+00
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = load float, float* %9
%27 = load float, float* %10
%28 = fadd float %26, %27
store float %28, float* %7
br label %59
29: ; preds = %22
%30 = load float, float* %11
%31 = load float, float* %10
%32 = call float @fabs(float %31)
%33 = fcmp olt float %30, %32
br i1 %33, label %34, label %36
34: ; preds = %29
%35 = load float, float* %10
store float %35, float* %11
br label %36
36: ; preds = %34, %29
%37 = load i32, i32* %12
%38 = sitofp i32 %37 to double
%39 = fadd double %38, 2.500000e-01
%40 = fdiv double 1.000000e+00, %39
%41 = fptrunc double %40 to float
store float %41, float* %14
%42 = load float, float* %11
%43 = load float, float* %13
%44 = load float, float* %8
%45 = fsub float %44, 1.000000e+00
%46 = fmul float %43, %45
%47 = call float @pow(i32 2, float %46)
%48 = fmul float %42, %47
%49 = load float, float* %8
%50 = load i32, i32* @M_PI
%51 = mul nsw i32 2, %50
%52 = sitofp i32 %51 to float
%53 = fmul float %49, %52
%54 = load float, float* %14
%55 = fdiv float %53, %54
%56 = call float @sin(float %55)
%57 = load float, float* %9
%58 = call float @llvm.fmuladd.f32(float %48, float %56, float %57)
store float %58, float* %7
br label %59
59: ; preds = %36, %25, %20
%60 = load float, float* %7
ret float %60
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @elasticIn(float %0, float %1, float %2, float %3, i32 %4, float %5) {
%7 = fcmp oeq float %0, 0.000000e+00
%8 = fcmp oeq float %2, 0.000000e+00
%9 = or i1 %7, %8
br i1 %9, label %33, label %10
10: ; preds = %6
%11 = fcmp oeq float %0, 1.000000e+00
br i1 %11, label %12, label %14
12: ; preds = %10
%13 = fadd float %1, %2
br label %33
14: ; preds = %10
%15 = tail call float @llvm.fabs.f32(float %2)
%16 = fcmp ogt float %15, %3
%17 = select i1 %16, float %2, float %3
%18 = sitofp i32 %4 to double
%19 = fadd double %18, 2.500000e-01
%20 = fdiv double 1.000000e+00, %19
%21 = fptrunc double %20 to float
%22 = fadd float %0, -1.000000e+00
%23 = fmul float %22, %5
%24 = tail call float @pow(i32 2, float %23)
%25 = fmul float %17, %24
%26 = load i32, i32* @M_PI
%27 = shl nsw i32 %26, 1
%28 = sitofp i32 %27 to float
%29 = fmul float %28, %0
%30 = fdiv float %29, %21
%31 = tail call float @sin(float %30)
%32 = tail call float @llvm.fmuladd.f32(float %25, float %31, float %1)
br label %33
33: ; preds = %6, %14, %12
%34 = phi float [ %13, %12 ], [ %32, %14 ], [ %1, %6 ]
ret float %34
}