#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 */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ downsamp(float const *, float *, int, int *, int, int, int, float *,
                    int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(float *);
int /*<<< orphan*/ lc_lin_fir(float, int *, float *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
const float *downsample(const float *input, int samsin, int state_idx,
                        double freq, int *samsout, int decimate, int first_time,
                        int last_time) {
  static float b[2048];
  static float *foutput;
  float beta = 0.0;
  static int ncoeff = 127, ncoefft = 0;
  int init;
  if (input && (samsin > 0) && (decimate > 0) && *samsout) {
    if (decimate == 1) {
      return (input);
    }
    if (first_time) {
      int nbuff = (samsin / decimate) + (2 * ncoeff);
      ncoeff = ((int)(freq * .005)) | 1;
      beta = .5 / decimate;
      foutput = (float *)malloc(sizeof(float) * nbuff);
      {
        if (!(foutput)) {
          fprintf(stderr, "SPS assertion failed: %s\n",
                  ("Can't allocate foutput in downsample"));
          assert(0);
        }
      };
      for (; nbuff > 0;)
        foutput[--nbuff] = 0.0;
      if (!lc_lin_fir(beta, &ncoeff, b)) {
        fprintf(stderr, "\nProblems computing interpolation filter\n");
        free(foutput);
        return (NULL);
      }
      ncoefft = (ncoeff / 2) + 1;
    }
    if (first_time)
      init = 1;
    else if (last_time)
      init = 2;
    else
      init = 0;
    if (downsamp(input, foutput, samsin, samsout, state_idx, decimate, ncoefft,
                 b, init)) {
      return (foutput);
    } else
      (void)fprintf(stderr, "Problems in downsamp() in downsample()\n");
  } else
    (void)fprintf(stderr, "Bad parameters passed to downsample()\n");
  return (NULL);
}


x86 assembly (clang, -O0):
<downsample>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9d,-0x30(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     13af <downsample+0x24f>
cmpl   $0x0,-0x14(%rbp)
jle    13af <downsample+0x24f>
cmpl   $0x0,-0x2c(%rbp)
jle    13af <downsample+0x24f>
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
je     13af <downsample+0x24f>
cmpl   $0x1,-0x2c(%rbp)
jne    11d1 <downsample+0x71>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    13ce <downsample+0x26e>
cmpl   $0x0,-0x30(%rbp)
je     1304 <downsample+0x1a4>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x2c(%rbp)
mov    0x2e68(%rip),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x3c(%rbp)
movsd  0xe10(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%eax
or     $0x1,%eax
mov    %eax,0x2e46(%rip)
cvtsi2sdl -0x2c(%rbp),%xmm1
movsd  0xde9(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movslq -0x3c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,0x4e36(%rip)
cmpq   $0x0,0x4e2e(%rip)
jne    126d <downsample+0x10d>
mov    0x2d91(%rip),%rax
mov    (%rax),%edi
lea    0xdb8(%rip),%rsi
lea    0xdcb(%rip),%rdx
mov    $0x0,%al
call   1070 <fprintf@plt>
xor    %edi,%edi
call   1060 <assert@plt>
jmp    1272 <downsample+0x112>
cmpl   $0x0,-0x3c(%rbp)
jle    129c <downsample+0x13c>
mov    0x4ded(%rip),%rax
mov    -0x3c(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x3c(%rbp)
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
jmp    1272 <downsample+0x112>
movss  -0x34(%rbp),%xmm0
lea    0x2da8(%rip),%rdi
lea    0x2dc1(%rip),%rsi
call   1040 <lc_lin_fir@plt>
cmp    $0x0,%eax
jne    12ed <downsample+0x18d>
mov    0x2d1c(%rip),%rax
mov    (%rax),%edi
lea    0xd82(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x4d95(%rip),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    13ce <downsample+0x26e>
mov    0x2d5d(%rip),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,0x4d74(%rip)
cmpl   $0x0,-0x30(%rbp)
je     131a <downsample+0x1ba>
movl   $0x1,-0x38(%rbp)
jmp    133c <downsample+0x1dc>
cmpl   $0x0,0x10(%rbp)
je     1330 <downsample+0x1d0>
movl   $0x2,-0x38(%rbp)
jmp    1337 <downsample+0x1d7>
movl   $0x0,-0x38(%rbp)
jmp    133c <downsample+0x1dc>
mov    -0x10(%rbp),%rdi
mov    0x4d29(%rip),%rsi
mov    -0x14(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%r8d
mov    -0x2c(%rbp),%r9d
mov    0x4d1b(%rip),%r11d
mov    -0x38(%rbp),%eax
lea    0x2d09(%rip),%r10
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1050 <downsamp@plt>
cmp    $0x0,%rax
je     1393 <downsample+0x233>
mov    0x4ce6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13ce <downsample+0x26e>
mov    0x2c46(%rip),%rax
mov    (%rax),%edi
lea    0xcd6(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    13c6 <downsample+0x266>
mov    0x2c2a(%rip),%rax
mov    (%rax),%edi
lea    0xce2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<downsample>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %rdi,%rdi
je     12a0 <downsample+0x140>
mov    %esi,%r12d
test   %esi,%esi
jle    12a0 <downsample+0x140>
mov    %r8d,%r13d
test   %r8d,%r8d
jle    12a0 <downsample+0x140>
mov    %rcx,%r14
cmpl   $0x0,(%rcx)
je     12a0 <downsample+0x140>
mov    %rdi,%rbx
cmp    $0x1,%r13d
je     12b9 <downsample+0x159>
mov    %edx,%r8d
test   %r9d,%r9d
je     12cb <downsample+0x16b>
mov    %r8d,0x4(%rsp)
mov    %r12d,%eax
xor    %edx,%edx
div    %r13d
mov    0x2e8a(%rip),%ebp
mulsd  0xe32(%rip),%xmm0
cvttsd2si %xmm0,%ecx
mov    %rax,0x8(%rsp)
lea    (%rax,%rbp,2),%r15d
or     $0x1,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
mov    %ecx,0x2e64(%rip)
movsd  0xe14(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
lea    0x0(,%r15,4),%edi
call   1080 <malloc@plt>
mov    %rax,0x4e5e(%rip)
test   %rax,%rax
jne    123c <downsample+0xdc>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edi
lea    0xde9(%rip),%rsi
lea    0xdfc(%rip),%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
xor    %edi,%edi
call   1060 <assert@plt>
movsd  0x10(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
test   %r15d,%r15d
jle    13b2 <downsample+0x252>
add    %ebp,%ebp
mov    0x4e18(%rip),%rax
mov    %r15d,%ecx
mov    0x8(%rsp),%rdx
lea    (%rdx,%rbp,1),%r9d
add    $0xffffffff,%r9d
cmp    $0x7,%r9d
jb     1387 <downsample+0x227>
add    $0x1,%r9
mov    %r9,%r8
and    $0xfffffffffffffff8,%r8
lea    -0x8(%r8),%rdx
mov    %rdx,%r11
shr    $0x3,%r11
add    $0x1,%r11
mov    %r11d,%r10d
and    $0x3,%r10d
cmp    $0x18,%rdx
jae    12e3 <downsample+0x183>
xor    %edi,%edi
jmp    1348 <downsample+0x1e8>
mov    0x2d39(%rip),%rax
mov    (%rax),%edi
lea    0xdf1(%rip),%rsi
xor    %ebx,%ebx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebp,%ebp
cmpl   $0x0,0x50(%rsp)
setne  %bpl
add    %ebp,%ebp
mov    0x4d9a(%rip),%eax
jmp    13eb <downsample+0x28b>
and    $0xfffffffffffffffc,%r11
xor    %edi,%edi
xorpd  %xmm1,%xmm1
xor    %edx,%edx
nop
mov    $0xffffffe7,%ebp
sub    %edi,%ebp
mov    %edi,%esi
not    %esi
add    %ecx,%esi
movupd %xmm1,-0xc(%rax,%rsi,4)
movupd %xmm1,-0x1c(%rax,%rsi,4)
lea    (%rcx,%rbp,1),%esi
add    $0x10,%esi
movupd %xmm1,-0xc(%rax,%rsi,4)
movupd %xmm1,-0x1c(%rax,%rsi,4)
lea    (%rcx,%rbp,1),%esi
add    $0x8,%esi
movupd %xmm1,-0xc(%rax,%rsi,4)
movupd %xmm1,-0x1c(%rax,%rsi,4)
add    %ecx,%ebp
movupd %xmm1,-0xc(%rax,%rbp,4)
movupd %xmm1,-0x1c(%rax,%rbp,4)
add    $0x20,%rdi
add    $0x4,%rdx
cmp    %r11,%rdx
jne    12f0 <downsample+0x190>
test   %r10,%r10
je     137f <downsample+0x21f>
xor    %edx,%edx
xorpd  %xmm1,%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %edi,%esi
not    %esi
add    %ecx,%esi
movupd %xmm1,-0xc(%rax,%rsi,4)
movupd %xmm1,-0x1c(%rax,%rsi,4)
add    $0x8,%rdi
add    $0x1,%rdx
cmp    %r10,%rdx
jne    1360 <downsample+0x200>
cmp    %r8,%r9
je     13b2 <downsample+0x252>
sub    %r8,%rcx
lea    0x1(%rcx),%edx
add    $0xffffffff,%ecx
lea    (%rax,%rcx,4),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movl   $0x0,(%rax)
add    $0xffffffff,%edx
add    $0xfffffffffffffffc,%rax
cmp    $0x1,%edx
jg     13a0 <downsample+0x240>
lea    0x2c97(%rip),%rdi
lea    0x2cb0(%rip),%rsi
call   1040 <lc_lin_fir@plt>
test   %eax,%eax
je     143c <downsample+0x2dc>
mov    0x2c81(%rip),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
add    $0x1,%eax
mov    %eax,0x4c97(%rip)
mov    $0x1,%ebp
mov    0x4(%rsp),%r8d
mov    0x4c7e(%rip),%rsi
sub    $0x8,%rsp
lea    0x2c73(%rip),%r10
mov    %rbx,%rdi
mov    %r12d,%edx
mov    %r14,%rcx
mov    %r13d,%r9d
push   %rbp
push   %r10
push   %rax
call   1050 <downsamp@plt>
add    $0x20,%rsp
test   %rax,%rax
je     1427 <downsample+0x2c7>
mov    0x4c4e(%rip),%rbx
jmp    12b9 <downsample+0x159>
mov    0x2bb2(%rip),%rax
mov    (%rax),%edi
lea    0xc42(%rip),%rsi
jmp    12b0 <downsample+0x150>
mov    0x2b9d(%rip),%rax
mov    (%rax),%edi
lea    0xc03(%rip),%rsi
xor    %ebx,%ebx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x4c14(%rip),%rdi
call   1030 <free@plt>
jmp    12b9 <downsample+0x159>

LLVM IR (-O0):
@downsample.b = internal global [2048 x float] zeroinitializer
@downsample.foutput = internal global float* null
@downsample.ncoeff = internal global i32 127
@downsample.ncoefft = internal global i32 0
@stderr = global i32 0
@.str = [26 x i8] c"SPS assertion failed: %s\0A\00"
@.str.1 = [37 x i8] c"Can't allocate foutput in downsample\00"
@.str.2 = [42 x i8] c"\0AProblems computing interpolation filter\0A\00"
@.str.3 = [40 x i8] c"Problems in downsamp() in downsample()\0A\00"
@.str.4 = [39 x i8] c"Bad parameters passed to downsample()\0A\00"
define float* @downsample(float* %0, i32 %1, i32 %2, double %3, i32* %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca float*
%10 = alloca float*
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca i32*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca float
%19 = alloca i32
%20 = alloca i32
store float* %0, float** %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store double %3, double* %13
store i32* %4, i32** %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store float 0.000000e+00, float* %18
%21 = load float*, float** %10
%22 = icmp ne float* %21, null
br i1 %22, label %23, label %118
23: ; preds = %8
%24 = load i32, i32* %11
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %118
26: ; preds = %23
%27 = load i32, i32* %15
%28 = icmp sgt i32 %27, 0
br i1 %28, label %29, label %118
29: ; preds = %26
%30 = load i32*, i32** %14
%31 = load i32, i32* %30
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %118
33: ; preds = %29
%34 = load i32, i32* %15
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = load float*, float** %10
store float* %37, float** %9
br label %122
38: ; preds = %33
%39 = load i32, i32* %16
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %91
41: ; preds = %38
%42 = load i32, i32* %11
%43 = load i32, i32* %15
%44 = sdiv i32 %42, %43
%45 = load i32, i32* @downsample.ncoeff
%46 = mul nsw i32 2, %45
%47 = add nsw i32 %44, %46
store i32 %47, i32* %20
%48 = load double, double* %13
%49 = fmul double %48, 5.000000e-03
%50 = fptosi double %49 to i32
%51 = or i32 %50, 1
store i32 %51, i32* @downsample.ncoeff
%52 = load i32, i32* %15
%53 = sitofp i32 %52 to double
%54 = fdiv double 5.000000e-01, %53
%55 = fptrunc double %54 to float
store float %55, float* %18
%56 = load i32, i32* %20
%57 = sext i32 %56 to i64
%58 = mul i64 4, %57
%59 = trunc i64 %58 to i32
%60 = call i64 @malloc(i32 %59)
%61 = inttoptr i64 %60 to float*
store float* %61, float** @downsample.foutput
%62 = load float*, float** @downsample.foutput
%63 = icmp ne float* %62, null
br i1 %63, label %68, label %64
64: ; preds = %41
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%67 = call i32 @assert(i32 0)
br label %68
68: ; preds = %64, %41
br label %69
69: ; preds = %72, %68
%70 = load i32, i32* %20
%71 = icmp sgt i32 %70, 0
br i1 %71, label %72, label %78
72: ; preds = %69
%73 = load float*, float** @downsample.foutput
%74 = load i32, i32* %20
%75 = add nsw i32 %74, -1
store i32 %75, i32* %20
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds float, float* %73, i64 %76
store float 0.000000e+00, float* %77
br label %69
78: ; preds = %69
%79 = load float, float* %18
%80 = call i32 @lc_lin_fir(float %79, i32* @downsample.ncoeff, float* getelementptr inbounds ([2048 x float], [2048 x float]* @downsample.b, i64 0, i64 0))
%81 = icmp ne i32 %80, 0
br i1 %81, label %87, label %82
82: ; preds = %78
%83 = load i32, i32* @stderr
%84 = call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%85 = load float*, float** @downsample.foutput
%86 = call i32 @free(float* %85)
store float* null, float** %9
br label %122
87: ; preds = %78
%88 = load i32, i32* @downsample.ncoeff
%89 = sdiv i32 %88, 2
%90 = add nsw i32 %89, 1
store i32 %90, i32* @downsample.ncoefft
br label %91
91: ; preds = %87, %38
%92 = load i32, i32* %16
%93 = icmp ne i32 %92, 0
br i1 %93, label %94, label %95
94: ; preds = %91
store i32 1, i32* %19
br label %101
95: ; preds = %91
%96 = load i32, i32* %17
%97 = icmp ne i32 %96, 0
br i1 %97, label %98, label %99
98: ; preds = %95
store i32 2, i32* %19
br label %100
99: ; preds = %95
store i32 0, i32* %19
br label %100
100: ; preds = %99, %98
br label %101
101: ; preds = %100, %94
%102 = load float*, float** %10
%103 = load float*, float** @downsample.foutput
%104 = load i32, i32* %11
%105 = load i32*, i32** %14
%106 = load i32, i32* %12
%107 = load i32, i32* %15
%108 = load i32, i32* @downsample.ncoefft
%109 = load i32, i32* %19
%110 = call i64 @downsamp(float* %102, float* %103, i32 %104, i32* %105, i32 %106, i32 %107, i32 %108, float* getelementptr inbounds ([2048 x float], [2048 x float]* @downsample.b, i64 0, i64 0), i32 %109)
%111 = icmp ne i64 %110, 0
br i1 %111, label %112, label %114
112: ; preds = %101
%113 = load float*, float** @downsample.foutput
store float* %113, float** %9
br label %122
114: ; preds = %101
%115 = load i32, i32* @stderr
%116 = call i32 (i32, i8*, ...) @fprintf(i32 %115, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
br label %117
117: ; preds = %114
br label %121
118: ; preds = %29, %26, %23, %8
%119 = load i32, i32* @stderr
%120 = call i32 (i32, i8*, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
br label %121
121: ; preds = %118, %117
store float* null, float** %9
br label %122
122: ; preds = %121, %112, %82, %36
%123 = load float*, float** %9
ret float* %123
}

LLVM IR (-O2):
@downsample.b = internal global [2048 x float] zeroinitializer
@downsample.foutput = internal unnamed_addr global float* null
@downsample.ncoeff = internal global i32 127
@downsample.ncoefft = internal unnamed_addr global i32 0
@stderr = global i32 0
@.str = [26 x i8] c"SPS assertion failed: %s\0A\00"
@.str.1 = [37 x i8] c"Can't allocate foutput in downsample\00"
@.str.2 = [42 x i8] c"\0AProblems computing interpolation filter\0A\00"
@.str.3 = [40 x i8] c"Problems in downsamp() in downsample()\0A\00"
@.str.4 = [39 x i8] c"Bad parameters passed to downsample()\0A\00"
define float* @downsample(float* %0, i32 %1, i32 %2, double %3, i32* %4, i32 %5, i32 %6, i32 %7) {
%9 = icmp ne float* %0, null
%10 = icmp sgt i32 %1, 0
%11 = and i1 %9, %10
%12 = icmp sgt i32 %5, 0
%13 = and i1 %11, %12
br i1 %13, label %14, label %158
14: ; preds = %8
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 0
br i1 %16, label %158, label %17
17: ; preds = %14
%18 = icmp eq i32 %5, 1
br i1 %18, label %161, label %19
19: ; preds = %17
%20 = icmp eq i32 %6, 0
br i1 %20, label %143, label %21
21: ; preds = %19
%22 = udiv i32 %1, %5
%23 = load i32, i32* @downsample.ncoeff
%24 = shl nsw i32 %23, 1
%25 = add nsw i32 %24, %22
%26 = fmul double %3, 5.000000e-03
%27 = fptosi double %26 to i32
%28 = or i32 %27, 1
store i32 %28, i32* @downsample.ncoeff
%29 = sitofp i32 %5 to double
%30 = fdiv double 5.000000e-01, %29
%31 = fptrunc double %30 to float
%32 = shl i32 %25, 2
%33 = tail call i64 @malloc(i32 %32)
%34 = inttoptr i64 %33 to float*
store float* %34, float** @downsample.foutput
%35 = icmp eq i64 %33, 0
br i1 %35, label %36, label %40
36: ; preds = %21
%37 = load i32, i32* @stderr
%38 = tail call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%39 = tail call i32 @assert(i32 0)
br label %40
40: ; preds = %36, %21
%41 = icmp sgt i32 %25, 0
br i1 %41, label %42, label %131
42: ; preds = %40
%43 = load float*, float** @downsample.foutput
%44 = zext i32 %25 to i64
%45 = add i32 %22, %24
%46 = add i32 %45, -1
%47 = zext i32 %46 to i64
%48 = add nuw nsw i64 %47, 1
%49 = icmp ult i32 %46, 7
br i1 %49, label %122, label %50
50: ; preds = %42
%51 = and i64 %48, 8589934584
%52 = sub nsw i64 %44, %51
%53 = add nsw i64 %51, -8
%54 = lshr exact i64 %53, 3
%55 = add nuw nsw i64 %54, 1
%56 = and i64 %55, 3
%57 = icmp ult i64 %53, 24
br i1 %57, label %102, label %58
58: ; preds = %50
%59 = and i64 %55, 4611686018427387900
br label %60
60: ; preds = %60, %58
%61 = phi i64 [ 0, %58 ], [ %99, %60 ]
%62 = phi i64 [ 0, %58 ], [ %100, %60 ]
%63 = xor i64 %61, -1
%64 = add i64 %63, %44
%65 = and i64 %64, 4294967295
%66 = getelementptr inbounds float, float* %43, i64 %65
%67 = getelementptr inbounds float, float* %66, i64 -3
%68 = bitcast float* %67 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %68
%69 = getelementptr inbounds float, float* %66, i64 -4
%70 = getelementptr inbounds float, float* %69, i64 -3
%71 = bitcast float* %70 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %71
%72 = sub i64 4294967287, %61
%73 = add i64 %72, %44
%74 = and i64 %73, 4294967295
%75 = getelementptr inbounds float, float* %43, i64 %74
%76 = getelementptr inbounds float, float* %75, i64 -3
%77 = bitcast float* %76 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %77
%78 = getelementptr inbounds float, float* %75, i64 -4
%79 = getelementptr inbounds float, float* %78, i64 -3
%80 = bitcast float* %79 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %80
%81 = sub i64 4294967279, %61
%82 = add i64 %81, %44
%83 = and i64 %82, 4294967295
%84 = getelementptr inbounds float, float* %43, i64 %83
%85 = getelementptr inbounds float, float* %84, i64 -3
%86 = bitcast float* %85 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %86
%87 = getelementptr inbounds float, float* %84, i64 -4
%88 = getelementptr inbounds float, float* %87, i64 -3
%89 = bitcast float* %88 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %89
%90 = sub i64 4294967271, %61
%91 = add i64 %90, %44
%92 = and i64 %91, 4294967295
%93 = getelementptr inbounds float, float* %43, i64 %92
%94 = getelementptr inbounds float, float* %93, i64 -3
%95 = bitcast float* %94 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %95
%96 = getelementptr inbounds float, float* %93, i64 -4
%97 = getelementptr inbounds float, float* %96, i64 -3
%98 = bitcast float* %97 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %98
%99 = add nuw i64 %61, 32
%100 = add i64 %62, 4
%101 = icmp eq i64 %100, %59
br i1 %101, label %102, label %60
102: ; preds = %60, %50
%103 = phi i64 [ 0, %50 ], [ %99, %60 ]
%104 = icmp eq i64 %56, 0
br i1 %104, label %120, label %105
105: ; preds = %102, %105
%106 = phi i64 [ %117, %105 ], [ %103, %102 ]
%107 = phi i64 [ %118, %105 ], [ 0, %102 ]
%108 = xor i64 %106, -1
%109 = add i64 %108, %44
%110 = and i64 %109, 4294967295
%111 = getelementptr inbounds float, float* %43, i64 %110
%112 = getelementptr inbounds float, float* %111, i64 -3
%113 = bitcast float* %112 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %113
%114 = getelementptr inbounds float, float* %111, i64 -4
%115 = getelementptr inbounds float, float* %114, i64 -3
%116 = bitcast float* %115 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %116
%117 = add nuw i64 %106, 8
%118 = add i64 %107, 1
%119 = icmp eq i64 %118, %56
br i1 %119, label %120, label %105
120: ; preds = %105, %102
%121 = icmp eq i64 %48, %51
br i1 %121, label %131, label %122
122: ; preds = %42, %120
%123 = phi i64 [ %44, %42 ], [ %52, %120 ]
br label %124
124: ; preds = %122, %124
%125 = phi i64 [ %126, %124 ], [ %123, %122 ]
%126 = add nsw i64 %125, -1
%127 = and i64 %126, 4294967295
%128 = getelementptr inbounds float, float* %43, i64 %127
store float 0.000000e+00, float* %128
%129 = trunc i64 %125 to i32
%130 = icmp sgt i32 %129, 1
br i1 %130, label %124, label %131
131: ; preds = %124, %120, %40
%132 = tail call i32 @lc_lin_fir(float %31, i32* @downsample.ncoeff, float* getelementptr inbounds ([2048 x float], [2048 x float]* @downsample.b, i64 0, i64 0))
%133 = icmp eq i32 %132, 0
br i1 %133, label %134, label %139
134: ; preds = %131
%135 = load i32, i32* @stderr
%136 = tail call i32 (i32, i8*, ...) @fprintf(i32 %135, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%137 = load float*, float** @downsample.foutput
%138 = tail call i32 @free(float* %137)
br label %161
139: ; preds = %131
%140 = load i32, i32* @downsample.ncoeff
%141 = sdiv i32 %140, 2
%142 = add nsw i32 %141, 1
store i32 %142, i32* @downsample.ncoefft
br label %147
143: ; preds = %19
%144 = icmp eq i32 %7, 0
%145 = select i1 %144, i32 0, i32 2
%146 = load i32, i32* @downsample.ncoefft
br label %147
147: ; preds = %139, %143
%148 = phi i32 [ %142, %139 ], [ %146, %143 ]
%149 = phi i32 [ 1, %139 ], [ %145, %143 ]
%150 = load float*, float** @downsample.foutput
%151 = tail call i64 @downsamp(float* %0, float* %150, i32 %1, i32* %4, i32 %2, i32 %5, i32 %148, float* getelementptr inbounds ([2048 x float], [2048 x float]* @downsample.b, i64 0, i64 0), i32 %149)
%152 = icmp eq i64 %151, 0
br i1 %152, label %155, label %153
153: ; preds = %147
%154 = load float*, float** @downsample.foutput
br label %161
155: ; preds = %147
%156 = load i32, i32* @stderr
%157 = tail call i32 (i32, i8*, ...) @fprintf(i32 %156, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
br label %161
158: ; preds = %14, %8
%159 = load i32, i32* @stderr
%160 = tail call i32 (i32, i8*, ...) @fprintf(i32 %159, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
br label %161
161: ; preds = %134, %155, %158, %17, %153
%162 = phi float* [ %154, %153 ], [ %0, %17 ], [ null, %158 ], [ null, %155 ], [ null, %134 ]
ret float* %162
}