float second_order_IIR_direct_form_II_float(const float input,
                                            const float *coeff,
                                            const float *gain) {
  float temp;
  static float delay[3] = {0.0};
  temp = input * gain[0];
  delay[0] = temp;
  temp = (coeff[3] * delay[0]);
  temp -= (coeff[4] * delay[1]);
  temp -= (coeff[5] * delay[2]);
  delay[0] = temp;
  temp = (coeff[0] * delay[0]);
  temp += (coeff[1] * delay[1]);
  temp += (coeff[2] * delay[2]);
  delay[2] = delay[1];
  delay[1] = delay[0];
  return (temp * gain[1]);
}


x86 assembly (clang, -O0):
<second_order_IIR_direct_form_II_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,0x2ef4(%rip)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
mulss  0x2ee3(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movss  0x10(%rax),%xmm0
movss  0x2ed1(%rip),%xmm2
movss  -0x1c(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movss  0x14(%rax),%xmm0
movss  0x2ea5(%rip),%xmm2
movss  -0x1c(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,0x2e71(%rip)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mulss  0x2e61(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  0x2e4f(%rip),%xmm2
movss  -0x1c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  0x2e30(%rip),%xmm2
movss  -0x1c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0x2e12(%rip),%xmm0
movss  %xmm0,0x2e0e(%rip)
movss  0x2dfe(%rip),%xmm0
movss  %xmm0,0x2dfa(%rip)
movss  -0x1c(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mulss  0x4(%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<second_order_IIR_direct_form_II_float>:
mulss  (%rsi),%xmm0
mulss  0xc(%rdi),%xmm0
movss  0x2f13(%rip),%xmm2
movss  0x10(%rdi),%xmm1
mulss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  0x2f02(%rip),%xmm1
movss  0x14(%rdi),%xmm3
mulss  %xmm1,%xmm3
subss  %xmm3,%xmm0
movss  (%rdi),%xmm3
mulss  %xmm0,%xmm3
movss  0x4(%rdi),%xmm4
mulss  %xmm2,%xmm4
addss  %xmm3,%xmm4
mulss  0x8(%rdi),%xmm1
addss  %xmm4,%xmm1
movss  %xmm2,0x2ecf(%rip)
movss  %xmm0,0x2ec3(%rip)
mulss  0x4(%rsi),%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
@second_order_IIR_direct_form_II_float.delay = internal global [3 x float] zeroinitializer
define float @second_order_IIR_direct_form_II_float(float %0, float* %1, float* %2) {
%4 = alloca float
%5 = alloca float*
%6 = alloca float*
%7 = alloca float
store float %0, float* %4
store float* %1, float** %5
store float* %2, float** %6
%8 = load float, float* %4
%9 = load float*, float** %6
%10 = getelementptr inbounds float, float* %9, i64 0
%11 = load float, float* %10
%12 = fmul float %8, %11
store float %12, float* %7
%13 = load float, float* %7
store float %13, float* getelementptr inbounds ([3 x float], [3 x float]* @second_order_IIR_direct_form_II_float.delay, i64 0, i64 0)
%14 = load float*, float** %5
%15 = getelementptr inbounds float, float* %14, i64 3
%16 = load float, float* %15
%17 = load float, float* getelementptr inbounds ([3 x float], [3 x float]* @second_order_IIR_direct_form_II_float.delay, i64 0, i64 0)
%18 = fmul float %16, %17
store float %18, float* %7
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 4
%21 = load float, float* %20
%22 = load float, float* getelementptr inbounds ([3 x float], [3 x float]* @second_order_IIR_direct_form_II_float.delay, i64 0, i64 1)
%23 = load float, float* %7
%24 = fneg float %21
%25 = call float @llvm.fmuladd.f32(float %24, float %22, float %23)
store float %25, float* %7
%26 = load float*, float** %5
%27 = getelementptr inbounds float, float* %26, i64 5
%28 = load float, float* %27
%29 = load float, float* getelementptr inbounds ([3 x float], [3 x float]* @second_order_IIR_direct_form_II_float.delay, i64 0, i64 2)
%30 = load float, float* %7
%31 = fneg float %28
%32 = call float @llvm.fmuladd.f32(float %31, float %29, float %30)
store float %32, float* %7
%33 = load float, float* %7
store float %33, float* getelementptr inbounds ([3 x float], [3 x float]* @second_order_IIR_direct_form_II_float.delay, i64 0, i64 0)
%34 = load float*, float** %5
%35 = getelementptr inbounds float, float* %34, i64 0
%36 = load float, float* %35
%37 = load float, float* getelementptr inbounds ([3 x float], [3 x float]* @second_order_IIR_direct_form_II_float.delay, i64 0, i64 0)
%38 = fmul float %36, %37
store float %38, float* %7
%39 = load float*, float** %5
%40 = getelementptr inbounds float, float* %39, i64 1
%41 = load float, float* %40
%42 = load float, float* getelementptr inbounds ([3 x float], [3 x float]* @second_order_IIR_direct_form_II_float.delay, i64 0, i64 1)
%43 = load float, float* %7
%44 = call float @llvm.fmuladd.f32(float %41, float %42, float %43)
store float %44, float* %7
%45 = load float*, float** %5
%46 = getelementptr inbounds float, float* %45, i64 2
%47 = load float, float* %46
%48 = load float, float* getelementptr inbounds ([3 x float], [3 x float]* @second_order_IIR_direct_form_II_float.delay, i64 0, i64 2)
%49 = load float, float* %7
%50 = call float @llvm.fmuladd.f32(float %47, float %48, float %49)
store float %50, float* %7
%51 = load float, float* getelementptr inbounds ([3 x float], [3 x float]* @second_order_IIR_direct_form_II_float.delay, i64 0, i64 1)
store float %51, float* getelementptr inbounds ([3 x float], [3 x float]* @second_order_IIR_direct_form_II_float.delay, i64 0, i64 2)
%52 = load float, float* getelementptr inbounds ([3 x float], [3 x float]* @second_order_IIR_direct_form_II_float.delay, i64 0, i64 0)
store float %52, float* getelementptr inbounds ([3 x float], [3 x float]* @second_order_IIR_direct_form_II_float.delay, i64 0, i64 1)
%53 = load float, float* %7
%54 = load float*, float** %6
%55 = getelementptr inbounds float, float* %54, i64 1
%56 = load float, float* %55
%57 = fmul float %53, %56
ret float %57
}

LLVM IR (-O2):
@second_order_IIR_direct_form_II_float.delay.1 = internal unnamed_addr global float 0.000000e+00
@second_order_IIR_direct_form_II_float.delay.2 = internal unnamed_addr global float 0.000000e+00
define float @second_order_IIR_direct_form_II_float(float %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %2
%5 = fmul float %4, %0
%6 = getelementptr inbounds float, float* %1, i64 3
%7 = load float, float* %6
%8 = fmul float %5, %7
%9 = getelementptr inbounds float, float* %1, i64 4
%10 = load float, float* %9
%11 = load float, float* @second_order_IIR_direct_form_II_float.delay.1
%12 = fneg float %10
%13 = tail call float @llvm.fmuladd.f32(float %12, float %11, float %8)
%14 = getelementptr inbounds float, float* %1, i64 5
%15 = load float, float* %14
%16 = load float, float* @second_order_IIR_direct_form_II_float.delay.2
%17 = fneg float %15
%18 = tail call float @llvm.fmuladd.f32(float %17, float %16, float %13)
%19 = load float, float* %1
%20 = fmul float %18, %19
%21 = getelementptr inbounds float, float* %1, i64 1
%22 = load float, float* %21
%23 = tail call float @llvm.fmuladd.f32(float %22, float %11, float %20)
%24 = getelementptr inbounds float, float* %1, i64 2
%25 = load float, float* %24
%26 = tail call float @llvm.fmuladd.f32(float %25, float %16, float %23)
store float %11, float* @second_order_IIR_direct_form_II_float.delay.2
store float %18, float* @second_order_IIR_direct_form_II_float.delay.1
%27 = getelementptr inbounds float, float* %2, i64 1
%28 = load float, float* %27
%29 = fmul float %26, %28
ret float %29
}