#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 */
double ZeroPoleFilter(double *, double *, int, double);
void sms_filterHighPass(int sizeResidual, double *pResidual,
                        int iSamplingRate) {
  static double pFCoeff32k[10] = {0.814255, -3.25702, 4.88553,  -3.25702,
                                  0.814255, 1,        -3.58973, 4.85128,
                                  -2.92405, 0.66301};
  static double pFCoeff36k[10] = {0.833098, -3.33239, 4.99859,  -3.33239,
                                  0.833098, 1,        -3.63528, 4.97089,
                                  -3.02934, 0.694052};
  static double pFCoeff40k[10] = {0.848475, -3.3939, 5.09085,  -3.3939,
                                  0.848475, 1,       -3.67173, 5.068,
                                  -3.11597, 0.71991};
  static double pFCoeff441k[10] = {0.861554, -3.44622, 5.16932,  -3.44622,
                                   0.861554, 1,        -3.70223, 5.15023,
                                   -3.19013, 0.742275};
  static double pFCoeff48k[10] = {0.872061, -3.48824, 5.23236,  -3.48824,
                                  0.872061, 1,        -3.72641, 5.21605,
                                  -3.25002, 0.76049};
  double *pFCoeff, fSample = 0;
  int i;
  if (iSamplingRate <= 32000)
    pFCoeff = pFCoeff32k;
  else if (iSamplingRate <= 36000)
    pFCoeff = pFCoeff36k;
  else if (iSamplingRate <= 40000)
    pFCoeff = pFCoeff40k;
  else if (iSamplingRate <= 44100)
    pFCoeff = pFCoeff441k;
  else
    pFCoeff = pFCoeff48k;
  for (i = 0; i < sizeResidual; i++) {
    if (i > 0 && fSample == 0 && pResidual[i] == 0)
      return;
    fSample = pResidual[i];
    pResidual[i] = ZeroPoleFilter(&pFCoeff[0], &pFCoeff[5], 5, fSample);
  }
}


x86 assembly (clang, -O0):
<sms_filterHighPass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
cmpl   $0x7d00,-0x14(%rbp)
jg     1147 <sms_filterHighPass+0x37>
lea    0x2ef2(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11b8 <sms_filterHighPass+0xa8>
cmpl   $0x8ca0,-0x14(%rbp)
jg     1164 <sms_filterHighPass+0x54>
lea    0x2f25(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11b3 <sms_filterHighPass+0xa3>
cmpl   $0x9c40,-0x14(%rbp)
jg     1181 <sms_filterHighPass+0x71>
lea    0x2f58(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11ae <sms_filterHighPass+0x9e>
cmpl   $0xac44,-0x14(%rbp)
jg     119e <sms_filterHighPass+0x8e>
lea    0x2f8b(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11a9 <sms_filterHighPass+0x99>
lea    0x2fcb(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11ae <sms_filterHighPass+0x9e>
jmp    11b3 <sms_filterHighPass+0xa3>
jmp    11b8 <sms_filterHighPass+0xa8>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    125a <sms_filterHighPass+0x14a>
cmpl   $0x0,-0x2c(%rbp)
jle    1212 <sms_filterHighPass+0x102>
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1212 <sms_filterHighPass+0x102>
jp     1212 <sms_filterHighPass+0x102>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1212 <sms_filterHighPass+0x102>
jp     1212 <sms_filterHighPass+0x102>
jmp    125a <sms_filterHighPass+0x14a>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x28,%rsi
movsd  -0x28(%rbp),%xmm0
mov    $0x5,%edx
call   1030 <ZeroPoleFilter@plt>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11bf <sms_filterHighPass+0xaf>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sms_filterHighPass>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r13
cmp    $0x7d01,%edx
jge    1138 <sms_filterHighPass+0x28>
lea    0x2f01(%rip),%r14
test   %edi,%edi
jg     1184 <sms_filterHighPass+0x74>
jmp    11f6 <sms_filterHighPass+0xe6>
cmp    $0x8ca1,%edx
jae    1150 <sms_filterHighPass+0x40>
lea    0x2f39(%rip),%r14
test   %edi,%edi
jg     1184 <sms_filterHighPass+0x74>
jmp    11f6 <sms_filterHighPass+0xe6>
cmp    $0x9c41,%edx
jae    1168 <sms_filterHighPass+0x58>
lea    0x2f71(%rip),%r14
test   %edi,%edi
jg     1184 <sms_filterHighPass+0x74>
jmp    11f6 <sms_filterHighPass+0xe6>
cmp    $0xac45,%edx
lea    0x2fab(%rip),%rax
lea    0x2ff4(%rip),%r14
cmovb  %rax,%r14
test   %edi,%edi
jle    11f6 <sms_filterHighPass+0xe6>
lea    0x28(%r14),%r15
mov    %edi,%r12d
xor    %ebx,%ebx
xorpd  %xmm0,%xmm0
jmp    11d2 <sms_filterHighPass+0xc2>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x5,%edx
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <ZeroPoleFilter@plt>
movsd  %xmm0,0x0(%r13,%rbx,8)
movsd  0x8(%rsp),%xmm0
add    $0x1,%rbx
cmp    %rbx,%r12
je     11f6 <sms_filterHighPass+0xe6>
ucomisd 0xe26(%rip),%xmm0
movsd  0x0(%r13,%rbx,8),%xmm0
jne    11a0 <sms_filterHighPass+0x90>
jp     11a0 <sms_filterHighPass+0x90>
test   %rbx,%rbx
je     11a0 <sms_filterHighPass+0x90>
ucomisd 0xe0e(%rip),%xmm0
jne    11a0 <sms_filterHighPass+0x90>
jp     11a0 <sms_filterHighPass+0x90>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@sms_filterHighPass.pFCoeff32k = internal global [10 x double] [double 0x3FEA0E60807357E6, double -3.257020e+00, double 4.885530e+00, double -3.257020e+00, double 0x3FEA0E60807357E6, double 1.000000e+00, double -3.589730e+00, double 4.851280e+00, double -2.924050e+00, double 6.630100e-01]
@sms_filterHighPass.pFCoeff36k = internal global [10 x double] [double 8.330980e-01, double -3.332390e+00, double 4.998590e+00, double -3.332390e+00, double 8.330980e-01, double 1.000000e+00, double -3.635280e+00, double 4.970890e+00, double -3.029340e+00, double 6.940520e-01]
@sms_filterHighPass.pFCoeff40k = internal global [10 x double] [double 8.484750e-01, double -3.393900e+00, double 5.090850e+00, double -3.393900e+00, double 8.484750e-01, double 1.000000e+00, double -3.671730e+00, double 5.068000e+00, double -3.115970e+00, double 7.199100e-01]
@sms_filterHighPass.pFCoeff441k = internal global [10 x double] [double 8.615540e-01, double -3.446220e+00, double 5.169320e+00, double -3.446220e+00, double 8.615540e-01, double 1.000000e+00, double -3.702230e+00, double 5.150230e+00, double -3.190130e+00, double 7.422750e-01]
@sms_filterHighPass.pFCoeff48k = internal global [10 x double] [double 0x3FEBE7EC7863BEEC, double -3.488240e+00, double 5.232360e+00, double -3.488240e+00, double 0x3FEBE7EC7863BEEC, double 1.000000e+00, double -3.726410e+00, double 5.216050e+00, double -3.250020e+00, double 7.604900e-01]
define void @sms_filterHighPass(i32 %0, double* %1, i32 %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca i32
%7 = alloca double*
%8 = alloca double
%9 = alloca i32
store i32 %0, i32* %4
store double* %1, double** %5
store i32 %2, i32* %6
store double 0.000000e+00, double* %8
%10 = load i32, i32* %6
%11 = icmp sle i32 %10, 32000
br i1 %11, label %12, label %13
12: ; preds = %3
store double* getelementptr inbounds ([10 x double], [10 x double]* @sms_filterHighPass.pFCoeff32k, i64 0, i64 0), double** %7
br label %29
13: ; preds = %3
%14 = load i32, i32* %6
%15 = icmp sle i32 %14, 36000
br i1 %15, label %16, label %17
16: ; preds = %13
store double* getelementptr inbounds ([10 x double], [10 x double]* @sms_filterHighPass.pFCoeff36k, i64 0, i64 0), double** %7
br label %28
17: ; preds = %13
%18 = load i32, i32* %6
%19 = icmp sle i32 %18, 40000
br i1 %19, label %20, label %21
20: ; preds = %17
store double* getelementptr inbounds ([10 x double], [10 x double]* @sms_filterHighPass.pFCoeff40k, i64 0, i64 0), double** %7
br label %27
21: ; preds = %17
%22 = load i32, i32* %6
%23 = icmp sle i32 %22, 44100
br i1 %23, label %24, label %25
24: ; preds = %21
store double* getelementptr inbounds ([10 x double], [10 x double]* @sms_filterHighPass.pFCoeff441k, i64 0, i64 0), double** %7
br label %26
25: ; preds = %21
store double* getelementptr inbounds ([10 x double], [10 x double]* @sms_filterHighPass.pFCoeff48k, i64 0, i64 0), double** %7
br label %26
26: ; preds = %25, %24
br label %27
27: ; preds = %26, %20
br label %28
28: ; preds = %27, %16
br label %29
29: ; preds = %28, %12
store i32 0, i32* %9
br label %30
30: ; preds = %64, %29
%31 = load i32, i32* %9
%32 = load i32, i32* %4
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %67
34: ; preds = %30
%35 = load i32, i32* %9
%36 = icmp sgt i32 %35, 0
br i1 %36, label %37, label %48
37: ; preds = %34
%38 = load double, double* %8
%39 = fcmp oeq double %38, 0.000000e+00
br i1 %39, label %40, label %48
40: ; preds = %37
%41 = load double*, double** %5
%42 = load i32, i32* %9
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %41, i64 %43
%45 = load double, double* %44
%46 = fcmp oeq double %45, 0.000000e+00
br i1 %46, label %47, label %48
47: ; preds = %40
br label %67
48: ; preds = %40, %37, %34
%49 = load double*, double** %5
%50 = load i32, i32* %9
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %49, i64 %51
%53 = load double, double* %52
store double %53, double* %8
%54 = load double*, double** %7
%55 = getelementptr inbounds double, double* %54, i64 0
%56 = load double*, double** %7
%57 = getelementptr inbounds double, double* %56, i64 5
%58 = load double, double* %8
%59 = call double @ZeroPoleFilter(double* %55, double* %57, i32 5, double %58)
%60 = load double*, double** %5
%61 = load i32, i32* %9
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
store double %59, double* %63
br label %64
64: ; preds = %48
%65 = load i32, i32* %9
%66 = add nsw i32 %65, 1
store i32 %66, i32* %9
br label %30
67: ; preds = %47, %30
ret void
}

LLVM IR (-O2):
@sms_filterHighPass.pFCoeff32k = internal global [10 x double] [double 0x3FEA0E60807357E6, double -3.257020e+00, double 4.885530e+00, double -3.257020e+00, double 0x3FEA0E60807357E6, double 1.000000e+00, double -3.589730e+00, double 4.851280e+00, double -2.924050e+00, double 6.630100e-01]
@sms_filterHighPass.pFCoeff36k = internal global [10 x double] [double 8.330980e-01, double -3.332390e+00, double 4.998590e+00, double -3.332390e+00, double 8.330980e-01, double 1.000000e+00, double -3.635280e+00, double 4.970890e+00, double -3.029340e+00, double 6.940520e-01]
@sms_filterHighPass.pFCoeff40k = internal global [10 x double] [double 8.484750e-01, double -3.393900e+00, double 5.090850e+00, double -3.393900e+00, double 8.484750e-01, double 1.000000e+00, double -3.671730e+00, double 5.068000e+00, double -3.115970e+00, double 7.199100e-01]
@sms_filterHighPass.pFCoeff441k = internal global [10 x double] [double 8.615540e-01, double -3.446220e+00, double 5.169320e+00, double -3.446220e+00, double 8.615540e-01, double 1.000000e+00, double -3.702230e+00, double 5.150230e+00, double -3.190130e+00, double 7.422750e-01]
@sms_filterHighPass.pFCoeff48k = internal global [10 x double] [double 0x3FEBE7EC7863BEEC, double -3.488240e+00, double 5.232360e+00, double -3.488240e+00, double 0x3FEBE7EC7863BEEC, double 1.000000e+00, double -3.726410e+00, double 5.216050e+00, double -3.250020e+00, double 7.604900e-01]
define void @sms_filterHighPass(i32 %0, double* nocapture %1, i32 %2) {
%4 = icmp slt i32 %2, 32001
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp ult i32 %2, 36001
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = icmp ult i32 %2, 40001
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp ult i32 %2, 44101
%11 = select i1 %10, double* getelementptr inbounds ([10 x double], [10 x double]* @sms_filterHighPass.pFCoeff441k, i64 0, i64 0), double* getelementptr inbounds ([10 x double], [10 x double]* @sms_filterHighPass.pFCoeff48k, i64 0, i64 0)
br label %12
12: ; preds = %9, %7, %5, %3
%13 = phi double* [ getelementptr inbounds ([10 x double], [10 x double]* @sms_filterHighPass.pFCoeff32k, i64 0, i64 0), %3 ], [ getelementptr inbounds ([10 x double], [10 x double]* @sms_filterHighPass.pFCoeff36k, i64 0, i64 0), %5 ], [ getelementptr inbounds ([10 x double], [10 x double]* @sms_filterHighPass.pFCoeff40k, i64 0, i64 0), %7 ], [ %11, %9 ]
%14 = icmp sgt i32 %0, 0
br i1 %14, label %15, label %33
15: ; preds = %12
%16 = getelementptr inbounds double, double* %13, i64 5
%17 = zext i32 %0 to i64
br label %18
18: ; preds = %15, %28
%19 = phi i64 [ 0, %15 ], [ %31, %28 ]
%20 = phi double [ 0.000000e+00, %15 ], [ %25, %28 ]
%21 = icmp ne i64 %19, 0
%22 = fcmp oeq double %20, 0.000000e+00
%23 = and i1 %22, %21
%24 = getelementptr inbounds double, double* %1, i64 %19
%25 = load double, double* %24
%26 = fcmp oeq double %25, 0.000000e+00
%27 = select i1 %23, i1 %26, i1 false
br i1 %27, label %33, label %28
28: ; preds = %18
%29 = getelementptr inbounds double, double* %1, i64 %19
%30 = tail call double @ZeroPoleFilter(double* %13, double* %16, i32 5, double %25)
store double %30, double* %29
%31 = add nuw nsw i64 %19, 1
%32 = icmp eq i64 %31, %17
br i1 %32, label %33, label %18
33: ; preds = %28, %18, %12
ret void
}