// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/SteerablePyramid.cpp
// Function: SteerablePyramid::DoOneStepWaveletAnalysis(double*, int)
void SteerablePyramid::DoOneStepWaveletAnalysis(Float_t* pixelValues, int level)
{
	int horDim = width_ / pow(2, level);
	int verDim = height_ / pow(2, level);
	
	for (int i = 0; i < verDim; i++)
		yLookup_[i] = i * horDim;
	
	Float_t *l0OriginalCoeffs = NULL;
	
	const Float_t *pixelPtr;
	Float_t *coeffPtr;
	
	if (level == 0)
	{
		ConvolveImage(pixelValues, horDim, verDim, skFilters[0], skFilterDims[0], h0Coeffs_, true);
		
		l0OriginalCoeffs = new Float_t[horDim * verDim];
		assert(l0OriginalCoeffs);
		ConvolveImage(pixelValues, horDim, verDim, skFilters[1], skFilterDims[1], l0OriginalCoeffs, true);
	}
	else l0OriginalCoeffs = l1Coeffs_[level - 1];
	
	ConvolveImage((const Float_t*)l0OriginalCoeffs, horDim, verDim, skFilters[3], skFilterDims[3], b1Coeffs_[level], true);
	ConvolveImage((const Float_t*)l0OriginalCoeffs, horDim, verDim, skFilters[4], skFilterDims[4], b2Coeffs_[level], true);
	ConvolveImage((const Float_t*)l0OriginalCoeffs, horDim, verDim, skFilters[5], skFilterDims[5], b3Coeffs_[level], true);
	ConvolveImage((const Float_t*)l0OriginalCoeffs, horDim, verDim, skFilters[6], skFilterDims[6], b4Coeffs_[level], true);
	ConvolveImage((const Float_t*)l0OriginalCoeffs, horDim, verDim, skFilters[2], skFilterDims[2], pixelValues, true);
	
	coeffPtr = l1Coeffs_[level];
	for (int y = 0; y < verDim / 2; y++)
	{
		pixelPtr = &pixelValues[(y * 2) * horDim];
		for (int x = 0; x < horDim / 2; x++)
		{
			*coeffPtr++ = *pixelPtr;
			pixelPtr += 2;
		}
	}
	
	if (level == 0)
		delete [] l0OriginalCoeffs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r13
cvtsi2sdl 0x30(%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0xd083(%rip), %xmm0     # 0x2a058
movl %edx, %edi
callq 0x3410
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
cvttsd2si %xmm1, %r15d
xorps %xmm0, %xmm0
cvtsi2sdl 0x34(%r13), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0xd056(%rip), %xmm0     # 0x2a058
movl %ebx, %edi
callq 0x3410
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
cvttsd2si %xmm1, %r12d
testl %r12d, %r12d
jle 0x1d0c7
movq 0x40(%r13), %rax
movl %r12d, %edx
leal 0x1(%r12), %ecx
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl %ecx
shlq $0x3, %rcx
leal (%r15,%r15), %edx
movdqa 0x10184(%rip), %xmm1    # 0x2d1d0
xorl %esi, %esi
movdqa 0x1018a(%rip), %xmm2    # 0x2d1e0
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x1018a(%rip), %xmm4    # 0x2d1f0
xorl %edi, %edi
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %r8d
notl %r8d
testb $0x1, %r8b
je 0x1d09f
movl %esi, (%rax,%rdi)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %r8d
testb $0x1, %r8b
je 0x1d0b8
leal (%r15,%rsi), %r8d
movl %r8d, 0x4(%rax,%rdi)
paddq %xmm4, %xmm1
addq $0x8, %rdi
addl %edx, %esi
cmpq %rdi, %rcx
jne 0x1d068
testl %ebx, %ebx
movl %ebx, 0x14(%rsp)
je 0x1d0dd
movq 0x28(%r13), %rax
movslq %ebx, %rbx
movq -0x8(%rax,%rbx,8), %rbp
jmp 0x1d157
movq 0x1ca3c(%rip), %r8      # 0x39b20
movl 0x1ca15(%rip), %r9d     # 0x39b00
movl $0x1, %ebx
movq %r13, %rdi
movq %r14, %rsi
movl %r15d, %edx
movl %r12d, %ecx
pushq %rbx
pushq (%r13)
callq 0x1c474
addq $0x10, %rsp
movl %r12d, %eax
imull %r15d, %eax
cltq
leaq (,%rax,8), %rcx
testl %eax, %eax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x3030
movq %rax, %rbp
movq 0x1c9f1(%rip), %r8      # 0x39b28
movl 0x1c9c6(%rip), %r9d     # 0x39b04
movq %r13, %rdi
movq %r14, %rsi
movl %r15d, %edx
movl %r12d, %ecx
pushq %rbx
pushq %rax
callq 0x1c474
addq $0x10, %rsp
xorl %ebx, %ebx
movq 0x1c9da(%rip), %r8      # 0x39b38
movl 0x1c9a7(%rip), %r9d     # 0x39b0c
movq 0x8(%r13), %rax
movl $0x1, %r10d
movq %r13, %rdi
movq %rbp, %rsi
movl %r15d, %edx
movl %r12d, %ecx
pushq %r10
pushq (%rax,%rbx,8)
callq 0x1c474
addq $0x10, %rsp
movq 0x1c9b0(%rip), %r8      # 0x39b40
movl 0x1c979(%rip), %r9d     # 0x39b10
movq 0x10(%r13), %rax
movq %r13, %rdi
movq %rbp, %rsi
movl %r15d, %edx
movl %r12d, %ecx
movl $0x1, %r10d
pushq %r10
pushq (%rax,%rbx,8)
callq 0x1c474
addq $0x10, %rsp
movq 0x1c986(%rip), %r8      # 0x39b48
movl 0x1c94b(%rip), %r9d     # 0x39b14
movq 0x18(%r13), %rax
movq %r13, %rdi
movq %rbp, %rsi
movl %r15d, %edx
movl %r12d, %ecx
movl $0x1, %r10d
pushq %r10
pushq (%rax,%rbx,8)
callq 0x1c474
addq $0x10, %rsp
movq 0x1c95c(%rip), %r8      # 0x39b50
movl 0x1c91d(%rip), %r9d     # 0x39b18
movq 0x20(%r13), %rax
movq %r13, %rdi
movq %rbp, %rsi
movl %r15d, %edx
movl %r12d, %ecx
movl $0x1, %r10d
pushq %r10
pushq (%rax,%rbx,8)
callq 0x1c474
addq $0x10, %rsp
movq 0x1c90a(%rip), %r8      # 0x39b30
movl 0x1c8db(%rip), %r9d     # 0x39b08
movq %r13, %rdi
movq %rbp, %rsi
movl %r15d, %edx
movl %r12d, %ecx
movl $0x1, %eax
pushq %rax
pushq %r14
callq 0x1c474
addq $0x10, %rsp
cmpl $0x2, %r12d
jl 0x1d29e
shrl %r12d
movq 0x28(%r13), %rax
movq (%rax,%rbx,8), %rax
leal (%r15,%r15), %ecx
movl %r15d, %edx
shrl $0x1f, %edx
addl %r15d, %edx
sarl %edx
xorl %esi, %esi
cmpl $0x2, %r15d
jl 0x1d296
movl %ecx, %edi
imull %esi, %edi
movslq %edi, %rdi
leaq (%r14,%rdi,8), %rdi
movl %edx, %r8d
movsd (%rdi), %xmm0
movsd %xmm0, (%rax)
addq $0x8, %rax
addq $0x10, %rdi
decl %r8d
jne 0x1d281
incq %rsi
cmpq %r12, %rsi
jne 0x1d26c
cmpl $0x0, 0x14(%rsp)
jne 0x1d2c0
testq %rbp, %rbp
je 0x1d2c0
movq %rbp, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x33c0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop