#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 DBL_EPSILON;
double atanh(double);
double cos(double);
double pow(double, double);
double sin(double);
double sinh(double const);
void designPeakingFilter(double dbGain, double centreFreq, double fs,
                         double dBandwidthOrQOrS, double *b0, double *b1,
                         double *b2, double *a1, double *a2) {
  if (centreFreq <= DBL_EPSILON || fs <= DBL_EPSILON)
    return;
  const double at1d3 = atanh(1.0 / 3.0);
  double lingain = pow(10.0, dbGain / 40.0);
  double omega = (6.2831853071795862 * centreFreq) / fs;
  double num3 = sin(omega);
  double cs = cos(omega);
  double alpha = num3 * sinh((at1d3 * dBandwidthOrQOrS * omega) / num3);
  double B0 = 1.0 + (alpha * lingain);
  double B1 = -2.0 * cs;
  double B2 = 1.0 - (alpha * lingain);
  double A0 = 1.0 + (alpha / lingain);
  double A1 = -2.0 * cs;
  double A2 = 1.0 - (alpha / lingain);
  *b0 = B0 / A0;
  *b1 = B1 / A0;
  *b2 = B2 / A0;
  *a1 = A1 / A0;
  *a2 = A2 / A0;
}


x86 assembly (clang, -O0):
<designPeakingFilter>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %r8,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm1
mov    0x2e59(%rip),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jae    11b7 <designPeakingFilter+0x67>
movsd  -0x18(%rbp),%xmm1
mov    0x2e3f(%rip),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     11bc <designPeakingFilter+0x6c>
jmp    1393 <designPeakingFilter+0x243>
movsd  0xe64(%rip),%xmm0
call   1040 <atanh@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xe45(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe31(%rip),%xmm0
call   1070 <pow@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  0xe17(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
divsd  -0x68(%rbp),%xmm0
call   1030 <sinh@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd8a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xd81(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd3f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x78(%rbp),%xmm1
divsd  -0x58(%rbp),%xmm1
movsd  0xd21(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xd15(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x78(%rbp),%xmm1
divsd  -0x58(%rbp),%xmm1
movsd  0xcee(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
divsd  -0x98(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x88(%rbp),%xmm0
ff
divsd  -0x98(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x90(%rbp),%xmm0
ff
divsd  -0x98(%rbp),%xmm0
ff
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xa0(%rbp),%xmm0
ff
divsd  -0x98(%rbp),%xmm0
ff
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xa8(%rbp),%xmm0
ff
divsd  -0x98(%rbp),%xmm0
ff
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<designPeakingFilter>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
movapd %xmm0,%xmm4
mov    0x2e80(%rip),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jae    129d <designPeakingFilter+0x14d>
ucomisd %xmm2,%xmm0
jae    129d <designPeakingFilter+0x14d>
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
movsd  0xe69(%rip),%xmm0
movsd  %xmm3,0x28(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,(%rsp)
movsd  %xmm4,0x10(%rsp)
call   1040 <atanh@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm1
divsd  0xe41(%rip),%xmm1
movsd  0xe41(%rip),%xmm0
call   1070 <pow@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xe30(%rip),%xmm0
divsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1050 <sin@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
divsd  (%rsp),%xmm0
call   1030 <sinh@plt>
mulsd  (%rsp),%xmm0
movapd %xmm0,%xmm1
movsd  0x10(%rsp),%xmm4
mulsd  %xmm4,%xmm1
movsd  0xddb(%rip),%xmm2
movsd  0x18(%rsp),%xmm5
mulsd  0xdd5(%rip),%xmm5
movapd %xmm2,%xmm3
subsd  %xmm1,%xmm3
addsd  %xmm2,%xmm1
divsd  %xmm4,%xmm0
movapd %xmm0,%xmm4
addsd  %xmm2,%xmm4
subsd  %xmm0,%xmm2
divsd  %xmm4,%xmm1
movsd  %xmm1,(%rbx)
movapd %xmm5,%xmm0
divsd  %xmm4,%xmm0
movsd  %xmm0,0x0(%r13)
divsd  %xmm4,%xmm3
movsd  %xmm3,(%r12)
movsd  %xmm0,(%r15)
divsd  %xmm4,%xmm2
movsd  %xmm2,(%r14)
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@DBL_EPSILON = global double 0.000000e+00
define void @designPeakingFilter(double %0, double %1, double %2, double %3, double* %4, double* %5, double* %6, double* %7, double* %8) {
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
store double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double* %4, double** %14
store double* %5, double** %15
store double* %6, double** %16
store double* %7, double** %17
store double* %8, double** %18
%31 = load double, double* %11
%32 = load double, double* @DBL_EPSILON
%33 = fcmp ole double %31, %32
br i1 %33, label %38, label %34
34: ; preds = %9
%35 = load double, double* %12
%36 = load double, double* @DBL_EPSILON
%37 = fcmp ole double %35, %36
br i1 %37, label %38, label %39
38: ; preds = %34, %9
br label %101
39: ; preds = %34
%40 = call double @atanh(double 0x3FD5555555555555)
store double %40, double* %19
%41 = load double, double* %10
%42 = fdiv double %41, 4.000000e+01
%43 = call double @pow(double 1.000000e+01, double %42)
store double %43, double* %20
%44 = load double, double* %11
%45 = fmul double 0x401921FB54442D18, %44
%46 = load double, double* %12
%47 = fdiv double %45, %46
store double %47, double* %21
%48 = load double, double* %21
%49 = call double @sin(double %48)
store double %49, double* %22
%50 = load double, double* %21
%51 = call double @cos(double %50)
store double %51, double* %23
%52 = load double, double* %22
%53 = load double, double* %19
%54 = load double, double* %13
%55 = fmul double %53, %54
%56 = load double, double* %21
%57 = fmul double %55, %56
%58 = load double, double* %22
%59 = fdiv double %57, %58
%60 = call double @sinh(double %59)
%61 = fmul double %52, %60
store double %61, double* %24
%62 = load double, double* %24
%63 = load double, double* %20
%64 = call double @llvm.fmuladd.f64(double %62, double %63, double 1.000000e+00)
store double %64, double* %25
%65 = load double, double* %23
%66 = fmul double -2.000000e+00, %65
store double %66, double* %26
%67 = load double, double* %24
%68 = load double, double* %20
%69 = fneg double %67
%70 = call double @llvm.fmuladd.f64(double %69, double %68, double 1.000000e+00)
store double %70, double* %27
%71 = load double, double* %24
%72 = load double, double* %20
%73 = fdiv double %71, %72
%74 = fadd double 1.000000e+00, %73
store double %74, double* %28
%75 = load double, double* %23
%76 = fmul double -2.000000e+00, %75
store double %76, double* %29
%77 = load double, double* %24
%78 = load double, double* %20
%79 = fdiv double %77, %78
%80 = fsub double 1.000000e+00, %79
store double %80, double* %30
%81 = load double, double* %25
%82 = load double, double* %28
%83 = fdiv double %81, %82
%84 = load double*, double** %14
store double %83, double* %84
%85 = load double, double* %26
%86 = load double, double* %28
%87 = fdiv double %85, %86
%88 = load double*, double** %15
store double %87, double* %88
%89 = load double, double* %27
%90 = load double, double* %28
%91 = fdiv double %89, %90
%92 = load double*, double** %16
store double %91, double* %92
%93 = load double, double* %29
%94 = load double, double* %28
%95 = fdiv double %93, %94
%96 = load double*, double** %17
store double %95, double* %96
%97 = load double, double* %30
%98 = load double, double* %28
%99 = fdiv double %97, %98
%100 = load double*, double** %18
store double %99, double* %100
br label %101
101: ; preds = %39, %38
ret void
}

LLVM IR (-O2):
@DBL_EPSILON = global double 0.000000e+00
define void @designPeakingFilter(double %0, double %1, double %2, double %3, double* nocapture writeonly %4, double* nocapture writeonly %5, double* nocapture writeonly %6, double* nocapture writeonly %7, double* nocapture writeonly %8) {
%10 = load double, double* @DBL_EPSILON
%11 = fcmp ult double %10, %1
%12 = fcmp ult double %10, %2
%13 = and i1 %11, %12
br i1 %13, label %14, label %38
14: ; preds = %9
%15 = tail call double @atanh(double 0x3FD5555555555555)
%16 = fdiv double %0, 4.000000e+01
%17 = tail call double @pow(double 1.000000e+01, double %16)
%18 = fmul double %1, 0x401921FB54442D18
%19 = fdiv double %18, %2
%20 = tail call double @sin(double %19)
%21 = tail call double @cos(double %19)
%22 = fmul double %15, %3
%23 = fmul double %19, %22
%24 = fdiv double %23, %20
%25 = tail call double @sinh(double %24)
%26 = fmul double %20, %25
%27 = tail call double @llvm.fmuladd.f64(double %26, double %17, double 1.000000e+00)
%28 = fmul double %21, -2.000000e+00
%29 = fneg double %26
%30 = tail call double @llvm.fmuladd.f64(double %29, double %17, double 1.000000e+00)
%31 = fdiv double %26, %17
%32 = fadd double %31, 1.000000e+00
%33 = fsub double 1.000000e+00, %31
%34 = fdiv double %27, %32
store double %34, double* %4
%35 = fdiv double %28, %32
store double %35, double* %5
%36 = fdiv double %30, %32
store double %36, double* %6
store double %35, double* %7
%37 = fdiv double %33, %32
store double %37, double* %8
br label %38
38: ; preds = %9, %14
ret void
}