#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 */
float powf(float, int);
float quintic_io(float step, float max_steps, float max_val) {
  float ratio = step / (max_steps / 2);
  if (ratio < 1)
    return max_val / 2 * powf(ratio, 5);
  ratio -= 2;
  return max_val + max_val / 2 * powf(ratio, 5);
}


x86 assembly (clang, -O0):
<quintic_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xecb(%rip),%xmm2
divss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xeb2(%rip),%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    1193 <quintic_io+0x83>
movss  -0x10(%rbp),%xmm0
movss  0xe9f(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
mov    $0x5,%edi
call   1030 <powf@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11f2 <quintic_io+0xe2>
movss  -0x14(%rbp),%xmm0
movss  0xe64(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xe44(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
mov    $0x5,%edi
call   1030 <powf@plt>
movss  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x1c(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quintic_io>:
push   %rax
mulss  0xee7(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xedf(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1148 <quintic_io+0x38>
mulss  0xece(%rip),%xmm2
movss  %xmm2,(%rsp)
mov    $0x5,%edi
call   1030 <powf@plt>
mulss  (%rsp),%xmm0
pop    %rax
ret
addss  0xeb8(%rip),%xmm0
movss  0xea8(%rip),%xmm1
mulss  %xmm2,%xmm1
movss  %xmm1,0x4(%rsp)
mov    $0x5,%edi
movss  %xmm2,(%rsp)
call   1030 <powf@plt>
mulss  0x4(%rsp),%xmm0
addss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @quintic_io(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%9 = load float, float* %5
%10 = load float, float* %6
%11 = fdiv float %10, 2.000000e+00
%12 = fdiv float %9, %11
store float %12, float* %8
%13 = load float, float* %8
%14 = fcmp olt float %13, 1.000000e+00
br i1 %14, label %15, label %21
15: ; preds = %3
%16 = load float, float* %7
%17 = fdiv float %16, 2.000000e+00
%18 = load float, float* %8
%19 = call float @powf(float %18, i32 5)
%20 = fmul float %17, %19
store float %20, float* %4
br label %30
21: ; preds = %3
%22 = load float, float* %8
%23 = fsub float %22, 2.000000e+00
store float %23, float* %8
%24 = load float, float* %7
%25 = load float, float* %7
%26 = fdiv float %25, 2.000000e+00
%27 = load float, float* %8
%28 = call float @powf(float %27, i32 5)
%29 = call float @llvm.fmuladd.f32(float %26, float %28, float %24)
store float %29, float* %4
br label %30
30: ; preds = %21, %15
%31 = load float, float* %4
ret float %31
}

LLVM IR (-O2):
define float @quintic_io(float %0, float %1, float %2) {
%4 = fmul float %1, 5.000000e-01
%5 = fdiv float %0, %4
%6 = fcmp olt float %5, 1.000000e+00
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = fmul float %2, 5.000000e-01
%9 = tail call float @powf(float %5, i32 5)
%10 = fmul float %8, %9
br label %16
11: ; preds = %3
%12 = fadd float %5, -2.000000e+00
%13 = fmul float %2, 5.000000e-01
%14 = tail call float @powf(float %12, i32 5)
%15 = tail call float @llvm.fmuladd.f32(float %13, float %14, float %2)
br label %16
16: ; preds = %11, %7
%17 = phi float [ %10, %7 ], [ %15, %11 ]
ret float %17
}