void biquad_notch(struct biquad *bq, double frequency, double Q) {
  frequency = ({
    __typeof__(0.0) _a = (0.0);
    __typeof__(({
      __typeof__(frequency) _a = (frequency);
      __typeof__(1.0) _b = (1.0);
      _a < _b ? _a : _b;
    })) _b = (({
      __typeof__(frequency) _a = (frequency);
      __typeof__(1.0) _b = (1.0);
      _a < _b ? _a : _b;
    }));
    _a > _b ? _a : _b;
  });
  Q = ({
    __typeof__(0.0) _a = (0.0);
    __typeof__(Q) _b = (Q);
    _a > _b ? _a : _b;
  });
  if (frequency > 0 && frequency < 1) {
    if (Q > 0) {
      double w0 = 3.14159265358979323846 * frequency;
      double alpha = sin(w0) / (2 * Q);
      double k = cos(w0);
      double b0 = 1;
      double b1 = -2 * k;
      double b2 = 1;
      double a0 = 1 + alpha;
      double a1 = -2 * k;
      double a2 = 1 - alpha;
      set_coefficient(bq, b0, b1, b2, a0, a1, a2);
    } else {
      set_coefficient(bq, 0, 0, 0, 1, 0, 0);
    }
  } else {
    set_coefficient(bq, 1, 0, 0, 1, 0, 0);
  }
}


x86 assembly (clang, -O0):
<biquad_notch>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe9d(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    118e <biquad_notch+0x5e>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
jmp    119b <biquad_notch+0x6b>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    11d4 <biquad_notch+0xa4>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    11e1 <biquad_notch+0xb1>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    122c <biquad_notch+0xfc>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
jmp    1239 <biquad_notch+0x109>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    139f <biquad_notch+0x26f>
movsd  0xd96(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    139f <biquad_notch+0x26f>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1376 <biquad_notch+0x246>
movsd  0xd89(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1030 <sin@plt>
movsd  0xd65(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  0xd30(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xd2b(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xd0e(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xcfe(%rip),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xcf1(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xcd4(%rip),%xmm0
subsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x8(%rbp),%rdi
movsd  -0x80(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0x98(%rbp),%xmm3
ff
movsd  -0xa0(%rbp),%xmm4
ff
movsd  -0xa8(%rbp),%xmm5
ff
mov    $0x6,%al
call   1040 <set_coefficient@plt>
jmp    139a <biquad_notch+0x26a>
mov    -0x8(%rbp),%rdi
xor    %r9d,%r9d
mov    $0x1,%r8d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
movl   $0x0,(%rsp)
mov    $0x0,%al
call   1040 <set_coefficient@plt>
jmp    13c3 <biquad_notch+0x293>
mov    -0x8(%rbp),%rdi
mov    $0x1,%r8d
xor    %r9d,%r9d
mov    %r8d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
movl   $0x0,(%rsp)
mov    $0x0,%al
call   1040 <set_coefficient@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<biquad_notch>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
minsd  0xec0(%rip),%xmm0
xorpd  %xmm4,%xmm4
xorpd  %xmm2,%xmm2
maxsd  %xmm0,%xmm2
ucomisd %xmm4,%xmm2
jbe    11f3 <biquad_notch+0xc3>
movsd  0xea2(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    11f3 <biquad_notch+0xc3>
maxsd  %xmm1,%xmm4
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm4
jbe    1204 <biquad_notch+0xd4>
mulsd  0xe86(%rip),%xmm2
movsd  %xmm2,0x18(%rsp)
movapd %xmm2,%xmm0
movsd  %xmm4,0x10(%rsp)
call   1030 <sin@plt>
movsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1050 <cos@plt>
movapd %xmm0,%xmm1
mulsd  0xe4e(%rip),%xmm1
movsd  0xe36(%rip),%xmm0
movapd %xmm0,%xmm5
movsd  0x10(%rsp),%xmm3
subsd  %xmm3,%xmm5
addsd  %xmm0,%xmm3
mov    %rbx,%rdi
movapd %xmm0,%xmm2
movapd %xmm1,%xmm4
mov    $0x6,%al
add    $0x20,%rsp
pop    %rbx
jmp    1040 <set_coefficient@plt>
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    $0x1,%esi
jmp    1210 <biquad_notch+0xe0>
movl   $0x0,(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
call   1040 <set_coefficient@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.biquad = type opaque
define void @biquad_notch(%struct.biquad* %0, double %1, double %2) {
%4 = alloca %struct.biquad*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%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
store %struct.biquad* %0, %struct.biquad** %4
store double %1, double* %5
store double %2, double* %6
store double 0.000000e+00, double* %7
%25 = load double, double* %5
store double %25, double* %9
store double 1.000000e+00, double* %10
%26 = load double, double* %9
%27 = load double, double* %10
%28 = fcmp olt double %26, %27
br i1 %28, label %29, label %31
29: ; preds = %3
%30 = load double, double* %9
br label %33
31: ; preds = %3
%32 = load double, double* %10
br label %33
33: ; preds = %31, %29
%34 = phi double [ %30, %29 ], [ %32, %31 ]
store double %34, double* %11
%35 = load double, double* %11
store double %35, double* %8
%36 = load double, double* %7
%37 = load double, double* %8
%38 = fcmp ogt double %36, %37
br i1 %38, label %39, label %41
39: ; preds = %33
%40 = load double, double* %7
br label %43
41: ; preds = %33
%42 = load double, double* %8
br label %43
43: ; preds = %41, %39
%44 = phi double [ %40, %39 ], [ %42, %41 ]
store double %44, double* %12
%45 = load double, double* %12
store double %45, double* %5
store double 0.000000e+00, double* %13
%46 = load double, double* %6
store double %46, double* %14
%47 = load double, double* %13
%48 = load double, double* %14
%49 = fcmp ogt double %47, %48
br i1 %49, label %50, label %52
50: ; preds = %43
%51 = load double, double* %13
br label %54
52: ; preds = %43
%53 = load double, double* %14
br label %54
54: ; preds = %52, %50
%55 = phi double [ %51, %50 ], [ %53, %52 ]
store double %55, double* %15
%56 = load double, double* %15
store double %56, double* %6
%57 = load double, double* %5
%58 = fcmp ogt double %57, 0.000000e+00
br i1 %58, label %59, label %95
59: ; preds = %54
%60 = load double, double* %5
%61 = fcmp olt double %60, 1.000000e+00
br i1 %61, label %62, label %95
62: ; preds = %59
%63 = load double, double* %6
%64 = fcmp ogt double %63, 0.000000e+00
br i1 %64, label %65, label %91
65: ; preds = %62
%66 = load double, double* %5
%67 = fmul double 0x400921FB54442D18, %66
store double %67, double* %16
%68 = load double, double* %16
%69 = call double @sin(double %68)
%70 = load double, double* %6
%71 = fmul double 2.000000e+00, %70
%72 = fdiv double %69, %71
store double %72, double* %17
%73 = load double, double* %16
%74 = call double @cos(double %73)
store double %74, double* %18
store double 1.000000e+00, double* %19
%75 = load double, double* %18
%76 = fmul double -2.000000e+00, %75
store double %76, double* %20
store double 1.000000e+00, double* %21
%77 = load double, double* %17
%78 = fadd double 1.000000e+00, %77
store double %78, double* %22
%79 = load double, double* %18
%80 = fmul double -2.000000e+00, %79
store double %80, double* %23
%81 = load double, double* %17
%82 = fsub double 1.000000e+00, %81
store double %82, double* %24
%83 = load %struct.biquad*, %struct.biquad** %4
%84 = load double, double* %19
%85 = load double, double* %20
%86 = load double, double* %21
%87 = load double, double* %22
%88 = load double, double* %23
%89 = load double, double* %24
%90 = call i32 (%struct.biquad*, double, double, double, double, double, double, ...) bitcast (i32 (...)* @set_coefficient to i32 (%struct.biquad*, double, double, double, double, double, double, ...)*)(%struct.biquad* %83, double %84, double %85, double %86, double %87, double %88, double %89)
br label %94
91: ; preds = %62
%92 = load %struct.biquad*, %struct.biquad** %4
%93 = call i32 (%struct.biquad*, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @set_coefficient to i32 (%struct.biquad*, i32, i32, i32, i32, i32, i32, ...)*)(%struct.biquad* %92, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0)
br label %94
94: ; preds = %91, %65
br label %98
95: ; preds = %59, %54
%96 = load %struct.biquad*, %struct.biquad** %4
%97 = call i32 (%struct.biquad*, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @set_coefficient to i32 (%struct.biquad*, i32, i32, i32, i32, i32, i32, ...)*)(%struct.biquad* %96, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0)
br label %98
98: ; preds = %95, %94
ret void
}

LLVM IR (-O2):
%struct.biquad = type opaque
define void @biquad_notch(%struct.biquad* %0, double %1, double %2) {
%4 = fcmp olt double %1, 1.000000e+00
%5 = select i1 %4, double %1, double 1.000000e+00
%6 = fcmp olt double %5, 0.000000e+00
%7 = select i1 %6, double 0.000000e+00, double %5
%8 = fcmp olt double %2, 0.000000e+00
%9 = select i1 %8, double 0.000000e+00, double %2
%10 = fcmp ogt double %7, 0.000000e+00
%11 = fcmp olt double %7, 1.000000e+00
%12 = and i1 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %3
%14 = fcmp ogt double %9, 0.000000e+00
br i1 %14, label %15, label %25
15: ; preds = %13
%16 = fmul double %7, 0x400921FB54442D18
%17 = tail call double @sin(double %16)
%18 = fmul double %9, 2.000000e+00
%19 = fdiv double %17, %18
%20 = tail call double @cos(double %16)
%21 = fmul double %20, -2.000000e+00
%22 = fadd double %19, 1.000000e+00
%23 = fsub double 1.000000e+00, %19
%24 = tail call i32 (%struct.biquad*, double, double, double, double, double, double, ...) bitcast (i32 (...)* @set_coefficient to i32 (%struct.biquad*, double, double, double, double, double, double, ...)*)(%struct.biquad* %0, double 1.000000e+00, double %21, double 1.000000e+00, double %22, double %21, double %23)
br label %29
25: ; preds = %13
%26 = tail call i32 (%struct.biquad*, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @set_coefficient to i32 (%struct.biquad*, i32, i32, i32, i32, i32, i32, ...)*)(%struct.biquad* %0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0)
br label %29
27: ; preds = %3
%28 = tail call i32 (%struct.biquad*, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @set_coefficient to i32 (%struct.biquad*, i32, i32, i32, i32, i32, i32, ...)*)(%struct.biquad* %0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0)
br label %29
29: ; preds = %15, %25, %27
ret void
}