#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 atanf(float);
float bc(float signal, float drive, float threshold, float gain,
         float linearity, float wet) {
  float res = gain * atanf(signal * drive) / atanf(drive / threshold);
  res = linearity * signal - (linearity - 1) * res;
  if (res > .999f)
    res = .999f;
  if (res < -.999f)
    res = -.999f;
  res = res * wet + (1.f - wet) * signal;
  if (res > .999f)
    res = .999f;
  if (res < -.999f)
    res = -.999f;
  return res;
}


x86 assembly (clang, -O0):
<bc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
call   1030 <atanf@plt>
movaps %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
call   1030 <atanf@plt>
movaps %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x14(%rbp),%xmm1
movss  0xe6d(%rip),%xmm3
subss  %xmm3,%xmm1
mulss  -0x1c(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  0xe39(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11dd <bc+0xcd>
movss  0xe28(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xe23(%rip),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    11fc <bc+0xec>
movss  0xe11(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
movss  0xdf6(%rip),%xmm1
subss  -0x18(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  0xdce(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1248 <bc+0x138>
movss  0xdbd(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xdb8(%rip),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    1267 <bc+0x157>
movss  0xda6(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bc>:
sub    $0x18,%rsp
movss  %xmm5,0x14(%rsp)
movss  %xmm4,0x10(%rsp)
movss  %xmm3,(%rsp)
movss  %xmm2,0x8(%rsp)
movss  %xmm1,0x4(%rsp)
movss  %xmm0,0xc(%rsp)
mulss  %xmm1,%xmm0
call   1030 <atanf@plt>
mulss  (%rsp),%xmm0
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
divss  0x8(%rsp),%xmm0
call   1030 <atanf@plt>
movss  (%rsp),%xmm2
divss  %xmm0,%xmm2
movss  0xe94(%rip),%xmm0
movss  0x10(%rsp),%xmm1
addss  %xmm1,%xmm0
mulss  %xmm2,%xmm0
movss  0xc(%rsp),%xmm5
mulss  %xmm5,%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
movss  0xe71(%rip),%xmm1
movaps %xmm1,%xmm2
minss  %xmm0,%xmm2
movss  0xe66(%rip),%xmm0
movaps %xmm0,%xmm3
maxss  %xmm2,%xmm3
movss  0xe5b(%rip),%xmm2
movss  0x14(%rsp),%xmm4
subss  %xmm4,%xmm2
mulss  %xmm5,%xmm2
mulss  %xmm4,%xmm3
addss  %xmm2,%xmm3
minss  %xmm3,%xmm1
maxss  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @bc(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%14 = load float, float* %10
%15 = load float, float* %7
%16 = load float, float* %8
%17 = fmul float %15, %16
%18 = call float @atanf(float %17)
%19 = fmul float %14, %18
%20 = load float, float* %8
%21 = load float, float* %9
%22 = fdiv float %20, %21
%23 = call float @atanf(float %22)
%24 = fdiv float %19, %23
store float %24, float* %13
%25 = load float, float* %11
%26 = load float, float* %7
%27 = load float, float* %11
%28 = fsub float %27, 1.000000e+00
%29 = load float, float* %13
%30 = fmul float %28, %29
%31 = fneg float %30
%32 = call float @llvm.fmuladd.f32(float %25, float %26, float %31)
store float %32, float* %13
%33 = load float, float* %13
%34 = fcmp ogt float %33, 0x3FEFF7CEE0000000
br i1 %34, label %35, label %36
35: ; preds = %6
store float 0x3FEFF7CEE0000000, float* %13
br label %36
36: ; preds = %35, %6
%37 = load float, float* %13
%38 = fcmp olt float %37, 0xBFEFF7CEE0000000
br i1 %38, label %39, label %40
39: ; preds = %36
store float 0xBFEFF7CEE0000000, float* %13
br label %40
40: ; preds = %39, %36
%41 = load float, float* %13
%42 = load float, float* %12
%43 = load float, float* %12
%44 = fsub float 1.000000e+00, %43
%45 = load float, float* %7
%46 = fmul float %44, %45
%47 = call float @llvm.fmuladd.f32(float %41, float %42, float %46)
store float %47, float* %13
%48 = load float, float* %13
%49 = fcmp ogt float %48, 0x3FEFF7CEE0000000
br i1 %49, label %50, label %51
50: ; preds = %40
store float 0x3FEFF7CEE0000000, float* %13
br label %51
51: ; preds = %50, %40
%52 = load float, float* %13
%53 = fcmp olt float %52, 0xBFEFF7CEE0000000
br i1 %53, label %54, label %55
54: ; preds = %51
store float 0xBFEFF7CEE0000000, float* %13
br label %55
55: ; preds = %54, %51
%56 = load float, float* %13
ret float %56
}

LLVM IR (-O2):
define float @bc(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = fmul float %0, %1
%8 = tail call float @atanf(float %7)
%9 = fmul float %8, %3
%10 = fdiv float %1, %2
%11 = tail call float @atanf(float %10)
%12 = fdiv float %9, %11
%13 = fadd float %4, -1.000000e+00
%14 = fneg float %13
%15 = fmul float %12, %14
%16 = tail call float @llvm.fmuladd.f32(float %4, float %0, float %15)
%17 = fcmp ogt float %16, 0x3FEFF7CEE0000000
%18 = select i1 %17, float 0x3FEFF7CEE0000000, float %16
%19 = fcmp olt float %18, 0xBFEFF7CEE0000000
%20 = select i1 %19, float 0xBFEFF7CEE0000000, float %18
%21 = fsub float 1.000000e+00, %5
%22 = fmul float %21, %0
%23 = tail call float @llvm.fmuladd.f32(float %20, float %5, float %22)
%24 = fcmp ogt float %23, 0x3FEFF7CEE0000000
%25 = select i1 %24, float 0x3FEFF7CEE0000000, float %23
%26 = fcmp olt float %25, 0xBFEFF7CEE0000000
%27 = select i1 %26, float 0xBFEFF7CEE0000000, float %25
ret float %27
}