double deemph_iir(int i, double NewSample) {
  double ACoef[2 + 1] = {0.46035077886318842566, -0.28440821191249848754,
                         0.03388877229118691936};
  double BCoef[2 + 1] = {1.00000000000000000000, -1.05429146278569141337,
                         0.26412280202756849290};
  static double y[2][2 + 1];
  static double x[2][2 + 1];
  int n;
  for (n = 2; n > 0; n--) {
    x[i][n] = x[i][n - 1];
    y[i][n] = y[i][n - 1];
  }
  x[i][0] = NewSample;
  y[i][0] = ACoef[0] * x[i][0];
  for (n = 1; n <= 2; n++)
    y[i][0] += ACoef[n] * x[i][n] - BCoef[n] * y[i][n];
  return y[i][0];
}


x86 assembly (clang, -O0):
<deemph_iir>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    0xeed(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeea(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xee7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xee9(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xee6(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0x2,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
jle    11e3 <deemph_iir+0xe3>
movslq -0x4(%rbp),%rcx
lea    0x2ef6(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x4(%rbp),%rcx
lea    0x2ed6(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movslq -0x4(%rbp),%rcx
lea    0x2e8b(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x4(%rbp),%rcx
lea    0x2e6b(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x54(%rbp)
jmp    1155 <deemph_iir+0x55>
movsd  -0x10(%rbp),%xmm0
movslq -0x4(%rbp),%rcx
lea    0x2e6d(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
movslq -0x4(%rbp),%rcx
lea    0x2e52(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mulsd  (%rax),%xmm0
movslq -0x4(%rbp),%rcx
lea    0x2e0c(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x54(%rbp)
cmpl   $0x2,-0x54(%rbp)
jg     12d1 <deemph_iir+0x1d1>
movslq -0x54(%rbp),%rax
movsd  -0x30(%rbp,%rax,8),%xmm0
movslq -0x4(%rbp),%rcx
lea    0x2e0b(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movslq -0x54(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm1
movslq -0x4(%rbp),%rcx
lea    0x2db6(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x54(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0x4(%rbp),%rcx
lea    0x2d7c(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1236 <deemph_iir+0x136>
movslq -0x4(%rbp),%rcx
lea    0x2d54(%rip),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deemph_iir>:
movslq %edi,%rax
shl    $0x3,%rax
lea    (%rax,%rax,2),%rax
lea    0x2f4e(%rip),%rcx
lea    0x2f17(%rip),%rdx
movupd (%rcx,%rax,1),%xmm1
movupd %xmm1,0x8(%rcx,%rax,1)
movupd (%rdx,%rax,1),%xmm2
movsd  %xmm0,(%rcx,%rax,1)
mulsd  0xeca(%rip),%xmm0
movupd %xmm2,0x8(%rdx,%rax,1)
movsd  0xec4(%rip),%xmm3
mulsd  %xmm2,%xmm3
movsd  0xec0(%rip),%xmm4
mulsd  %xmm1,%xmm4
unpckhpd %xmm2,%xmm2
mulsd  0xeb8(%rip),%xmm2
addsd  %xmm3,%xmm4
unpckhpd %xmm1,%xmm1
mulsd  0xeb0(%rip),%xmm1
addsd  %xmm4,%xmm0
addsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx,%rax,1)
ret

LLVM IR (-O0):
@__const.deemph_iir.ACoef = [3 x double] [double 0x3FDD76631CF9F414, double 0xBFD233BE80383175, double 0x3FA159DE81626D20]
@__const.deemph_iir.BCoef = [3 x double] [double 1.000000e+00, double 0xBFF0DE60B991DD5F, double 0x3FD0E763533585C3]
@deemph_iir.y = internal global [2 x [3 x double]] zeroinitializer
@deemph_iir.x = internal global [2 x [3 x double]] zeroinitializer
define double @deemph_iir(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca [3 x double]
%6 = alloca [3 x double]
%7 = alloca i32
store i32 %0, i32* %3
store double %1, double* %4
%8 = bitcast [3 x double]* %5 to i8*
%9 = bitcast [3 x double]* %6 to i8*
store i32 2, i32* %7
br label %10
10: ; preds = %42, %2
%11 = load i32, i32* %7
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %45
13: ; preds = %10
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* @deemph_iir.x, i64 0, i64 %15
%17 = load i32, i32* %7
%18 = sub nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [3 x double], [3 x double]* %16, i64 0, i64 %19
%21 = load double, double* %20
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* @deemph_iir.x, i64 0, i64 %23
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [3 x double], [3 x double]* %24, i64 0, i64 %26
store double %21, double* %27
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* @deemph_iir.y, i64 0, i64 %29
%31 = load i32, i32* %7
%32 = sub nsw i32 %31, 1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [3 x double], [3 x double]* %30, i64 0, i64 %33
%35 = load double, double* %34
%36 = load i32, i32* %3
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* @deemph_iir.y, i64 0, i64 %37
%39 = load i32, i32* %7
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [3 x double], [3 x double]* %38, i64 0, i64 %40
store double %35, double* %41
br label %42
42: ; preds = %13
%43 = load i32, i32* %7
%44 = add nsw i32 %43, -1
store i32 %44, i32* %7
br label %10
45: ; preds = %10
%46 = load double, double* %4
%47 = load i32, i32* %3
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* @deemph_iir.x, i64 0, i64 %48
%50 = getelementptr inbounds [3 x double], [3 x double]* %49, i64 0, i64 0
store double %46, double* %50
%51 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%52 = load double, double* %51
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* @deemph_iir.x, i64 0, i64 %54
%56 = getelementptr inbounds [3 x double], [3 x double]* %55, i64 0, i64 0
%57 = load double, double* %56
%58 = fmul double %52, %57
%59 = load i32, i32* %3
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* @deemph_iir.y, i64 0, i64 %60
%62 = getelementptr inbounds [3 x double], [3 x double]* %61, i64 0, i64 0
store double %58, double* %62
store i32 1, i32* %7
br label %63
63: ; preds = %98, %45
%64 = load i32, i32* %7
%65 = icmp sle i32 %64, 2
br i1 %65, label %66, label %101
66: ; preds = %63
%67 = load i32, i32* %7
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 %68
%70 = load double, double* %69
%71 = load i32, i32* %3
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* @deemph_iir.x, i64 0, i64 %72
%74 = load i32, i32* %7
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [3 x double], [3 x double]* %73, i64 0, i64 %75
%77 = load double, double* %76
%78 = load i32, i32* %7
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 %79
%81 = load double, double* %80
%82 = load i32, i32* %3
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* @deemph_iir.y, i64 0, i64 %83
%85 = load i32, i32* %7
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [3 x double], [3 x double]* %84, i64 0, i64 %86
%88 = load double, double* %87
%89 = fmul double %81, %88
%90 = fneg double %89
%91 = call double @llvm.fmuladd.f64(double %70, double %77, double %90)
%92 = load i32, i32* %3
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* @deemph_iir.y, i64 0, i64 %93
%95 = getelementptr inbounds [3 x double], [3 x double]* %94, i64 0, i64 0
%96 = load double, double* %95
%97 = fadd double %96, %91
store double %97, double* %95
br label %98
98: ; preds = %66
%99 = load i32, i32* %7
%100 = add nsw i32 %99, 1
store i32 %100, i32* %7
br label %63
101: ; preds = %63
%102 = load i32, i32* %3
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* @deemph_iir.y, i64 0, i64 %103
%105 = getelementptr inbounds [3 x double], [3 x double]* %104, i64 0, i64 0
%106 = load double, double* %105
ret double %106
}

LLVM IR (-O2):
@deemph_iir.y = internal unnamed_addr global [2 x [3 x double]] zeroinitializer
@deemph_iir.x = internal unnamed_addr global [2 x [3 x double]] zeroinitializer
define double @deemph_iir(i32 %0, double %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* @deemph_iir.x, i64 0, i64 %3, i64 1
%5 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* @deemph_iir.y, i64 0, i64 %3, i64 1
%6 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* @deemph_iir.x, i64 0, i64 %3, i64 0
%7 = bitcast double* %6 to <2 x double>*
%8 = load <2 x double>, <2 x double>* %7
%9 = bitcast double* %4 to <2 x double>*
store <2 x double> %8, <2 x double>* %9
%10 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* @deemph_iir.y, i64 0, i64 %3, i64 0
%11 = bitcast double* %10 to <2 x double>*
%12 = load <2 x double>, <2 x double>* %11
%13 = bitcast double* %5 to <2 x double>*
store <2 x double> %12, <2 x double>* %13
store double %1, double* %6
%14 = fmul double %1, 0x3FDD76631CF9F414
%15 = extractelement <2 x double> %12, i64 0
%16 = fmul double %15, 0x3FF0DE60B991DD5F
%17 = extractelement <2 x double> %8, i64 0
%18 = tail call double @llvm.fmuladd.f64(double %17, double 0xBFD233BE80383175, double %16)
%19 = fadd double %14, %18
%20 = extractelement <2 x double> %12, i64 1
%21 = fmul double %20, 0xBFD0E763533585C3
%22 = extractelement <2 x double> %8, i64 1
%23 = tail call double @llvm.fmuladd.f64(double %22, double 0x3FA159DE81626D20, double %21)
%24 = fadd double %19, %23
store double %24, double* %10
ret double %24
}