#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*/ SKP_Silk_allpass_int(int *, int *, short const, int *, int);
int /*<<< orphan*/ SKP_Silk_lowpass_short(short const *, int *, int *, int);
int SKP_min_int(int, int);
void SKP_Silk_resample_1_3(short *out, int *S, const short *in,
                           const int inLen) {
  int k, outLen, LSubFrameIn, LSubFrameOut;
  int out_tmp, limit = 102258000;
  int scratch0[3 * 80];
  int scratch10[80], scratch11[80], scratch12[80];
  const short A30[2] = {1773, 17818};
  const short A31[2] = {4942, 25677};
  const short A32[2] = {11786, 29304};
  ;
  outLen = ((int)((inLen) / (3)));
  while (outLen > 0) {
    LSubFrameOut = SKP_min_int(80, outLen);
    LSubFrameIn = ((int)((short)(3)) * (int)((short)(LSubFrameOut)));
    SKP_Silk_lowpass_short(in, S, scratch0, LSubFrameIn);
    for (k = 0; k < LSubFrameOut; k++) {
      scratch10[k] = scratch0[3 * k];
      scratch11[k] = scratch0[3 * k + 1];
      scratch12[k] = scratch0[3 * k + 2];
    }
    SKP_Silk_allpass_int(scratch10, S + 1, A32[0], scratch0, LSubFrameOut);
    SKP_Silk_allpass_int(scratch0, S + 2, A32[1], scratch10, LSubFrameOut);
    SKP_Silk_allpass_int(scratch11, S + 3, A31[0], scratch0, LSubFrameOut);
    SKP_Silk_allpass_int(scratch0, S + 4, A31[1], scratch11, LSubFrameOut);
    SKP_Silk_allpass_int(scratch12, S + 5, A30[0], scratch0, LSubFrameOut);
    SKP_Silk_allpass_int(scratch0, S + 6, A30[1], scratch12, LSubFrameOut);
    for (k = 0; k < LSubFrameOut; k++) {
      out_tmp = scratch10[k] + scratch11[k] + scratch12[k];
      if (out_tmp - limit > 0) {
        out[k] = 0x7FFF;
      } else if (out_tmp + limit < 0) {
        out[k] = ((short)0x8000);
      } else {
        out[k] =
            (short)((((out_tmp + 1560) >> 16) * (int)((short)(21))) +
                    ((((out_tmp + 1560) & 0x0000FFFF) * (int)((short)(21))) >>
                     16));
      }
    }
    in += LSubFrameIn;
    out += LSubFrameOut;
    outLen -= LSubFrameOut;
  }
}


x86 assembly (clang, -O0):
<SKP_Silk_resample_1_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7d0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x6185550,-0x34(%rbp)
mov    0xea9(%rip),%eax
mov    %eax,-0x7c4(%rbp)
mov    0xea1(%rip),%eax
mov    %eax,-0x7c8(%rbp)
mov    0xe99(%rip),%eax
mov    %eax,-0x7cc(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    1424 <SKP_Silk_resample_1_3+0x2f4>
mov    -0x24(%rbp),%esi
mov    $0x50,%edi
call   1030 <SKP_min_int@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cwtl
imul   $0x3,%eax,%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x400(%rbp),%rdx
mov    -0x28(%rbp),%ecx
call   1040 <SKP_Silk_lowpass_short@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    122d <SKP_Silk_resample_1_3+0xfd>
imul   $0x3,-0x20(%rbp),%eax
cltq
mov    -0x400(%rbp,%rax,4),%ecx
movslq -0x20(%rbp),%rax
mov    %ecx,-0x540(%rbp,%rax,4)
imul   $0x3,-0x20(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x400(%rbp,%rax,4),%ecx
movslq -0x20(%rbp),%rax
mov    %ecx,-0x680(%rbp,%rax,4)
imul   $0x3,-0x20(%rbp),%eax
add    $0x2,%eax
cltq
mov    -0x400(%rbp,%rax,4),%ecx
movslq -0x20(%rbp),%rax
mov    %ecx,-0x7c0(%rbp,%rax,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11c5 <SKP_Silk_resample_1_3+0x95>
lea    -0x540(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
mov    -0x7cc(%rbp),%ax
lea    -0x400(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
movswl %ax,%edx
call   1050 <SKP_Silk_allpass_int@plt>
lea    -0x400(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    -0x7ca(%rbp),%ax
lea    -0x540(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
movswl %ax,%edx
call   1050 <SKP_Silk_allpass_int@plt>
lea    -0x680(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0xc,%rsi
mov    -0x7c8(%rbp),%ax
lea    -0x400(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
movswl %ax,%edx
call   1050 <SKP_Silk_allpass_int@plt>
lea    -0x400(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
mov    -0x7c6(%rbp),%ax
lea    -0x680(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
movswl %ax,%edx
call   1050 <SKP_Silk_allpass_int@plt>
lea    -0x7c0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x14,%rsi
mov    -0x7c4(%rbp),%ax
lea    -0x400(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
movswl %ax,%edx
call   1050 <SKP_Silk_allpass_int@plt>
lea    -0x400(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x18,%rsi
mov    -0x7c2(%rbp),%ax
lea    -0x7c0(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
movswl %ax,%edx
call   1050 <SKP_Silk_allpass_int@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    13ea <SKP_Silk_resample_1_3+0x2ba>
movslq -0x20(%rbp),%rax
mov    -0x540(%rbp,%rax,4),%eax
movslq -0x20(%rbp),%rcx
add    -0x680(%rbp,%rcx,4),%eax
movslq -0x20(%rbp),%rcx
add    -0x7c0(%rbp,%rcx,4),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
sub    -0x34(%rbp),%eax
cmp    $0x0,%eax
jle    137c <SKP_Silk_resample_1_3+0x24c>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movw   $0x7fff,(%rax,%rcx,2)
jmp    13d7 <SKP_Silk_resample_1_3+0x2a7>
mov    -0x30(%rbp),%eax
add    -0x34(%rbp),%eax
cmp    $0x0,%eax
jge    139e <SKP_Silk_resample_1_3+0x26e>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movw   $0x8000,(%rax,%rcx,2)
jmp    13d2 <SKP_Silk_resample_1_3+0x2a2>
mov    -0x30(%rbp),%eax
add    $0x618,%eax
sar    $0x10,%eax
imul   $0x15,%eax,%eax
mov    -0x30(%rbp),%ecx
add    $0x618,%ecx
and    $0xffff,%ecx
imul   $0x15,%ecx,%ecx
sar    $0x10,%ecx
add    %ecx,%eax
mov    %ax,%dx
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
jmp    13d7 <SKP_Silk_resample_1_3+0x2a7>
jmp    13dc <SKP_Silk_resample_1_3+0x2ac>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    132a <SKP_Silk_resample_1_3+0x1fa>
mov    -0x28(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
shl    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x2c(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x2c(%rbp),%ecx
mov    -0x24(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x24(%rbp)
jmp    1183 <SKP_Silk_resample_1_3+0x53>
add    $0x7d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SKP_Silk_resample_1_3>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x7d8,%rsp
mov    %rsi,0x40(%rsp)
cmp    $0x3,%ecx
jl     155c <SKP_Silk_resample_1_3+0x42c>
mov    %rdx,%r15
mov    %rdi,%rbx
mov    %ecx,%eax
mov    $0xaaaaaaab,%r12d
imul   %rax,%r12
shr    $0x21,%r12
mov    0x40(%rsp),%rax
lea    0x4(%rax),%rcx
mov    %rcx,0x38(%rsp)
lea    0x8(%rax),%rcx
mov    %rcx,0x30(%rsp)
lea    0xc(%rax),%rcx
mov    %rcx,0x28(%rsp)
lea    0x10(%rax),%rcx
mov    %rcx,0x20(%rsp)
lea    0x14(%rax),%rcx
mov    %rcx,0x18(%rsp)
add    $0x18,%rax
mov    %rax,0x10(%rsp)
lea    0x410(%rsp),%r13
jmp    1270 <SKP_Silk_resample_1_3+0x140>
nopl   (%rax)
lea    0x2d0(%rsp),%r14
mov    %r14,%rdi
mov    0x38(%rsp),%rsi
mov    $0x2e0a,%edx
mov    %r13,%rcx
mov    %ebp,%r8d
call   1050 <SKP_Silk_allpass_int@plt>
mov    %r13,%rdi
mov    0x30(%rsp),%rsi
mov    $0x7278,%edx
mov    %r14,%rcx
mov    %ebp,%r8d
call   1050 <SKP_Silk_allpass_int@plt>
lea    0x190(%rsp),%r14
mov    %r14,%rdi
mov    0x28(%rsp),%rsi
mov    $0x134e,%edx
mov    %r13,%rcx
mov    %ebp,%r8d
call   1050 <SKP_Silk_allpass_int@plt>
mov    %r13,%rdi
mov    0x20(%rsp),%rsi
mov    $0x644d,%edx
mov    %r14,%rcx
mov    %ebp,%r8d
call   1050 <SKP_Silk_allpass_int@plt>
lea    0x50(%rsp),%r14
mov    %r14,%rdi
mov    0x18(%rsp),%rsi
mov    $0x6ed,%edx
mov    %r13,%rcx
mov    %ebp,%r8d
call   1050 <SKP_Silk_allpass_int@plt>
mov    %r13,%rdi
mov    0x10(%rsp),%rsi
mov    $0x459a,%edx
mov    %r14,%rcx
mov    %ebp,%r8d
call   1050 <SKP_Silk_allpass_int@plt>
mov    0xc(%rsp),%edi
movslq %edi,%rax
lea    (%r15,%rax,2),%r15
movslq %ebp,%rax
lea    (%rbx,%rax,2),%rbx
sub    %ebp,%r12d
jle    155c <SKP_Silk_resample_1_3+0x42c>
mov    $0x50,%edi
mov    %r12d,%esi
call   1030 <SKP_min_int@plt>
mov    %eax,%ebp
movswl %bp,%eax
lea    (%rax,%rax,2),%ecx
mov    %r15,%rdi
mov    0x40(%rsp),%rsi
mov    %r13,%rdx
mov    %ecx,0xc(%rsp)
call   1040 <SKP_Silk_lowpass_short@plt>
test   %ebp,%ebp
jle    11b0 <SKP_Silk_resample_1_3+0x80>
mov    %ebp,%r14d
cmp    $0x1,%ebp
jne    12b0 <SKP_Silk_resample_1_3+0x180>
xor    %eax,%eax
jmp    1302 <SKP_Silk_resample_1_3+0x1d2>
nopl   (%rax)
mov    %r14d,%ecx
and    $0xfffffffe,%ecx
lea    0x424(%rsp),%rdx
xor    %eax,%eax
mov    -0x14(%rdx),%esi
mov    %esi,0x2d0(%rsp,%rax,4)
mov    -0x10(%rdx),%esi
mov    %esi,0x190(%rsp,%rax,4)
mov    -0xc(%rdx),%esi
mov    %esi,0x50(%rsp,%rax,4)
mov    -0x8(%rdx),%esi
mov    %esi,0x2d4(%rsp,%rax,4)
mov    -0x4(%rdx),%esi
mov    %esi,0x194(%rsp,%rax,4)
mov    (%rdx),%esi
mov    %esi,0x54(%rsp,%rax,4)
add    $0x2,%rax
add    $0x18,%rdx
cmp    %rax,%rcx
jne    12c0 <SKP_Silk_resample_1_3+0x190>
mov    %r15,0x48(%rsp)
test   $0x1,%r14b
je     1338 <SKP_Silk_resample_1_3+0x208>
lea    (%rax,%rax,2),%rcx
mov    0x410(%rsp,%rcx,4),%edx
mov    0x414(%rsp,%rcx,4),%esi
mov    %edx,0x2d0(%rsp,%rax,4)
mov    %esi,0x190(%rsp,%rax,4)
mov    0x418(%rsp,%rcx,4),%ecx
mov    %ecx,0x50(%rsp,%rax,4)
lea    0x2d0(%rsp),%r15
mov    %r15,%rdi
mov    0x38(%rsp),%rsi
mov    $0x2e0a,%edx
mov    %r13,%rcx
mov    %ebp,%r8d
call   1050 <SKP_Silk_allpass_int@plt>
mov    %r13,%rdi
mov    0x30(%rsp),%rsi
mov    $0x7278,%edx
mov    %r15,%rcx
mov    %ebp,%r8d
call   1050 <SKP_Silk_allpass_int@plt>
lea    0x190(%rsp),%r15
mov    %r15,%rdi
mov    0x28(%rsp),%rsi
mov    $0x134e,%edx
mov    %r13,%rcx
mov    %ebp,%r8d
call   1050 <SKP_Silk_allpass_int@plt>
mov    %r13,%rdi
mov    0x20(%rsp),%rsi
mov    $0x644d,%edx
mov    %r15,%rcx
mov    %ebp,%r8d
call   1050 <SKP_Silk_allpass_int@plt>
lea    0x50(%rsp),%r15
mov    %r15,%rdi
mov    0x18(%rsp),%rsi
mov    $0x6ed,%edx
mov    %r13,%rcx
mov    %ebp,%r8d
call   1050 <SKP_Silk_allpass_int@plt>
mov    %r13,%rdi
mov    0x10(%rsp),%rsi
mov    $0x459a,%edx
mov    %r15,%rcx
mov    %ebp,%r8d
call   1050 <SKP_Silk_allpass_int@plt>
test   %ebp,%ebp
mov    0x48(%rsp),%r15
movdqa 0xc14(%rip),%xmm5
movdqa 0xc1b(%rip),%xmm8
movdqa 0xc23(%rip),%xmm7
movdqa 0xc2b(%rip),%xmm6
movdqa 0xc32(%rip),%xmm9
movdqa 0xc39(%rip),%xmm10
mov    0xc(%rsp),%edi
jle    1259 <SKP_Silk_resample_1_3+0x129>
cmp    $0x4,%ebp
jae    142d <SKP_Silk_resample_1_3+0x2fd>
xor    %eax,%eax
jmp    1511 <SKP_Silk_resample_1_3+0x3e1>
mov    %r14d,%eax
and    $0xfffffffc,%eax
lea    (%r14,%r14,1),%rcx
and    $0xfffffffffffffff8,%rcx
xor    %edx,%edx
nopl   (%rax)
movdqa 0x190(%rsp,%rdx,2),%xmm2
paddd  0x2d0(%rsp,%rdx,2),%xmm2
paddd  0x50(%rsp,%rdx,2),%xmm2
movdqa %xmm2,%xmm1
pcmpgtd %xmm5,%xmm1
packssdw %xmm1,%xmm1
movdqa %xmm8,%xmm0
pcmpgtd %xmm2,%xmm0
packssdw %xmm0,%xmm0
paddd  %xmm7,%xmm2
pshuflw $0xe8,%xmm2,%xmm3
psrad  $0x10,%xmm2
packssdw %xmm2,%xmm2
movdqa %xmm2,%xmm4
pmulhuw %xmm6,%xmm4
pmullw %xmm6,%xmm2
punpcklwd %xmm4,%xmm2
pshufhw $0xe8,%xmm3,%xmm3
pshufd $0xe8,%xmm3,%xmm3
pmulhuw %xmm6,%xmm3
punpcklwd %xmm3,%xmm3
paddd  %xmm2,%xmm3
pshuflw $0xe8,%xmm3,%xmm2
pshufhw $0xe8,%xmm2,%xmm2
pshufd $0xe8,%xmm2,%xmm2
movdqa %xmm1,%xmm3
pandn  %xmm2,%xmm3
pand   %xmm9,%xmm1
por    %xmm3,%xmm1
movdqa %xmm0,%xmm2
pandn  %xmm1,%xmm2
pand   %xmm10,%xmm0
por    %xmm2,%xmm0
movq   %xmm0,(%rbx,%rdx,1)
add    $0x8,%rdx
cmp    %rdx,%rcx
jne    1440 <SKP_Silk_resample_1_3+0x310>
cmp    %r14,%rax
jne    1511 <SKP_Silk_resample_1_3+0x3e1>
jmp    1259 <SKP_Silk_resample_1_3+0x129>
cs nopw 0x0(%rax,%rax,1)
mov    %dx,(%rbx,%rax,2)
add    $0x1,%rax
cmp    %rax,%r14
je     1259 <SKP_Silk_resample_1_3+0x129>
mov    0x190(%rsp,%rax,4),%ecx
add    0x2d0(%rsp,%rax,4),%ecx
add    0x50(%rsp,%rax,4),%ecx
mov    $0x7fff,%dx
cmp    $0x6185550,%ecx
jg     1500 <SKP_Silk_resample_1_3+0x3d0>
mov    $0x8000,%dx
cmp    $0xf9e7aab0,%ecx
jl     1500 <SKP_Silk_resample_1_3+0x3d0>
add    $0x618,%ecx
mov    %ecx,%edx
shr    $0x10,%edx
lea    (%rdx,%rdx,4),%esi
lea    (%rdx,%rsi,4),%esi
movzwl %cx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,4),%edx
shr    $0x10,%edx
add    %esi,%edx
jmp    1500 <SKP_Silk_resample_1_3+0x3d0>
add    $0x7d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.SKP_Silk_resample_1_3.A30 = [2 x i16] [i16 1773, i16 17818]
@__const.SKP_Silk_resample_1_3.A31 = [2 x i16] [i16 4942, i16 25677]
@__const.SKP_Silk_resample_1_3.A32 = [2 x i16] [i16 11786, i16 29304]
define void @SKP_Silk_resample_1_3(i16* %0, i32* %1, i16* %2, i32 %3) {
%5 = alloca i16*
%6 = alloca i32*
%7 = alloca i16*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca [240 x i32]
%16 = alloca [80 x i32]
%17 = alloca [80 x i32]
%18 = alloca [80 x i32]
%19 = alloca [2 x i16]
%20 = alloca [2 x i16]
%21 = alloca [2 x i16]
store i16* %0, i16** %5
store i32* %1, i32** %6
store i16* %2, i16** %7
store i32 %3, i32* %8
store i32 102258000, i32* %14
%22 = bitcast [2 x i16]* %19 to i8*
%23 = bitcast [2 x i16]* %20 to i8*
%24 = bitcast [2 x i16]* %21 to i8*
%25 = load i32, i32* %8
%26 = sdiv i32 %25, 3
store i32 %26, i32* %10
br label %27
27: ; preds = %184, %4
%28 = load i32, i32* %10
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %196
30: ; preds = %27
%31 = load i32, i32* %10
%32 = call i32 @SKP_min_int(i32 80, i32 %31)
store i32 %32, i32* %12
%33 = load i32, i32* %12
%34 = trunc i32 %33 to i16
%35 = sext i16 %34 to i32
%36 = mul nsw i32 3, %35
store i32 %36, i32* %11
%37 = load i16*, i16** %7
%38 = load i32*, i32** %6
%39 = getelementptr inbounds [240 x i32], [240 x i32]* %15, i64 0, i64 0
%40 = load i32, i32* %11
%41 = call i32 @SKP_Silk_lowpass_short(i16* %37, i32* %38, i32* %39, i32 %40)
store i32 0, i32* %9
br label %42
42: ; preds = %73, %30
%43 = load i32, i32* %9
%44 = load i32, i32* %12
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %76
46: ; preds = %42
%47 = load i32, i32* %9
%48 = mul nsw i32 3, %47
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [240 x i32], [240 x i32]* %15, i64 0, i64 %49
%51 = load i32, i32* %50
%52 = load i32, i32* %9
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [80 x i32], [80 x i32]* %16, i64 0, i64 %53
store i32 %51, i32* %54
%55 = load i32, i32* %9
%56 = mul nsw i32 3, %55
%57 = add nsw i32 %56, 1
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [240 x i32], [240 x i32]* %15, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = load i32, i32* %9
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [80 x i32], [80 x i32]* %17, i64 0, i64 %62
store i32 %60, i32* %63
%64 = load i32, i32* %9
%65 = mul nsw i32 3, %64
%66 = add nsw i32 %65, 2
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [240 x i32], [240 x i32]* %15, i64 0, i64 %67
%69 = load i32, i32* %68
%70 = load i32, i32* %9
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [80 x i32], [80 x i32]* %18, i64 0, i64 %71
store i32 %69, i32* %72
br label %73
73: ; preds = %46
%74 = load i32, i32* %9
%75 = add nsw i32 %74, 1
store i32 %75, i32* %9
br label %42
76: ; preds = %42
%77 = getelementptr inbounds [80 x i32], [80 x i32]* %16, i64 0, i64 0
%78 = load i32*, i32** %6
%79 = getelementptr inbounds i32, i32* %78, i64 1
%80 = getelementptr inbounds [2 x i16], [2 x i16]* %21, i64 0, i64 0
%81 = load i16, i16* %80
%82 = getelementptr inbounds [240 x i32], [240 x i32]* %15, i64 0, i64 0
%83 = load i32, i32* %12
%84 = call i32 @SKP_Silk_allpass_int(i32* %77, i32* %79, i16 signext %81, i32* %82, i32 %83)
%85 = getelementptr inbounds [240 x i32], [240 x i32]* %15, i64 0, i64 0
%86 = load i32*, i32** %6
%87 = getelementptr inbounds i32, i32* %86, i64 2
%88 = getelementptr inbounds [2 x i16], [2 x i16]* %21, i64 0, i64 1
%89 = load i16, i16* %88
%90 = getelementptr inbounds [80 x i32], [80 x i32]* %16, i64 0, i64 0
%91 = load i32, i32* %12
%92 = call i32 @SKP_Silk_allpass_int(i32* %85, i32* %87, i16 signext %89, i32* %90, i32 %91)
%93 = getelementptr inbounds [80 x i32], [80 x i32]* %17, i64 0, i64 0
%94 = load i32*, i32** %6
%95 = getelementptr inbounds i32, i32* %94, i64 3
%96 = getelementptr inbounds [2 x i16], [2 x i16]* %20, i64 0, i64 0
%97 = load i16, i16* %96
%98 = getelementptr inbounds [240 x i32], [240 x i32]* %15, i64 0, i64 0
%99 = load i32, i32* %12
%100 = call i32 @SKP_Silk_allpass_int(i32* %93, i32* %95, i16 signext %97, i32* %98, i32 %99)
%101 = getelementptr inbounds [240 x i32], [240 x i32]* %15, i64 0, i64 0
%102 = load i32*, i32** %6
%103 = getelementptr inbounds i32, i32* %102, i64 4
%104 = getelementptr inbounds [2 x i16], [2 x i16]* %20, i64 0, i64 1
%105 = load i16, i16* %104
%106 = getelementptr inbounds [80 x i32], [80 x i32]* %17, i64 0, i64 0
%107 = load i32, i32* %12
%108 = call i32 @SKP_Silk_allpass_int(i32* %101, i32* %103, i16 signext %105, i32* %106, i32 %107)
%109 = getelementptr inbounds [80 x i32], [80 x i32]* %18, i64 0, i64 0
%110 = load i32*, i32** %6
%111 = getelementptr inbounds i32, i32* %110, i64 5
%112 = getelementptr inbounds [2 x i16], [2 x i16]* %19, i64 0, i64 0
%113 = load i16, i16* %112
%114 = getelementptr inbounds [240 x i32], [240 x i32]* %15, i64 0, i64 0
%115 = load i32, i32* %12
%116 = call i32 @SKP_Silk_allpass_int(i32* %109, i32* %111, i16 signext %113, i32* %114, i32 %115)
%117 = getelementptr inbounds [240 x i32], [240 x i32]* %15, i64 0, i64 0
%118 = load i32*, i32** %6
%119 = getelementptr inbounds i32, i32* %118, i64 6
%120 = getelementptr inbounds [2 x i16], [2 x i16]* %19, i64 0, i64 1
%121 = load i16, i16* %120
%122 = getelementptr inbounds [80 x i32], [80 x i32]* %18, i64 0, i64 0
%123 = load i32, i32* %12
%124 = call i32 @SKP_Silk_allpass_int(i32* %117, i32* %119, i16 signext %121, i32* %122, i32 %123)
store i32 0, i32* %9
br label %125
125: ; preds = %181, %76
%126 = load i32, i32* %9
%127 = load i32, i32* %12
%128 = icmp slt i32 %126, %127
br i1 %128, label %129, label %184
129: ; preds = %125
%130 = load i32, i32* %9
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds [80 x i32], [80 x i32]* %16, i64 0, i64 %131
%133 = load i32, i32* %132
%134 = load i32, i32* %9
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [80 x i32], [80 x i32]* %17, i64 0, i64 %135
%137 = load i32, i32* %136
%138 = add nsw i32 %133, %137
%139 = load i32, i32* %9
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds [80 x i32], [80 x i32]* %18, i64 0, i64 %140
%142 = load i32, i32* %141
%143 = add nsw i32 %138, %142
store i32 %143, i32* %13
%144 = load i32, i32* %13
%145 = load i32, i32* %14
%146 = sub nsw i32 %144, %145
%147 = icmp sgt i32 %146, 0
br i1 %147, label %148, label %153
148: ; preds = %129
%149 = load i16*, i16** %5
%150 = load i32, i32* %9
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds i16, i16* %149, i64 %151
store i16 32767, i16* %152
br label %180
153: ; preds = %129
%154 = load i32, i32* %13
%155 = load i32, i32* %14
%156 = add nsw i32 %154, %155
%157 = icmp slt i32 %156, 0
br i1 %157, label %158, label %163
158: ; preds = %153
%159 = load i16*, i16** %5
%160 = load i32, i32* %9
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds i16, i16* %159, i64 %161
store i16 -32768, i16* %162
br label %179
163: ; preds = %153
%164 = load i32, i32* %13
%165 = add nsw i32 %164, 1560
%166 = ashr i32 %165, 16
%167 = mul nsw i32 %166, 21
%168 = load i32, i32* %13
%169 = add nsw i32 %168, 1560
%170 = and i32 %169, 65535
%171 = mul nsw i32 %170, 21
%172 = ashr i32 %171, 16
%173 = add nsw i32 %167, %172
%174 = trunc i32 %173 to i16
%175 = load i16*, i16** %5
%176 = load i32, i32* %9
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds i16, i16* %175, i64 %177
store i16 %174, i16* %178
br label %179
179: ; preds = %163, %158
br label %180
180: ; preds = %179, %148
br label %181
181: ; preds = %180
%182 = load i32, i32* %9
%183 = add nsw i32 %182, 1
store i32 %183, i32* %9
br label %125
184: ; preds = %125
%185 = load i32, i32* %11
%186 = load i16*, i16** %7
%187 = sext i32 %185 to i64
%188 = getelementptr inbounds i16, i16* %186, i64 %187
store i16* %188, i16** %7
%189 = load i32, i32* %12
%190 = load i16*, i16** %5
%191 = sext i32 %189 to i64
%192 = getelementptr inbounds i16, i16* %190, i64 %191
store i16* %192, i16** %5
%193 = load i32, i32* %12
%194 = load i32, i32* %10
%195 = sub nsw i32 %194, %193
store i32 %195, i32* %10
br label %27
196: ; preds = %27
ret void
}

LLVM IR (-O2):
define void @SKP_Silk_resample_1_3(i16* nocapture writeonly %0, i32* %1, i16* %2, i32 %3) {
%5 = alloca [240 x i32]
%6 = alloca [80 x i32]
%7 = alloca [80 x i32]
%8 = alloca [80 x i32]
%9 = bitcast [240 x i32]* %5 to i8*
%10 = bitcast [80 x i32]* %6 to i8*
%11 = bitcast [80 x i32]* %7 to i8*
%12 = bitcast [80 x i32]* %8 to i8*
%13 = icmp sgt i32 %3, 2
br i1 %13, label %14, label %175
14: ; preds = %4
%15 = udiv i32 %3, 3
%16 = getelementptr inbounds [240 x i32], [240 x i32]* %5, i64 0, i64 0
%17 = getelementptr inbounds [80 x i32], [80 x i32]* %6, i64 0, i64 0
%18 = getelementptr inbounds i32, i32* %1, i64 1
%19 = getelementptr inbounds i32, i32* %1, i64 2
%20 = getelementptr inbounds [80 x i32], [80 x i32]* %7, i64 0, i64 0
%21 = getelementptr inbounds i32, i32* %1, i64 3
%22 = getelementptr inbounds i32, i32* %1, i64 4
%23 = getelementptr inbounds [80 x i32], [80 x i32]* %8, i64 0, i64 0
%24 = getelementptr inbounds i32, i32* %1, i64 5
%25 = getelementptr inbounds i32, i32* %1, i64 6
br label %26
26: ; preds = %14, %168
%27 = phi i16* [ %0, %14 ], [ %172, %168 ]
%28 = phi i16* [ %2, %14 ], [ %170, %168 ]
%29 = phi i32 [ %15, %14 ], [ %173, %168 ]
%30 = call i32 @SKP_min_int(i32 80, i32 %29)
%31 = shl i32 %30, 16
%32 = ashr exact i32 %31, 16
%33 = mul nsw i32 %32, 3
%34 = call i32 @SKP_Silk_lowpass_short(i16* %28, i32* %1, i32* %16, i32 %33)
%35 = icmp sgt i32 %30, 0
br i1 %35, label %36, label %161
36: ; preds = %26
%37 = zext i32 %30 to i64
%38 = and i64 %37, 1
%39 = icmp eq i32 %30, 1
br i1 %39, label %73, label %40
40: ; preds = %36
%41 = and i64 %37, 4294967294
br label %42
42: ; preds = %42, %40
%43 = phi i64 [ 0, %40 ], [ %70, %42 ]
%44 = phi i64 [ 0, %40 ], [ %71, %42 ]
%45 = mul nuw nsw i64 %43, 3
%46 = getelementptr inbounds [240 x i32], [240 x i32]* %5, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = getelementptr inbounds [80 x i32], [80 x i32]* %6, i64 0, i64 %43
store i32 %47, i32* %48
%49 = or i64 %45, 1
%50 = getelementptr inbounds [240 x i32], [240 x i32]* %5, i64 0, i64 %49
%51 = load i32, i32* %50
%52 = getelementptr inbounds [80 x i32], [80 x i32]* %7, i64 0, i64 %43
store i32 %51, i32* %52
%53 = add nuw nsw i64 %45, 2
%54 = getelementptr inbounds [240 x i32], [240 x i32]* %5, i64 0, i64 %53
%55 = load i32, i32* %54
%56 = getelementptr inbounds [80 x i32], [80 x i32]* %8, i64 0, i64 %43
store i32 %55, i32* %56
%57 = or i64 %43, 1
%58 = mul nuw nsw i64 %57, 3
%59 = getelementptr inbounds [240 x i32], [240 x i32]* %5, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = getelementptr inbounds [80 x i32], [80 x i32]* %6, i64 0, i64 %57
store i32 %60, i32* %61
%62 = add nuw nsw i64 %58, 1
%63 = getelementptr inbounds [240 x i32], [240 x i32]* %5, i64 0, i64 %62
%64 = load i32, i32* %63
%65 = getelementptr inbounds [80 x i32], [80 x i32]* %7, i64 0, i64 %57
store i32 %64, i32* %65
%66 = add nuw nsw i64 %58, 2
%67 = getelementptr inbounds [240 x i32], [240 x i32]* %5, i64 0, i64 %66
%68 = load i32, i32* %67
%69 = getelementptr inbounds [80 x i32], [80 x i32]* %8, i64 0, i64 %57
store i32 %68, i32* %69
%70 = add nuw nsw i64 %43, 2
%71 = add i64 %44, 2
%72 = icmp eq i64 %71, %41
br i1 %72, label %73, label %42
73: ; preds = %42, %36
%74 = phi i64 [ 0, %36 ], [ %70, %42 ]
%75 = icmp eq i64 %38, 0
br i1 %75, label %89, label %76
76: ; preds = %73
%77 = mul nuw nsw i64 %74, 3
%78 = getelementptr inbounds [240 x i32], [240 x i32]* %5, i64 0, i64 %77
%79 = load i32, i32* %78
%80 = getelementptr inbounds [80 x i32], [80 x i32]* %6, i64 0, i64 %74
store i32 %79, i32* %80
%81 = add nuw nsw i64 %77, 1
%82 = getelementptr inbounds [240 x i32], [240 x i32]* %5, i64 0, i64 %81
%83 = load i32, i32* %82
%84 = getelementptr inbounds [80 x i32], [80 x i32]* %7, i64 0, i64 %74
store i32 %83, i32* %84
%85 = add nuw nsw i64 %77, 2
%86 = getelementptr inbounds [240 x i32], [240 x i32]* %5, i64 0, i64 %85
%87 = load i32, i32* %86
%88 = getelementptr inbounds [80 x i32], [80 x i32]* %8, i64 0, i64 %74
store i32 %87, i32* %88
br label %89
89: ; preds = %73, %76
%90 = call i32 @SKP_Silk_allpass_int(i32* %17, i32* %18, i16 signext 11786, i32* %16, i32 %30)
%91 = call i32 @SKP_Silk_allpass_int(i32* %16, i32* %19, i16 signext 29304, i32* %17, i32 %30)
%92 = call i32 @SKP_Silk_allpass_int(i32* %20, i32* %21, i16 signext 4942, i32* %16, i32 %30)
%93 = call i32 @SKP_Silk_allpass_int(i32* %16, i32* %22, i16 signext 25677, i32* %20, i32 %30)
%94 = call i32 @SKP_Silk_allpass_int(i32* %23, i32* %24, i16 signext 1773, i32* %16, i32 %30)
%95 = call i32 @SKP_Silk_allpass_int(i32* %16, i32* %25, i16 signext 17818, i32* %23, i32 %30)
br i1 %35, label %96, label %168
96: ; preds = %89
%97 = zext i32 %30 to i64
%98 = icmp ult i32 %30, 4
br i1 %98, label %132, label %99
99: ; preds = %96
%100 = and i64 %37, 4294967292
br label %101
101: ; preds = %101, %99
%102 = phi i64 [ 0, %99 ], [ %128, %101 ]
%103 = getelementptr inbounds [80 x i32], [80 x i32]* %6, i64 0, i64 %102
%104 = bitcast i32* %103 to <4 x i32>*
%105 = load <4 x i32>, <4 x i32>* %104
%106 = getelementptr inbounds [80 x i32], [80 x i32]* %7, i64 0, i64 %102
%107 = bitcast i32* %106 to <4 x i32>*
%108 = load <4 x i32>, <4 x i32>* %107
%109 = add nsw <4 x i32> %108, %105
%110 = getelementptr inbounds [80 x i32], [80 x i32]* %8, i64 0, i64 %102
%111 = bitcast i32* %110 to <4 x i32>*
%112 = load <4 x i32>, <4 x i32>* %111
%113 = add nsw <4 x i32> %109, %112
%114 = icmp sgt <4 x i32> %113, <i32 102258000, i32 102258000, i32 102258000, i32 102258000>
%115 = icmp slt <4 x i32> %113, <i32 -102258000, i32 -102258000, i32 -102258000, i32 -102258000>
%116 = add nsw <4 x i32> %113, <i32 1560, i32 1560, i32 1560, i32 1560>
%117 = ashr <4 x i32> %116, <i32 16, i32 16, i32 16, i32 16>
%118 = mul nsw <4 x i32> %117, <i32 21, i32 21, i32 21, i32 21>
%119 = and <4 x i32> %116, <i32 65535, i32 65535, i32 65535, i32 65535>
%120 = mul nuw nsw <4 x i32> %119, <i32 21, i32 21, i32 21, i32 21>
%121 = lshr <4 x i32> %120, <i32 16, i32 16, i32 16, i32 16>
%122 = add nsw <4 x i32> %121, %118
%123 = trunc <4 x i32> %122 to <4 x i16>
%124 = select <4 x i1> %114, <4 x i16> <i16 32767, i16 32767, i16 32767, i16 32767>, <4 x i16> %123
%125 = select <4 x i1> %115, <4 x i16> <i16 -32768, i16 -32768, i16 -32768, i16 -32768>, <4 x i16> %124
%126 = getelementptr inbounds i16, i16* %27, i64 %102
%127 = bitcast i16* %126 to <4 x i16>*
store <4 x i16> %125, <4 x i16>* %127
%128 = add nuw i64 %102, 4
%129 = icmp eq i64 %128, %100
br i1 %129, label %130, label %101
130: ; preds = %101
%131 = icmp eq i64 %100, %37
br i1 %131, label %168, label %132
132: ; preds = %96, %130
%133 = phi i64 [ 0, %96 ], [ %100, %130 ]
br label %134
134: ; preds = %132, %156
%135 = phi i64 [ %159, %156 ], [ %133, %132 ]
%136 = getelementptr inbounds [80 x i32], [80 x i32]* %6, i64 0, i64 %135
%137 = load i32, i32* %136
%138 = getelementptr inbounds [80 x i32], [80 x i32]* %7, i64 0, i64 %135
%139 = load i32, i32* %138
%140 = add nsw i32 %139, %137
%141 = getelementptr inbounds [80 x i32], [80 x i32]* %8, i64 0, i64 %135
%142 = load i32, i32* %141
%143 = add nsw i32 %140, %142
%144 = icmp sgt i32 %143, 102258000
br i1 %144, label %156, label %145
145: ; preds = %134
%146 = icmp slt i32 %143, -102258000
br i1 %146, label %156, label %147
147: ; preds = %145
%148 = add nsw i32 %143, 1560
%149 = ashr i32 %148, 16
%150 = mul nsw i32 %149, 21
%151 = and i32 %148, 65535
%152 = mul nuw nsw i32 %151, 21
%153 = lshr i32 %152, 16
%154 = add nsw i32 %153, %150
%155 = trunc i32 %154 to i16
br label %156
156: ; preds = %145, %134, %147
%157 = phi i16 [ %155, %147 ], [ 32767, %134 ], [ -32768, %145 ]
%158 = getelementptr inbounds i16, i16* %27, i64 %135
store i16 %157, i16* %158
%159 = add nuw nsw i64 %135, 1
%160 = icmp eq i64 %159, %97
br i1 %160, label %168, label %134
161: ; preds = %26
%162 = call i32 @SKP_Silk_allpass_int(i32* %17, i32* %18, i16 signext 11786, i32* %16, i32 %30)
%163 = call i32 @SKP_Silk_allpass_int(i32* %16, i32* %19, i16 signext 29304, i32* %17, i32 %30)
%164 = call i32 @SKP_Silk_allpass_int(i32* %20, i32* %21, i16 signext 4942, i32* %16, i32 %30)
%165 = call i32 @SKP_Silk_allpass_int(i32* %16, i32* %22, i16 signext 25677, i32* %20, i32 %30)
%166 = call i32 @SKP_Silk_allpass_int(i32* %23, i32* %24, i16 signext 1773, i32* %16, i32 %30)
%167 = call i32 @SKP_Silk_allpass_int(i32* %16, i32* %25, i16 signext 17818, i32* %23, i32 %30)
br label %168
168: ; preds = %156, %130, %161, %89
%169 = sext i32 %33 to i64
%170 = getelementptr inbounds i16, i16* %28, i64 %169
%171 = sext i32 %30 to i64
%172 = getelementptr inbounds i16, i16* %27, i64 %171
%173 = sub nsw i32 %29, %30
%174 = icmp sgt i32 %173, 0
br i1 %174, label %26, label %175
175: ; preds = %168, %4
ret void
}