float adgold_pseudo_stereo_iir(float NewSample) {
  float ACoef[2 + 1] = {0.00001409030866231767, 0.00002818061732463533,
                        0.00001409030866231767};
  float BCoef[2 + 1] = {1.00000000000000000000, -1.98733021473466760000,
                        0.98738361004063568000};
  static float y[2 + 1];
  static float x[2 + 1];
  int n;
  for (n = 2; n > 0; n--) {
    x[n] = x[n - 1];
    y[n] = y[n - 1];
  }
  x[0] = NewSample;
  y[0] = ACoef[0] * x[0];
  for (n = 1; n <= 2; n++)
    y[0] += ACoef[n] * x[n] - BCoef[n] * y[n];
  return y[0];
}


x86 assembly (clang, -O0):
<adgold_pseudo_stereo_iir>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    0xef0(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeee(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xee6(%rip),%eax
mov    %eax,-0x14(%rbp)
movl   $0x2,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jle    119a <adgold_pseudo_stereo_iir+0x9a>
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2ede(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
movslq -0x20(%rbp),%rcx
lea    0x2ece(%rip),%rax
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2ead(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
movslq -0x20(%rbp),%rcx
lea    0x2e9d(%rip),%rax
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1138 <adgold_pseudo_stereo_iir+0x38>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,0x2e89(%rip)
movss  -0x10(%rbp),%xmm0
mulss  0x2e7c(%rip),%xmm0
movss  %xmm0,0x2e68(%rip)
movl   $0x1,-0x20(%rbp)
cmpl   $0x2,-0x20(%rbp)
jg     1234 <adgold_pseudo_stereo_iir+0x134>
movslq -0x20(%rbp),%rax
movss  -0x10(%rbp,%rax,4),%xmm0
movslq -0x20(%rbp),%rcx
lea    0x2e4e(%rip),%rax
movss  (%rax,%rcx,4),%xmm2
movslq -0x20(%rbp),%rax
movss  -0x1c(%rbp,%rax,4),%xmm1
movslq -0x20(%rbp),%rcx
lea    0x2e28(%rip),%rax
mulss  (%rax,%rcx,4),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
addss  0x2e06(%rip),%xmm0
movss  %xmm0,0x2dfe(%rip)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11c3 <adgold_pseudo_stereo_iir+0xc3>
movss  0x2de8(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<adgold_pseudo_stereo_iir>:
mov    0x2f31(%rip),%rax
mov    %rax,0x2f2e(%rip)
mov    0x2f13(%rip),%rax
mov    %rax,0x2f10(%rip)
movss  %xmm0,0x2f14(%rip)
movss  0xed4(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0x2f04(%rip),%xmm2
movss  0x2eec(%rip),%xmm3
mulss  0xebc(%rip),%xmm3
mulss  0xeb8(%rip),%xmm2
addss  %xmm3,%xmm2
movss  0x2ed4(%rip),%xmm3
mulss  0xea8(%rip),%xmm3
mulss  0x2ed4(%rip),%xmm1
addss  %xmm2,%xmm0
addss  %xmm3,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,0x2ea8(%rip)
ret

LLVM IR (-O0):
@__const.adgold_pseudo_stereo_iir.ACoef = [3 x float] [float 0x3EED8CAD40000000, float 0x3EFD8CAD40000000, float 0x3EED8CAD40000000]
@__const.adgold_pseudo_stereo_iir.BCoef = [3 x float] [float 1.000000e+00, float 0xBFFFCC1AC0000000, float 0x3FEF98A580000000]
@adgold_pseudo_stereo_iir.y = internal global [3 x float] zeroinitializer
@adgold_pseudo_stereo_iir.x = internal global [3 x float] zeroinitializer
define float @adgold_pseudo_stereo_iir(float %0) {
%2 = alloca float
%3 = alloca [3 x float]
%4 = alloca [3 x float]
%5 = alloca i32
store float %0, float* %2
%6 = bitcast [3 x float]* %3 to i8*
%7 = bitcast [3 x float]* %4 to i8*
store i32 2, i32* %5
br label %8
8: ; preds = %28, %1
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %31
11: ; preds = %8
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [3 x float], [3 x float]* @adgold_pseudo_stereo_iir.x, i64 0, i64 %14
%16 = load float, float* %15
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [3 x float], [3 x float]* @adgold_pseudo_stereo_iir.x, i64 0, i64 %18
store float %16, float* %19
%20 = load i32, i32* %5
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [3 x float], [3 x float]* @adgold_pseudo_stereo_iir.y, i64 0, i64 %22
%24 = load float, float* %23
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [3 x float], [3 x float]* @adgold_pseudo_stereo_iir.y, i64 0, i64 %26
store float %24, float* %27
br label %28
28: ; preds = %11
%29 = load i32, i32* %5
%30 = add nsw i32 %29, -1
store i32 %30, i32* %5
br label %8
31: ; preds = %8
%32 = load float, float* %2
store float %32, float* getelementptr inbounds ([3 x float], [3 x float]* @adgold_pseudo_stereo_iir.x, i64 0, i64 0)
%33 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%34 = load float, float* %33
%35 = load float, float* getelementptr inbounds ([3 x float], [3 x float]* @adgold_pseudo_stereo_iir.x, i64 0, i64 0)
%36 = fmul float %34, %35
store float %36, float* getelementptr inbounds ([3 x float], [3 x float]* @adgold_pseudo_stereo_iir.y, i64 0, i64 0)
store i32 1, i32* %5
br label %37
37: ; preds = %62, %31
%38 = load i32, i32* %5
%39 = icmp sle i32 %38, 2
br i1 %39, label %40, label %65
40: ; preds = %37
%41 = load i32, i32* %5
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 %42
%44 = load float, float* %43
%45 = load i32, i32* %5
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [3 x float], [3 x float]* @adgold_pseudo_stereo_iir.x, i64 0, i64 %46
%48 = load float, float* %47
%49 = load i32, i32* %5
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 %50
%52 = load float, float* %51
%53 = load i32, i32* %5
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [3 x float], [3 x float]* @adgold_pseudo_stereo_iir.y, i64 0, i64 %54
%56 = load float, float* %55
%57 = fmul float %52, %56
%58 = fneg float %57
%59 = call float @llvm.fmuladd.f32(float %44, float %48, float %58)
%60 = load float, float* getelementptr inbounds ([3 x float], [3 x float]* @adgold_pseudo_stereo_iir.y, i64 0, i64 0)
%61 = fadd float %60, %59
store float %61, float* getelementptr inbounds ([3 x float], [3 x float]* @adgold_pseudo_stereo_iir.y, i64 0, i64 0)
br label %62
62: ; preds = %40
%63 = load i32, i32* %5
%64 = add nsw i32 %63, 1
store i32 %64, i32* %5
br label %37
65: ; preds = %37
%66 = load float, float* getelementptr inbounds ([3 x float], [3 x float]* @adgold_pseudo_stereo_iir.y, i64 0, i64 0)
ret float %66
}

LLVM IR (-O2):
@adgold_pseudo_stereo_iir.y = internal unnamed_addr global [3 x float] zeroinitializer
@adgold_pseudo_stereo_iir.x = internal unnamed_addr global [3 x float] zeroinitializer
define float @adgold_pseudo_stereo_iir(float %0) {
%2 = load i64, i64* bitcast ([3 x float]* @adgold_pseudo_stereo_iir.x to i64*)
store i64 %2, i64* bitcast (float* getelementptr inbounds ([3 x float], [3 x float]* @adgold_pseudo_stereo_iir.x, i64 0, i64 1) to i64*)
%3 = load i64, i64* bitcast ([3 x float]* @adgold_pseudo_stereo_iir.y to i64*)
store i64 %3, i64* bitcast (float* getelementptr inbounds ([3 x float], [3 x float]* @adgold_pseudo_stereo_iir.y, i64 0, i64 1) to i64*)
store float %0, float* getelementptr inbounds ([3 x float], [3 x float]* @adgold_pseudo_stereo_iir.x, i64 0, i64 0)
%4 = fmul float %0, 0x3EED8CAD40000000
%5 = load float, float* getelementptr inbounds ([3 x float], [3 x float]* @adgold_pseudo_stereo_iir.x, i64 0, i64 1)
%6 = load float, float* getelementptr inbounds ([3 x float], [3 x float]* @adgold_pseudo_stereo_iir.y, i64 0, i64 1)
%7 = fmul float %6, 0x3FFFCC1AC0000000
%8 = tail call float @llvm.fmuladd.f32(float %5, float 0x3EFD8CAD40000000, float %7)
%9 = fadd float %4, %8
%10 = load float, float* getelementptr inbounds ([3 x float], [3 x float]* @adgold_pseudo_stereo_iir.x, i64 0, i64 2)
%11 = load float, float* getelementptr inbounds ([3 x float], [3 x float]* @adgold_pseudo_stereo_iir.y, i64 0, i64 2)
%12 = fmul float %11, 0xBFEF98A580000000
%13 = tail call float @llvm.fmuladd.f32(float %10, float 0x3EED8CAD40000000, float %12)
%14 = fadd float %9, %13
store float %14, float* getelementptr inbounds ([3 x float], [3 x float]* @adgold_pseudo_stereo_iir.y, i64 0, i64 0)
ret float %14
}