#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 */
short *calloc(int, int);
int /*<<< orphan*/ memcpy(short *, short *, int);
void filterloop(short int *buf, int l, int b) {
  static float xv[7], yv[7];
  short int *in;
  static float c[4][6] = {{-0.6235385946, 3.3779247772, -8.2824221345,
                           11.5675604240, -9.6967045468, 4.6299593645},
                          {-0.4535459334, 2.5370880100, -6.4847845669,
                           9.5144072211, -8.4472239809, 4.3051177389},
                          {-0.1978251873, 1.3168771088, -3.8803884946,
                           6.5449240143, -6.6950970397, 3.9046544087},
                          {0.0131505881, 0.2450198734, -0.6698556894,
                           0.9667482217, -1.8996423954, 2.3375093931}};
  static float gain[4] = {7.637953014e+02, 1.886640723e+02, 3.154970680e+01,
                          5.346000407e+00};
  long int k;
  if (b < 500) {
    b = 0;
  } else if (b < 1000) {
    b = 1;
  } else if (b < 2100) {
    b = 2;
  } else {
    b = 4;
  }
  in = calloc(l, sizeof(short int));
  memcpy(in, buf, l * sizeof(short int));
  for (k = 0; k < l; k++) {
    xv[0] = xv[1];
    xv[1] = xv[2];
    xv[2] = xv[3];
    xv[3] = xv[4];
    xv[4] = xv[5];
    xv[5] = xv[6];
    xv[6] = ((float)in[k] / 255) / gain[b];
    yv[0] = yv[1];
    yv[1] = yv[2];
    yv[2] = yv[3];
    yv[3] = yv[4];
    yv[4] = yv[5];
    yv[5] = yv[6];
    yv[6] = (xv[6] - xv[0]) + 3 * (xv[2] - xv[4]) + (c[b][0] * yv[0]) +
            (c[b][1] * yv[1]) + (c[b][2] * yv[2]) + (c[b][3] * yv[3]) +
            (c[b][4] * yv[4]) + (c[b][5] * yv[5]);
    buf[k] = (short int)(yv[6] * 255.0);
  }
}


x86 assembly (clang, -O0):
<filterloop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x1f4,-0x10(%rbp)
jge    114b <filterloop+0x2b>
movl   $0x0,-0x10(%rbp)
jmp    118e <filterloop+0x6e>
cmpl   $0x3e8,-0x10(%rbp)
jge    1164 <filterloop+0x44>
movl   $0x1,-0x10(%rbp)
jmp    1189 <filterloop+0x69>
cmpl   $0x834,-0x10(%rbp)
jge    117d <filterloop+0x5d>
movl   $0x2,-0x10(%rbp)
jmp    1184 <filterloop+0x64>
movl   $0x4,-0x10(%rbp)
jmp    1189 <filterloop+0x69>
jmp    118e <filterloop+0x6e>
mov    -0xc(%rbp),%edi
mov    $0x2,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%edx
call   1040 <memcpy@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmp    %rcx,%rax
jge    13d5 <filterloop+0x2b5>
movss  0x2eed(%rip),%xmm0
movss  %xmm0,0x2ee1(%rip)
movss  0x2ee1(%rip),%xmm0
movss  %xmm0,0x2ed5(%rip)
movss  0x2ed5(%rip),%xmm0
movss  %xmm0,0x2ec9(%rip)
movss  0x2ec9(%rip),%xmm0
movss  %xmm0,0x2ebd(%rip)
movss  0x2ebd(%rip),%xmm0
movss  %xmm0,0x2eb1(%rip)
movss  0x2eb1(%rip),%xmm0
movss  %xmm0,0x2ea5(%rip)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
cvtsi2ss %eax,%xmm0
movss  0xdb9(%rip),%xmm1
divss  %xmm1,%xmm0
movslq -0x10(%rbp),%rcx
lea    0x2e4a(%rip),%rax
movss  (%rax,%rcx,4),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,0x2e71(%rip)
movss  0x2e75(%rip),%xmm0
movss  %xmm0,0x2e69(%rip)
movss  0x2e69(%rip),%xmm0
movss  %xmm0,0x2e5d(%rip)
movss  0x2e5d(%rip),%xmm0
movss  %xmm0,0x2e51(%rip)
movss  0x2e51(%rip),%xmm0
movss  %xmm0,0x2e45(%rip)
movss  0x2e45(%rip),%xmm0
movss  %xmm0,0x2e39(%rip)
movss  0x2e39(%rip),%xmm0
movss  %xmm0,0x2e2d(%rip)
movss  0x2e09(%rip),%xmm0
movss  0x2de9(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0x2de5(%rip),%xmm2
movss  0x2de5(%rip),%xmm1
subss  %xmm1,%xmm2
movss  0xd0d(%rip),%xmm1
mulss  %xmm1,%xmm2
addss  %xmm0,%xmm2
movslq -0x10(%rbp),%rax
lea    (%rax,%rax,2),%rcx
lea    0x2d32(%rip),%rax
movss  0x2dca(%rip),%xmm3
movss  (%rax,%rcx,8),%xmm1
movss  0x4(%rax,%rcx,8),%xmm0
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
movss  0x2db3(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0x8(%rax,%rcx,8),%xmm1
movss  0x2da1(%rip),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  0xc(%rax,%rcx,8),%xmm0
movss  0x2d8f(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0x10(%rax,%rcx,8),%xmm1
movss  0x2d7d(%rip),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  0x14(%rax,%rcx,8),%xmm0
movss  0x2d6b(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0x2d5f(%rip)
movss  0x2d57(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc5b(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,%dx
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    11be <filterloop+0x9e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filterloop>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %esi,%r15d
mov    %rdi,%r14
cmp    $0x1f4,%edx
jge    113e <filterloop+0x1e>
xor    %r12d,%r12d
jmp    115f <filterloop+0x3f>
mov    $0x1,%r12d
cmp    $0x3e8,%edx
jb     115f <filterloop+0x3f>
xor    %eax,%eax
cmp    $0x834,%edx
setae  %al
lea    (%rax,%rax,1),%r12
add    $0x2,%r12
mov    %r15d,%edi
mov    $0x2,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
lea    (%r15,%r15,1),%edx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <memcpy@plt>
test   %r15d,%r15d
jle    1422 <filterloop+0x302>
movslq %r15d,%rax
movss  0x2f26(%rip),%xmm1
movss  0x2f16(%rip),%xmm2
movss  0x2efd(%rip),%xmm13
movss  0x2ee5(%rip),%xmm0
movss  %xmm0,(%rsp)
movss  0x2ed0(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
movss  0x2eb9(%rip),%xmm11
movss  0x2ea9(%rip),%xmm0
movss  0x2e99(%rip),%xmm3
movss  %xmm3,0x8(%rsp)
movss  0x2e7b(%rip),%xmm3
movss  %xmm3,0x14(%rsp)
lea    0xe7e(%rip),%rcx
movss  (%rcx,%r12,4),%xmm3
movss  %xmm3,0x30(%rsp)
lea    (%r12,%r12,2),%rcx
lea    0xe07(%rip),%rdx
movss  (%rdx,%rcx,8),%xmm3
movss  %xmm3,0x2c(%rsp)
movss  0x4(%rdx,%rcx,8),%xmm3
movss  %xmm3,0x28(%rsp)
movss  0x8(%rdx,%rcx,8),%xmm3
movss  %xmm3,0x24(%rsp)
movss  0xc(%rdx,%rcx,8),%xmm3
movss  %xmm3,0x20(%rsp)
movss  0x10(%rdx,%rcx,8),%xmm3
movss  %xmm3,0x1c(%rsp)
movss  0x14(%rdx,%rcx,8),%xmm3
movss  %xmm3,0x18(%rsp)
xor    %ecx,%ecx
movss  0x2df6(%rip),%xmm4
movss  0x2de6(%rip),%xmm3
movss  %xmm3,0x10(%rsp)
movss  0x2dd0(%rip),%xmm3
movss  %xmm3,0xc(%rsp)
cs nopw 0x0(%rax,%rax,1)
movaps %xmm1,%xmm3
movss  %xmm1,0x34(%rsp)
movaps %xmm2,%xmm8
movaps %xmm13,%xmm12
movss  (%rsp),%xmm9
movss  0x4(%rsp),%xmm5
movaps %xmm0,%xmm10
movss  0x8(%rsp),%xmm14
mulss  0x2c(%rsp),%xmm11
movswl (%rbx,%rcx,2),%edx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
divss  0xd3e(%rip),%xmm0
divss  0x30(%rsp),%xmm0
movaps %xmm0,%xmm1
subss  0xc(%rsp),%xmm1
movaps %xmm4,%xmm2
subss  %xmm14,%xmm2
mulss  0xd23(%rip),%xmm2
addss  %xmm1,%xmm2
addss  %xmm11,%xmm2
movss  0x28(%rsp),%xmm1
mulss  %xmm5,%xmm1
addss  %xmm2,%xmm1
movss  0x24(%rsp),%xmm2
mulss  %xmm9,%xmm2
addss  %xmm1,%xmm2
movss  0x20(%rsp),%xmm1
mulss  %xmm13,%xmm1
addss  %xmm2,%xmm1
movss  0x1c(%rsp),%xmm2
movaps %xmm8,%xmm13
mulss  %xmm8,%xmm2
addss  %xmm1,%xmm2
movss  0x18(%rsp),%xmm1
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm1,%xmm2
mulsd  0xcc2(%rip),%xmm2
cvttsd2si %xmm2,%edx
movss  0x14(%rsp),%xmm3
movss  0x10(%rsp),%xmm15
mov    %dx,(%r14,%rcx,2)
add    $0x1,%rcx
movss  %xmm15,0xc(%rsp)
movaps %xmm4,%xmm7
movss  %xmm4,0x10(%rsp)
movaps %xmm3,%xmm4
movss  %xmm14,0x14(%rsp)
movss  %xmm10,0x8(%rsp)
movaps %xmm5,%xmm11
movss  %xmm9,0x4(%rsp)
movss  %xmm12,(%rsp)
movss  0x34(%rsp),%xmm2
cmp    %rcx,%rax
jne    1280 <filterloop+0x160>
movaps %xmm14,%xmm8
movaps %xmm10,%xmm14
movaps %xmm5,%xmm10
movaps %xmm9,%xmm6
movaps %xmm12,%xmm5
movaps %xmm13,%xmm12
movaps %xmm2,%xmm9
movss  %xmm15,0x2c7a(%rip)
movss  %xmm7,0x2c7a(%rip)
movss  %xmm3,0x2c7a(%rip)
movss  %xmm8,0x2c81(%rip)
movss  %xmm14,0x2c88(%rip)
movss  %xmm0,0x2c88(%rip)
movss  %xmm10,0x2c87(%rip)
movss  %xmm6,0x2c87(%rip)
movss  %xmm5,0x2c87(%rip)
movss  %xmm13,0x2c8e(%rip)
movss  %xmm2,0x2c96(%rip)
movss  %xmm1,0x2c96(%rip)
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@filterloop.xv = internal global [7 x float] zeroinitializer
@filterloop.yv = internal global [7 x float] zeroinitializer
@filterloop.c = internal global [4 x [6 x float]] [[6 x float] [float 0xBFE3F40740000000, float 0x400B05FD60000000, float 0xC0209099A0000000, float 0x4027229740000000, float 0xC02364B680000000, float 0x4012851420000000], [6 x float] [float 0xBFDD06E580000000, float 0x40044BF4C0000000, float 0xC019F06B60000000, float 0x4023076060000000, float 0xC020E4FA80000000, float 0x40113870C0000000], [6 x float] [float 0xBFC9525600000000, float 0x3FF511EDC0000000, float 0xC00F0B0920000000, float 0x401A2E0080000000, float 0xC01AC7C780000000, float 0x400F3CBB80000000], [6 x float] [float 0x3F8AEEB200000000, float 0x3FCF5CCFA0000000, float 0xBFE56F7540000000, float 0x3FEEEF9A00000000, float 0xBFFE64EF60000000, float 0x4002B33820000000]]
@filterloop.gain = internal global [4 x float] [float 0x4087DE5CC0000000, float 0x4067954020000000, float 0x403F8CB9A0000000, float 0x4015624DE0000000]
define void @filterloop(i16* %0, i32 %1, i32 %2) {
%4 = alloca i16*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i16*
%8 = alloca i64
store i16* %0, i16** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 500
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 0, i32* %6
br label %23
12: ; preds = %3
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 1000
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 1, i32* %6
br label %22
16: ; preds = %12
%17 = load i32, i32* %6
%18 = icmp slt i32 %17, 2100
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 2, i32* %6
br label %21
20: ; preds = %16
store i32 4, i32* %6
br label %21
21: ; preds = %20, %19
br label %22
22: ; preds = %21, %15
br label %23
23: ; preds = %22, %11
%24 = load i32, i32* %5
%25 = call i16* @calloc(i32 %24, i32 2)
store i16* %25, i16** %7
%26 = load i16*, i16** %7
%27 = load i16*, i16** %4
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = mul i64 %29, 2
%31 = trunc i64 %30 to i32
%32 = call i32 @memcpy(i16* %26, i16* %27, i32 %31)
store i64 0, i64* %8
br label %33
33: ; preds = %118, %23
%34 = load i64, i64* %8
%35 = load i32, i32* %5
%36 = sext i32 %35 to i64
%37 = icmp slt i64 %34, %36
br i1 %37, label %38, label %121
38: ; preds = %33
%39 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 1)
store float %39, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 0)
%40 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 2)
store float %40, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 1)
%41 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 3)
store float %41, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 2)
%42 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 4)
store float %42, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 3)
%43 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 5)
store float %43, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 4)
%44 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 6)
store float %44, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 5)
%45 = load i16*, i16** %7
%46 = load i64, i64* %8
%47 = getelementptr inbounds i16, i16* %45, i64 %46
%48 = load i16, i16* %47
%49 = sitofp i16 %48 to float
%50 = fdiv float %49, 2.550000e+02
%51 = load i32, i32* %6
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [4 x float], [4 x float]* @filterloop.gain, i64 0, i64 %52
%54 = load float, float* %53
%55 = fdiv float %50, %54
store float %55, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 6)
%56 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 1)
store float %56, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 0)
%57 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 2)
store float %57, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 1)
%58 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 3)
store float %58, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 2)
%59 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 4)
store float %59, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 3)
%60 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 5)
store float %60, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 4)
%61 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 6)
store float %61, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 5)
%62 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 6)
%63 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 0)
%64 = fsub float %62, %63
%65 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 2)
%66 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.xv, i64 0, i64 4)
%67 = fsub float %65, %66
%68 = call float @llvm.fmuladd.f32(float 3.000000e+00, float %67, float %64)
%69 = load i32, i32* %6
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [4 x [6 x float]], [4 x [6 x float]]* @filterloop.c, i64 0, i64 %70
%72 = getelementptr inbounds [6 x float], [6 x float]* %71, i64 0, i64 0
%73 = load float, float* %72
%74 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 0)
%75 = call float @llvm.fmuladd.f32(float %73, float %74, float %68)
%76 = load i32, i32* %6
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [4 x [6 x float]], [4 x [6 x float]]* @filterloop.c, i64 0, i64 %77
%79 = getelementptr inbounds [6 x float], [6 x float]* %78, i64 0, i64 1
%80 = load float, float* %79
%81 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 1)
%82 = call float @llvm.fmuladd.f32(float %80, float %81, float %75)
%83 = load i32, i32* %6
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [4 x [6 x float]], [4 x [6 x float]]* @filterloop.c, i64 0, i64 %84
%86 = getelementptr inbounds [6 x float], [6 x float]* %85, i64 0, i64 2
%87 = load float, float* %86
%88 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 2)
%89 = call float @llvm.fmuladd.f32(float %87, float %88, float %82)
%90 = load i32, i32* %6
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [4 x [6 x float]], [4 x [6 x float]]* @filterloop.c, i64 0, i64 %91
%93 = getelementptr inbounds [6 x float], [6 x float]* %92, i64 0, i64 3
%94 = load float, float* %93
%95 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 3)
%96 = call float @llvm.fmuladd.f32(float %94, float %95, float %89)
%97 = load i32, i32* %6
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [4 x [6 x float]], [4 x [6 x float]]* @filterloop.c, i64 0, i64 %98
%100 = getelementptr inbounds [6 x float], [6 x float]* %99, i64 0, i64 4
%101 = load float, float* %100
%102 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 4)
%103 = call float @llvm.fmuladd.f32(float %101, float %102, float %96)
%104 = load i32, i32* %6
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds [4 x [6 x float]], [4 x [6 x float]]* @filterloop.c, i64 0, i64 %105
%107 = getelementptr inbounds [6 x float], [6 x float]* %106, i64 0, i64 5
%108 = load float, float* %107
%109 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 5)
%110 = call float @llvm.fmuladd.f32(float %108, float %109, float %103)
store float %110, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 6)
%111 = load float, float* getelementptr inbounds ([7 x float], [7 x float]* @filterloop.yv, i64 0, i64 6)
%112 = fpext float %111 to double
%113 = fmul double %112, 2.550000e+02
%114 = fptosi double %113 to i16
%115 = load i16*, i16** %4
%116 = load i64, i64* %8
%117 = getelementptr inbounds i16, i16* %115, i64 %116
store i16 %114, i16* %117
br label %118
118: ; preds = %38
%119 = load i64, i64* %8
%120 = add nsw i64 %119, 1
store i64 %120, i64* %8
br label %33
121: ; preds = %33
ret void
}

LLVM IR (-O2):
@filterloop.xv.1 = internal unnamed_addr global float 0.000000e+00
@filterloop.xv.2 = internal unnamed_addr global float 0.000000e+00
@filterloop.xv.3 = internal unnamed_addr global float 0.000000e+00
@filterloop.xv.4 = internal unnamed_addr global float 0.000000e+00
@filterloop.xv.5 = internal unnamed_addr global float 0.000000e+00
@filterloop.xv.6 = internal unnamed_addr global float 0.000000e+00
@filterloop.yv.1 = internal unnamed_addr global float 0.000000e+00
@filterloop.yv.2 = internal unnamed_addr global float 0.000000e+00
@filterloop.yv.3 = internal unnamed_addr global float 0.000000e+00
@filterloop.yv.4 = internal unnamed_addr global float 0.000000e+00
@filterloop.yv.5 = internal unnamed_addr global float 0.000000e+00
@filterloop.yv.6 = internal unnamed_addr global float 0.000000e+00
@filterloop.c = internal unnamed_addr constant [4 x [6 x float]] [[6 x float] [float 0xBFE3F40740000000, float 0x400B05FD60000000, float 0xC0209099A0000000, float 0x4027229740000000, float 0xC02364B680000000, float 0x4012851420000000], [6 x float] [float 0xBFDD06E580000000, float 0x40044BF4C0000000, float 0xC019F06B60000000, float 0x4023076060000000, float 0xC020E4FA80000000, float 0x40113870C0000000], [6 x float] [float 0xBFC9525600000000, float 0x3FF511EDC0000000, float 0xC00F0B0920000000, float 0x401A2E0080000000, float 0xC01AC7C780000000, float 0x400F3CBB80000000], [6 x float] [float 0x3F8AEEB200000000, float 0x3FCF5CCFA0000000, float 0xBFE56F7540000000, float 0x3FEEEF9A00000000, float 0xBFFE64EF60000000, float 0x4002B33820000000]]
@filterloop.gain = internal unnamed_addr constant [4 x float] [float 0x4087DE5CC0000000, float 0x4067954020000000, float 0x403F8CB9A0000000, float 0x4015624DE0000000]
define void @filterloop(i16* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, 500
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i32 %2, 1000
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i32 %2, 2100
%9 = select i1 %8, i64 2, i64 4
br label %10
10: ; preds = %7, %5, %3
%11 = phi i64 [ 0, %3 ], [ 1, %5 ], [ %9, %7 ]
%12 = tail call i16* @calloc(i32 %1, i32 2)
%13 = sext i32 %1 to i64
%14 = shl i32 %1, 1
%15 = tail call i32 @memcpy(i16* %12, i16* %0, i32 %14)
%16 = icmp sgt i32 %1, 0
br i1 %16, label %17, label %79
17: ; preds = %10
%18 = load float, float* @filterloop.yv.6
%19 = load float, float* @filterloop.yv.5
%20 = load float, float* @filterloop.yv.4
%21 = load float, float* @filterloop.yv.3
%22 = load float, float* @filterloop.yv.2
%23 = load float, float* @filterloop.yv.1
%24 = load float, float* @filterloop.xv.6
%25 = load float, float* @filterloop.xv.5
%26 = load float, float* @filterloop.xv.4
%27 = load float, float* @filterloop.xv.3
%28 = load float, float* @filterloop.xv.2
%29 = load float, float* @filterloop.xv.1
%30 = getelementptr inbounds [4 x float], [4 x float]* @filterloop.gain, i64 0, i64 %11
%31 = load float, float* %30
%32 = getelementptr inbounds [4 x [6 x float]], [4 x [6 x float]]* @filterloop.c, i64 0, i64 %11, i64 0
%33 = load float, float* %32
%34 = getelementptr inbounds [4 x [6 x float]], [4 x [6 x float]]* @filterloop.c, i64 0, i64 %11, i64 1
%35 = load float, float* %34
%36 = getelementptr inbounds [4 x [6 x float]], [4 x [6 x float]]* @filterloop.c, i64 0, i64 %11, i64 2
%37 = load float, float* %36
%38 = getelementptr inbounds [4 x [6 x float]], [4 x [6 x float]]* @filterloop.c, i64 0, i64 %11, i64 3
%39 = load float, float* %38
%40 = getelementptr inbounds [4 x [6 x float]], [4 x [6 x float]]* @filterloop.c, i64 0, i64 %11, i64 4
%41 = load float, float* %40
%42 = getelementptr inbounds [4 x [6 x float]], [4 x [6 x float]]* @filterloop.c, i64 0, i64 %11, i64 5
%43 = load float, float* %42
br label %44
44: ; preds = %17, %44
%45 = phi i64 [ 0, %17 ], [ %76, %44 ]
%46 = phi float [ %29, %17 ], [ %47, %44 ]
%47 = phi float [ %28, %17 ], [ %48, %44 ]
%48 = phi float [ %27, %17 ], [ %49, %44 ]
%49 = phi float [ %26, %17 ], [ %50, %44 ]
%50 = phi float [ %25, %17 ], [ %51, %44 ]
%51 = phi float [ %24, %17 ], [ %62, %44 ]
%52 = phi float [ %23, %17 ], [ %53, %44 ]
%53 = phi float [ %22, %17 ], [ %54, %44 ]
%54 = phi float [ %21, %17 ], [ %55, %44 ]
%55 = phi float [ %20, %17 ], [ %56, %44 ]
%56 = phi float [ %19, %17 ], [ %57, %44 ]
%57 = phi float [ %18, %17 ], [ %71, %44 ]
%58 = getelementptr inbounds i16, i16* %12, i64 %45
%59 = load i16, i16* %58
%60 = sitofp i16 %59 to float
%61 = fdiv float %60, 2.550000e+02
%62 = fdiv float %61, %31
%63 = fsub float %62, %46
%64 = fsub float %48, %50
%65 = tail call float @llvm.fmuladd.f32(float %64, float 3.000000e+00, float %63)
%66 = tail call float @llvm.fmuladd.f32(float %33, float %52, float %65)
%67 = tail call float @llvm.fmuladd.f32(float %35, float %53, float %66)
%68 = tail call float @llvm.fmuladd.f32(float %37, float %54, float %67)
%69 = tail call float @llvm.fmuladd.f32(float %39, float %55, float %68)
%70 = tail call float @llvm.fmuladd.f32(float %41, float %56, float %69)
%71 = tail call float @llvm.fmuladd.f32(float %43, float %57, float %70)
%72 = fpext float %71 to double
%73 = fmul double %72, 2.550000e+02
%74 = fptosi double %73 to i16
%75 = getelementptr inbounds i16, i16* %0, i64 %45
store i16 %74, i16* %75
%76 = add nuw nsw i64 %45, 1
%77 = icmp eq i64 %76, %13
br i1 %77, label %78, label %44
78: ; preds = %44
store float %47, float* @filterloop.xv.1
store float %48, float* @filterloop.xv.2
store float %49, float* @filterloop.xv.3
store float %50, float* @filterloop.xv.4
store float %51, float* @filterloop.xv.5
store float %62, float* @filterloop.xv.6
store float %53, float* @filterloop.yv.1
store float %54, float* @filterloop.yv.2
store float %55, float* @filterloop.yv.3
store float %56, float* @filterloop.yv.4
store float %57, float* @filterloop.yv.5
store float %71, float* @filterloop.yv.6
br label %79
79: ; preds = %78, %10
ret void
}