#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*/ qmf_even(double *, int, double *, int);
int /*<<< orphan*/ wrev(double *, int, double *, int);
void orth_filt_group(double *filterIn, int sigInLength, double *filterLowRec,
                     double *filterLowDec, double *filterHiRec,
                     double *filterHiDec) {
  int count;
  for (count = 0; count < sigInLength; count++)
    filterLowRec[count] = filterIn[count];
  wrev(filterLowRec, sigInLength, filterLowDec, sigInLength);
  qmf_even(filterLowRec, sigInLength, filterHiRec, sigInLength);
  wrev(filterHiRec, sigInLength, filterHiDec, sigInLength);
  return;
}


x86 assembly (clang, -O0):
<orth_filt_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117a <orth_filt_group+0x5a>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1146 <orth_filt_group+0x26>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0xc(%rbp),%ecx
call   1030 <wrev@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    -0xc(%rbp),%ecx
call   1040 <qmf_even@plt>
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x30(%rbp),%rdx
mov    -0xc(%rbp),%ecx
call   1030 <wrev@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orth_filt_group>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r9,%r14
mov    %r8,%r15
mov    %rdx,%rbx
mov    %esi,%r12d
test   %esi,%esi
jle    12a4 <orth_filt_group+0x184>
mov    %r12d,%r9d
cmp    $0x4,%r12d
jb     1157 <orth_filt_group+0x37>
lea    (%rdi,%r9,8),%rax
cmp    %rbx,%rax
jbe    11cc <orth_filt_group+0xac>
lea    (%rbx,%r9,8),%rax
cmp    %rdi,%rax
jbe    11cc <orth_filt_group+0xac>
xor    %edx,%edx
mov    %rdx,%rsi
not    %rsi
add    %r9,%rsi
mov    %r9,%rax
and    $0x3,%rax
je     1184 <orth_filt_group+0x64>
nopl   0x0(%rax,%rax,1)
movsd  (%rdi,%rdx,8),%xmm0
movsd  %xmm0,(%rbx,%rdx,8)
add    $0x1,%rdx
add    $0xffffffffffffffff,%rax
jne    1170 <orth_filt_group+0x50>
cmp    $0x3,%rsi
jb     12a4 <orth_filt_group+0x184>
xchg   %ax,%ax
movsd  (%rdi,%rdx,8),%xmm0
movsd  %xmm0,(%rbx,%rdx,8)
movsd  0x8(%rdi,%rdx,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rdx,8)
movsd  0x10(%rdi,%rdx,8),%xmm0
movsd  %xmm0,0x10(%rbx,%rdx,8)
movsd  0x18(%rdi,%rdx,8),%xmm0
movsd  %xmm0,0x18(%rbx,%rdx,8)
add    $0x4,%rdx
cmp    %rdx,%r9
jne    1190 <orth_filt_group+0x70>
jmp    12a4 <orth_filt_group+0x184>
mov    %r9d,%edx
and    $0xfffffffc,%edx
lea    -0x4(%rdx),%rax
mov    %rax,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%r8d
and    $0x3,%r8d
cmp    $0xc,%rax
jae    11f2 <orth_filt_group+0xd2>
xor    %ebp,%ebp
jmp    1258 <orth_filt_group+0x138>
and    $0xfffffffffffffffc,%rsi
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movups (%rdi,%rbp,8),%xmm0
movups 0x10(%rdi,%rbp,8),%xmm1
movups %xmm0,(%rbx,%rbp,8)
movups %xmm1,0x10(%rbx,%rbp,8)
movups 0x20(%rdi,%rbp,8),%xmm0
movups 0x30(%rdi,%rbp,8),%xmm1
movups %xmm0,0x20(%rbx,%rbp,8)
movups %xmm1,0x30(%rbx,%rbp,8)
movups 0x40(%rdi,%rbp,8),%xmm0
movups 0x50(%rdi,%rbp,8),%xmm1
movups %xmm0,0x40(%rbx,%rbp,8)
movups %xmm1,0x50(%rbx,%rbp,8)
movups 0x60(%rdi,%rbp,8),%xmm0
movups 0x70(%rdi,%rbp,8),%xmm1
movups %xmm0,0x60(%rbx,%rbp,8)
movups %xmm1,0x70(%rbx,%rbp,8)
add    $0x10,%rbp
add    $0xfffffffffffffffc,%rsi
jne    1200 <orth_filt_group+0xe0>
test   %r8,%r8
je     129b <orth_filt_group+0x17b>
lea    (%rbx,%rbp,8),%rax
add    $0x10,%rax
lea    (%rdi,%rbp,8),%rsi
add    $0x10,%rsi
shl    $0x5,%r8
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movups -0x10(%rsi,%rbp,1),%xmm0
movups (%rsi,%rbp,1),%xmm1
movups %xmm0,-0x10(%rax,%rbp,1)
movups %xmm1,(%rax,%rbp,1)
add    $0x20,%rbp
cmp    %rbp,%r8
jne    1280 <orth_filt_group+0x160>
cmp    %r9,%rdx
jne    1159 <orth_filt_group+0x39>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %rcx,%rdx
mov    %r12d,%ecx
call   1030 <wrev@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %r15,%rdx
mov    %r12d,%ecx
call   1040 <qmf_even@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %r14,%rdx
mov    %r12d,%ecx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <wrev@plt>

LLVM IR (-O0):
define void @orth_filt_group(double* %0, i32 %1, double* %2, double* %3, double* %4, double* %5) {
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
store double* %0, double** %7
store i32 %1, i32* %8
store double* %2, double** %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
store i32 0, i32* %13
br label %14
14: ; preds = %28, %6
%15 = load i32, i32* %13
%16 = load i32, i32* %8
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %31
18: ; preds = %14
%19 = load double*, double** %7
%20 = load i32, i32* %13
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = load double, double* %22
%24 = load double*, double** %9
%25 = load i32, i32* %13
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
store double %23, double* %27
br label %28
28: ; preds = %18
%29 = load i32, i32* %13
%30 = add nsw i32 %29, 1
store i32 %30, i32* %13
br label %14
31: ; preds = %14
%32 = load double*, double** %9
%33 = load i32, i32* %8
%34 = load double*, double** %10
%35 = load i32, i32* %8
%36 = call i32 @wrev(double* %32, i32 %33, double* %34, i32 %35)
%37 = load double*, double** %9
%38 = load i32, i32* %8
%39 = load double*, double** %11
%40 = load i32, i32* %8
%41 = call i32 @qmf_even(double* %37, i32 %38, double* %39, i32 %40)
%42 = load double*, double** %11
%43 = load i32, i32* %8
%44 = load double*, double** %12
%45 = load i32, i32* %8
%46 = call i32 @wrev(double* %42, i32 %43, double* %44, i32 %45)
ret void
}

LLVM IR (-O2):
define void @orth_filt_group(double* nocapture %0, i32 %1, double* %2, double* %3, double* %4, double* %5) {
%7 = icmp sgt i32 %1, 0
br i1 %7, label %8, label %133
8: ; preds = %6
%9 = zext i32 %1 to i64
%10 = icmp ult i32 %1, 4
br i1 %10, label %96, label %11
11: ; preds = %8
%12 = getelementptr double, double* %2, i64 %9
%13 = getelementptr double, double* %0, i64 %9
%14 = icmp ugt double* %13, %2
%15 = icmp ugt double* %12, %0
%16 = and i1 %14, %15
br i1 %16, label %96, label %17
17: ; preds = %11
%18 = and i64 %9, 4294967292
%19 = add nsw i64 %18, -4
%20 = lshr exact i64 %19, 2
%21 = add nuw nsw i64 %20, 1
%22 = and i64 %21, 3
%23 = icmp ult i64 %19, 12
br i1 %23, label %75, label %24
24: ; preds = %17
%25 = and i64 %21, 9223372036854775804
br label %26
26: ; preds = %26, %24
%27 = phi i64 [ 0, %24 ], [ %72, %26 ]
%28 = phi i64 [ 0, %24 ], [ %73, %26 ]
%29 = getelementptr inbounds double, double* %0, i64 %27
%30 = bitcast double* %29 to <2 x double>*
%31 = load <2 x double>, <2 x double>* %30
%32 = getelementptr inbounds double, double* %29, i64 2
%33 = bitcast double* %32 to <2 x double>*
%34 = load <2 x double>, <2 x double>* %33
%35 = getelementptr inbounds double, double* %2, i64 %27
%36 = bitcast double* %35 to <2 x double>*
store <2 x double> %31, <2 x double>* %36
%37 = getelementptr inbounds double, double* %35, i64 2
%38 = bitcast double* %37 to <2 x double>*
store <2 x double> %34, <2 x double>* %38
%39 = or i64 %27, 4
%40 = getelementptr inbounds double, double* %0, i64 %39
%41 = bitcast double* %40 to <2 x double>*
%42 = load <2 x double>, <2 x double>* %41
%43 = getelementptr inbounds double, double* %40, i64 2
%44 = bitcast double* %43 to <2 x double>*
%45 = load <2 x double>, <2 x double>* %44
%46 = getelementptr inbounds double, double* %2, i64 %39
%47 = bitcast double* %46 to <2 x double>*
store <2 x double> %42, <2 x double>* %47
%48 = getelementptr inbounds double, double* %46, i64 2
%49 = bitcast double* %48 to <2 x double>*
store <2 x double> %45, <2 x double>* %49
%50 = or i64 %27, 8
%51 = getelementptr inbounds double, double* %0, i64 %50
%52 = bitcast double* %51 to <2 x double>*
%53 = load <2 x double>, <2 x double>* %52
%54 = getelementptr inbounds double, double* %51, i64 2
%55 = bitcast double* %54 to <2 x double>*
%56 = load <2 x double>, <2 x double>* %55
%57 = getelementptr inbounds double, double* %2, i64 %50
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> %53, <2 x double>* %58
%59 = getelementptr inbounds double, double* %57, i64 2
%60 = bitcast double* %59 to <2 x double>*
store <2 x double> %56, <2 x double>* %60
%61 = or i64 %27, 12
%62 = getelementptr inbounds double, double* %0, i64 %61
%63 = bitcast double* %62 to <2 x double>*
%64 = load <2 x double>, <2 x double>* %63
%65 = getelementptr inbounds double, double* %62, i64 2
%66 = bitcast double* %65 to <2 x double>*
%67 = load <2 x double>, <2 x double>* %66
%68 = getelementptr inbounds double, double* %2, i64 %61
%69 = bitcast double* %68 to <2 x double>*
store <2 x double> %64, <2 x double>* %69
%70 = getelementptr inbounds double, double* %68, i64 2
%71 = bitcast double* %70 to <2 x double>*
store <2 x double> %67, <2 x double>* %71
%72 = add nuw i64 %27, 16
%73 = add nuw i64 %28, 4
%74 = icmp eq i64 %73, %25
br i1 %74, label %75, label %26
75: ; preds = %26, %17
%76 = phi i64 [ 0, %17 ], [ %72, %26 ]
%77 = icmp eq i64 %22, 0
br i1 %77, label %94, label %78
78: ; preds = %75, %78
%79 = phi i64 [ %91, %78 ], [ %76, %75 ]
%80 = phi i64 [ %92, %78 ], [ 0, %75 ]
%81 = getelementptr inbounds double, double* %0, i64 %79
%82 = bitcast double* %81 to <2 x double>*
%83 = load <2 x double>, <2 x double>* %82
%84 = getelementptr inbounds double, double* %81, i64 2
%85 = bitcast double* %84 to <2 x double>*
%86 = load <2 x double>, <2 x double>* %85
%87 = getelementptr inbounds double, double* %2, i64 %79
%88 = bitcast double* %87 to <2 x double>*
store <2 x double> %83, <2 x double>* %88
%89 = getelementptr inbounds double, double* %87, i64 2
%90 = bitcast double* %89 to <2 x double>*
store <2 x double> %86, <2 x double>* %90
%91 = add nuw i64 %79, 4
%92 = add i64 %80, 1
%93 = icmp eq i64 %92, %22
br i1 %93, label %94, label %78
94: ; preds = %78, %75
%95 = icmp eq i64 %18, %9
br i1 %95, label %133, label %96
96: ; preds = %11, %8, %94
%97 = phi i64 [ 0, %11 ], [ 0, %8 ], [ %18, %94 ]
%98 = xor i64 %97, -1
%99 = add nsw i64 %98, %9
%100 = and i64 %9, 3
%101 = icmp eq i64 %100, 0
br i1 %101, label %111, label %102
102: ; preds = %96, %102
%103 = phi i64 [ %108, %102 ], [ %97, %96 ]
%104 = phi i64 [ %109, %102 ], [ 0, %96 ]
%105 = getelementptr inbounds double, double* %0, i64 %103
%106 = load double, double* %105
%107 = getelementptr inbounds double, double* %2, i64 %103
store double %106, double* %107
%108 = add nuw nsw i64 %103, 1
%109 = add i64 %104, 1
%110 = icmp eq i64 %109, %100
br i1 %110, label %111, label %102
111: ; preds = %102, %96
%112 = phi i64 [ %97, %96 ], [ %108, %102 ]
%113 = icmp ult i64 %99, 3
br i1 %113, label %133, label %114
114: ; preds = %111, %114
%115 = phi i64 [ %131, %114 ], [ %112, %111 ]
%116 = getelementptr inbounds double, double* %0, i64 %115
%117 = load double, double* %116
%118 = getelementptr inbounds double, double* %2, i64 %115
store double %117, double* %118
%119 = add nuw nsw i64 %115, 1
%120 = getelementptr inbounds double, double* %0, i64 %119
%121 = load double, double* %120
%122 = getelementptr inbounds double, double* %2, i64 %119
store double %121, double* %122
%123 = add nuw nsw i64 %115, 2
%124 = getelementptr inbounds double, double* %0, i64 %123
%125 = load double, double* %124
%126 = getelementptr inbounds double, double* %2, i64 %123
store double %125, double* %126
%127 = add nuw nsw i64 %115, 3
%128 = getelementptr inbounds double, double* %0, i64 %127
%129 = load double, double* %128
%130 = getelementptr inbounds double, double* %2, i64 %127
store double %129, double* %130
%131 = add nuw nsw i64 %115, 4
%132 = icmp eq i64 %131, %9
br i1 %132, label %133, label %114
133: ; preds = %111, %114, %94, %6
%134 = tail call i32 @wrev(double* %2, i32 %1, double* %3, i32 %1)
%135 = tail call i32 @qmf_even(double* %2, i32 %1, double* %4, i32 %1)
%136 = tail call i32 @wrev(double* %4, i32 %1, double* %5, i32 %1)
ret void
}