void biquad_lowpass(struct biquad *bq, double cutoff, double resonance) {
  cutoff = ({
    __typeof__(0.0) _a = (0.0);
    __typeof__(({
      __typeof__(cutoff) _a = (cutoff);
      __typeof__(1.0) _b = (1.0);
      _a < _b ? _a : _b;
    })) _b = (({
      __typeof__(cutoff) _a = (cutoff);
      __typeof__(1.0) _b = (1.0);
      _a < _b ? _a : _b;
    }));
    _a > _b ? _a : _b;
  });
  if (cutoff == 1) {
    set_coefficient(bq, 1, 0, 0, 1, 0, 0);
  } else if (cutoff > 0) {
    resonance = ({
      __typeof__(0.0) _a = (0.0);
      __typeof__(resonance) _b = (resonance);
      _a > _b ? _a : _b;
    });
    double g = pow(10.0, 0.05 * resonance);
    double d = sqrt((4 - sqrt(16 - 16 / (g * g))) / 2);
    double theta = 3.14159265358979323846 * cutoff;
    double sn = 0.5 * d * sin(theta);
    double beta = 0.5 * (1 - sn) / (1 + sn);
    double gamma = (0.5 + beta) * cos(theta);
    double alpha = 0.25 * (0.5 + beta - gamma);
    double b0 = 2 * alpha;
    double b1 = 2 * 2 * alpha;
    double b2 = 2 * alpha;
    double a1 = 2 * -gamma;
    double a2 = 2 * beta;
    set_coefficient(bq, b0, b1, b2, 1, a1, a2);
  } else {
    set_coefficient(bq, 0, 0, 0, 1, 0, 0);
  }
}


x86 assembly (clang, -O0):
<biquad_lowpass>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%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  0xe7d(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11ae <biquad_lowpass+0x5e>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    11bb <biquad_lowpass+0x6b>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    11f4 <biquad_lowpass+0xa4>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
jmp    1201 <biquad_lowpass+0xb1>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xddb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    125e <biquad_lowpass+0x10e>
jp     125e <biquad_lowpass+0x10e>
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>
jmp    1508 <biquad_lowpass+0x3b8>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    14df <biquad_lowpass+0x38f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    12a4 <biquad_lowpass+0x154>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
jmp    12b1 <biquad_lowpass+0x161>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xd70(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xd5b(%rip),%xmm0
call   1060 <pow@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  0xd37(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xd2b(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xcf7(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xce3(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  0xced(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xcd3(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xe8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xc80(%rip),%xmm1
subsd  -0x80(%rbp),%xmm1
movsd  0xc93(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xc67(%rip),%xmm1
addsd  -0x80(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xc6e(%rip),%xmm0
addsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xc35(%rip),%xmm1
addsd  -0x88(%rbp),%xmm1
ff
subsd  -0x90(%rbp),%xmm1
ff
movsd  0xc15(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xbf1(%rip),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xbe1(%rip),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xbc1(%rip),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xb8a(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xb76(%rip),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x8(%rbp),%rdi
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm1
ff
movsd  -0xb0(%rbp),%xmm2
ff
movsd  -0xb8(%rbp),%xmm3
ff
movsd  -0xc0(%rbp),%xmm4
ff
mov    $0x1,%esi
mov    $0x5,%al
call   1040 <set_coefficient@plt>
jmp    1503 <biquad_lowpass+0x3b3>
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    1508 <biquad_lowpass+0x3b8>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<biquad_lowpass>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
movsd  0xea0(%rip),%xmm4
minsd  %xmm4,%xmm0
xorpd  %xmm2,%xmm2
xorpd  %xmm3,%xmm3
maxsd  %xmm0,%xmm3
ucomisd %xmm4,%xmm3
jne    1189 <biquad_lowpass+0x39>
jp     1189 <biquad_lowpass+0x39>
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    $0x1,%esi
jmp    11f1 <biquad_lowpass+0xa1>
ucomisd %xmm2,%xmm3
jbe    11e5 <biquad_lowpass+0x95>
movsd  %xmm3,0x8(%rsp)
xorpd  %xmm2,%xmm2
maxsd  %xmm1,%xmm2
mulsd  0xe63(%rip),%xmm2
movsd  0xe63(%rip),%xmm0
movapd %xmm2,%xmm1
call   1060 <pow@plt>
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe52(%rip),%xmm0
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
ucomisd 0xe6e(%rip),%xmm0
jb     120b <biquad_lowpass+0xbb>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    1214 <biquad_lowpass+0xc4>
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
call   1070 <sqrt@plt>
movapd %xmm0,%xmm1
movsd  0xe04(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  0xe00(%rip),%xmm0
ucomisd 0xe18(%rip),%xmm0
jb     123b <biquad_lowpass+0xeb>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    1244 <biquad_lowpass+0xf4>
call   1070 <sqrt@plt>
movapd %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xdde(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mulsd  0xdc8(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0xd87(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
movsd  0xd9f(%rip),%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm2
movsd  %xmm2,0x10(%rsp)
addsd  %xmm2,%xmm3
movsd  %xmm3,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <cos@plt>
movapd %xmm0,%xmm3
movsd  0x18(%rsp),%xmm1
mulsd  %xmm1,%xmm3
subsd  %xmm3,%xmm1
mulsd  0xd6e(%rip),%xmm1
movapd %xmm1,%xmm0
mulsd  0xd4a(%rip),%xmm1
mulsd  0xd62(%rip),%xmm3
addsd  %xmm0,%xmm0
movsd  0x10(%rsp),%xmm4
addsd  %xmm4,%xmm4
mov    %rbx,%rdi
movapd %xmm0,%xmm2
mov    $0x1,%esi
mov    $0x5,%al
add    $0x20,%rsp
pop    %rbx
jmp    1040 <set_coefficient@plt>

LLVM IR (-O0):
%struct.biquad = type opaque
define void @biquad_lowpass(%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
%25 = alloca double
%26 = alloca double
%27 = 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
%28 = load double, double* %5
store double %28, double* %9
store double 1.000000e+00, double* %10
%29 = load double, double* %9
%30 = load double, double* %10
%31 = fcmp olt double %29, %30
br i1 %31, label %32, label %34
32: ; preds = %3
%33 = load double, double* %9
br label %36
34: ; preds = %3
%35 = load double, double* %10
br label %36
36: ; preds = %34, %32
%37 = phi double [ %33, %32 ], [ %35, %34 ]
store double %37, double* %11
%38 = load double, double* %11
store double %38, double* %8
%39 = load double, double* %7
%40 = load double, double* %8
%41 = fcmp ogt double %39, %40
br i1 %41, label %42, label %44
42: ; preds = %36
%43 = load double, double* %7
br label %46
44: ; preds = %36
%45 = load double, double* %8
br label %46
46: ; preds = %44, %42
%47 = phi double [ %43, %42 ], [ %45, %44 ]
store double %47, double* %12
%48 = load double, double* %12
store double %48, double* %5
%49 = load double, double* %5
%50 = fcmp oeq double %49, 1.000000e+00
br i1 %50, label %51, label %54
51: ; preds = %46
%52 = load %struct.biquad*, %struct.biquad** %4
%53 = 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* %52, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0)
br label %126
54: ; preds = %46
%55 = load double, double* %5
%56 = fcmp ogt double %55, 0.000000e+00
br i1 %56, label %57, label %122
57: ; preds = %54
store double 0.000000e+00, double* %13
%58 = load double, double* %6
store double %58, double* %14
%59 = load double, double* %13
%60 = load double, double* %14
%61 = fcmp ogt double %59, %60
br i1 %61, label %62, label %64
62: ; preds = %57
%63 = load double, double* %13
br label %66
64: ; preds = %57
%65 = load double, double* %14
br label %66
66: ; preds = %64, %62
%67 = phi double [ %63, %62 ], [ %65, %64 ]
store double %67, double* %15
%68 = load double, double* %15
store double %68, double* %6
%69 = load double, double* %6
%70 = fmul double 5.000000e-02, %69
%71 = call double @pow(double 1.000000e+01, double %70)
store double %71, double* %16
%72 = load double, double* %16
%73 = load double, double* %16
%74 = fmul double %72, %73
%75 = fdiv double 1.600000e+01, %74
%76 = fsub double 1.600000e+01, %75
%77 = call double @sqrt(double %76)
%78 = fsub double 4.000000e+00, %77
%79 = fdiv double %78, 2.000000e+00
%80 = call double @sqrt(double %79)
store double %80, double* %17
%81 = load double, double* %5
%82 = fmul double 0x400921FB54442D18, %81
store double %82, double* %18
%83 = load double, double* %17
%84 = fmul double 5.000000e-01, %83
%85 = load double, double* %18
%86 = call double @sin(double %85)
%87 = fmul double %84, %86
store double %87, double* %19
%88 = load double, double* %19
%89 = fsub double 1.000000e+00, %88
%90 = fmul double 5.000000e-01, %89
%91 = load double, double* %19
%92 = fadd double 1.000000e+00, %91
%93 = fdiv double %90, %92
store double %93, double* %20
%94 = load double, double* %20
%95 = fadd double 5.000000e-01, %94
%96 = load double, double* %18
%97 = call double @cos(double %96)
%98 = fmul double %95, %97
store double %98, double* %21
%99 = load double, double* %20
%100 = fadd double 5.000000e-01, %99
%101 = load double, double* %21
%102 = fsub double %100, %101
%103 = fmul double 2.500000e-01, %102
store double %103, double* %22
%104 = load double, double* %22
%105 = fmul double 2.000000e+00, %104
store double %105, double* %23
%106 = load double, double* %22
%107 = fmul double 4.000000e+00, %106
store double %107, double* %24
%108 = load double, double* %22
%109 = fmul double 2.000000e+00, %108
store double %109, double* %25
%110 = load double, double* %21
%111 = fneg double %110
%112 = fmul double 2.000000e+00, %111
store double %112, double* %26
%113 = load double, double* %20
%114 = fmul double 2.000000e+00, %113
store double %114, double* %27
%115 = load %struct.biquad*, %struct.biquad** %4
%116 = load double, double* %23
%117 = load double, double* %24
%118 = load double, double* %25
%119 = load double, double* %26
%120 = load double, double* %27
%121 = call i32 (%struct.biquad*, double, double, double, i32, double, double, ...) bitcast (i32 (...)* @set_coefficient to i32 (%struct.biquad*, double, double, double, i32, double, double, ...)*)(%struct.biquad* %115, double %116, double %117, double %118, i32 1, double %119, double %120)
br label %125
122: ; preds = %54
%123 = load %struct.biquad*, %struct.biquad** %4
%124 = 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* %123, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0)
br label %125
125: ; preds = %122, %66
br label %126
126: ; preds = %125, %51
ret void
}

LLVM IR (-O2):
%struct.biquad = type opaque
define void @biquad_lowpass(%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 oeq double %7, 1.000000e+00
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = 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 %45
11: ; preds = %3
%12 = fcmp ogt double %7, 0.000000e+00
br i1 %12, label %13, label %43
13: ; preds = %11
%14 = fcmp olt double %2, 0.000000e+00
%15 = select i1 %14, double 0.000000e+00, double %2
%16 = fmul double %15, 5.000000e-02
%17 = tail call double @pow(double 1.000000e+01, double %16)
%18 = fmul double %17, %17
%19 = fdiv double 1.600000e+01, %18
%20 = fsub double 1.600000e+01, %19
%21 = tail call double @sqrt(double %20)
%22 = fsub double 4.000000e+00, %21
%23 = fmul double %22, 5.000000e-01
%24 = tail call double @sqrt(double %23)
%25 = fmul double %7, 0x400921FB54442D18
%26 = fmul double %24, 5.000000e-01
%27 = tail call double @sin(double %25)
%28 = fmul double %26, %27
%29 = fsub double 1.000000e+00, %28
%30 = fmul double %29, 5.000000e-01
%31 = fadd double %28, 1.000000e+00
%32 = fdiv double %30, %31
%33 = fadd double %32, 5.000000e-01
%34 = tail call double @cos(double %25)
%35 = fmul double %34, %33
%36 = fsub double %33, %35
%37 = fmul double %36, 2.500000e-01
%38 = fmul double %37, 2.000000e+00
%39 = fmul double %37, 4.000000e+00
%40 = fmul double %35, -2.000000e+00
%41 = fmul double %32, 2.000000e+00
%42 = tail call i32 (%struct.biquad*, double, double, double, i32, double, double, ...) bitcast (i32 (...)* @set_coefficient to i32 (%struct.biquad*, double, double, double, i32, double, double, ...)*)(%struct.biquad* %0, double %38, double %39, double %38, i32 1, double %40, double %41)
br label %45
43: ; preds = %11
%44 = 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 %45
45: ; preds = %13, %43, %9
ret void
}