#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 /*<<< orphan*/ __max(double, float);
float __min(int /*<<< orphan*/, double);
float BassBoosta(float sample) {
  static float selectivity, gain1, gain2, ratio, cap;
  selectivity = 140;
  ratio = 0.9;
  gain2 = 0.9;
  gain1 = 1.0 / (selectivity + 1.0);
  cap = (sample + cap * selectivity) * gain1;
  sample = __min(__max(-1.0, (sample + cap * ratio) * gain2), 1.0);
  return sample;
}


x86 assembly (clang, -O0):
<BassBoosta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedf(%rip),%xmm0
movss  %xmm0,0x2ef7(%rip)
movss  0xecb(%rip),%xmm0
movss  %xmm0,0x2ef3(%rip)
movss  0xebb(%rip),%xmm0
movss  %xmm0,0x2edf(%rip)
movss  0x2ecf(%rip),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe8f(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe83(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x2eab(%rip)
movss  -0x4(%rbp),%xmm1
movss  0x2eaa(%rip),%xmm0
movss  0x2e92(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mulss  0x2e86(%rip),%xmm0
movss  %xmm0,0x2e8a(%rip)
movss  -0x4(%rbp),%xmm0
movss  0x2e7d(%rip),%xmm1
movss  0x2e71(%rip),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mulss  0x2e5d(%rip),%xmm1
movsd  0xe21(%rip),%xmm0
call   1040 <__max@plt>
mov    %eax,%edi
movsd  0xe0a(%rip),%xmm0
call   1030 <__min@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BassBoosta>:
push   %rax
movss  0x2f0b(%rip),%xmm1
mulss  0xecf(%rip),%xmm1
addss  %xmm0,%xmm1
mulss  0xec7(%rip),%xmm1
movss  %xmm1,0x2eef(%rip)
movss  0xebb(%rip),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
movsd  0xeaf(%rip),%xmm0
call   1040 <__max@plt>
movsd  0xeaa(%rip),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1030 <__min@plt>

LLVM IR (-O0):
@BassBoosta.selectivity = internal global float 0.000000e+00
@BassBoosta.gain1 = internal global float 0.000000e+00
@BassBoosta.gain2 = internal global float 0.000000e+00
@BassBoosta.ratio = internal global float 0.000000e+00
@BassBoosta.cap = internal global float 0.000000e+00
define float @BassBoosta(float %0) {
%2 = alloca float
store float %0, float* %2
store float 1.400000e+02, float* @BassBoosta.selectivity
store float 0x3FECCCCCC0000000, float* @BassBoosta.ratio
store float 0x3FECCCCCC0000000, float* @BassBoosta.gain2
%3 = load float, float* @BassBoosta.selectivity
%4 = fpext float %3 to double
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double 1.000000e+00, %5
%7 = fptrunc double %6 to float
store float %7, float* @BassBoosta.gain1
%8 = load float, float* %2
%9 = load float, float* @BassBoosta.cap
%10 = load float, float* @BassBoosta.selectivity
%11 = call float @llvm.fmuladd.f32(float %9, float %10, float %8)
%12 = load float, float* @BassBoosta.gain1
%13 = fmul float %11, %12
store float %13, float* @BassBoosta.cap
%14 = load float, float* %2
%15 = load float, float* @BassBoosta.cap
%16 = load float, float* @BassBoosta.ratio
%17 = call float @llvm.fmuladd.f32(float %15, float %16, float %14)
%18 = load float, float* @BassBoosta.gain2
%19 = fmul float %17, %18
%20 = call i32 @__max(double -1.000000e+00, float %19)
%21 = call float @__min(i32 %20, double 1.000000e+00)
store float %21, float* %2
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
@BassBoosta.cap = internal unnamed_addr global float 0.000000e+00
define float @BassBoosta(float %0) {
%2 = load float, float* @BassBoosta.cap
%3 = tail call float @llvm.fmuladd.f32(float %2, float 1.400000e+02, float %0)
%4 = fmul float %3, 0x3F7D0CB580000000
store float %4, float* @BassBoosta.cap
%5 = tail call float @llvm.fmuladd.f32(float %4, float 0x3FECCCCCC0000000, float %0)
%6 = fmul float %5, 0x3FECCCCCC0000000
%7 = tail call i32 @__max(double -1.000000e+00, float %6)
%8 = tail call float @__min(i32 %7, double 1.000000e+00)
ret float %8
}