#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
float second_order_IIR_direct_form_II_float(float const, float const *,
                                            float const *);
void iir_filter_II_float(const float *input, const float *coeff,
                         const float *gain, const unsigned int N,
                         float *output) {
  unsigned int i;
  for (i = 0; i < N; i++) {
    *(output + i) =
        second_order_IIR_direct_form_II_float(*(input + i), coeff, gain);
  }
}


x86 assembly (clang, -O0):
<iir_filter_II_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jae    1171 <iir_filter_II_float+0x61>
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <second_order_IIR_direct_form_II_float@plt>
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1132 <iir_filter_II_float+0x22>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iir_filter_II_float>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %ecx,%ecx
je     1151 <iir_filter_II_float+0x41>
mov    %r8,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
mov    %ecx,%ebx
xor    %ebp,%ebp
nop
movss  0x0(%r13,%rbp,4),%xmm0
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <second_order_IIR_direct_form_II_float@plt>
movss  %xmm0,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <iir_filter_II_float+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @iir_filter_II_float(float* %0, float* %1, float* %2, i32 %3, float* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
%9 = alloca i32
%10 = alloca float*
%11 = alloca i32
store float* %0, float** %6
store float* %1, float** %7
store float* %2, float** %8
store i32 %3, i32* %9
store float* %4, float** %10
store i32 0, i32* %11
br label %12
12: ; preds = %29, %5
%13 = load i32, i32* %11
%14 = load i32, i32* %9
%15 = icmp ult i32 %13, %14
br i1 %15, label %16, label %32
16: ; preds = %12
%17 = load float*, float** %6
%18 = load i32, i32* %11
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds float, float* %17, i64 %19
%21 = load float, float* %20
%22 = load float*, float** %7
%23 = load float*, float** %8
%24 = call float @second_order_IIR_direct_form_II_float(float %21, float* %22, float* %23)
%25 = load float*, float** %10
%26 = load i32, i32* %11
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds float, float* %25, i64 %27
store float %24, float* %28
br label %29
29: ; preds = %16
%30 = load i32, i32* %11
%31 = add i32 %30, 1
store i32 %31, i32* %11
br label %12
32: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @iir_filter_II_float(float* nocapture %0, float* %1, float* %2, i32 %3, float* nocapture writeonly %4) {
%6 = icmp eq i32 %3, 0
br i1 %6, label %17, label %7
7: ; preds = %5
%8 = zext i32 %3 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %15, %9 ]
%11 = getelementptr inbounds float, float* %0, i64 %10
%12 = load float, float* %11
%13 = tail call float @second_order_IIR_direct_form_II_float(float %12, float* %1, float* %2)
%14 = getelementptr inbounds float, float* %4, i64 %10
store float %13, float* %14
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %8
br i1 %16, label %17, label %9
17: ; preds = %9, %5
ret void
}