// File: /workspace/github_cpp_makefile_star2_O2/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 $0x28, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
cvtsi2sdl 0x30(%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0xad9b(%rip), %xmm0     # 0x22058
movl %edx, %edi
callq 0x33f0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
cvttsd2si %xmm1, %r12d
cvtsi2sdl 0x34(%r15), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0xad71(%rip), %xmm0     # 0x22058
movl %ebx, %edi
callq 0x33f0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
cvttsd2si %xmm1, %ebp
movq 0x40(%r15), %rax
xorl %ecx, %ecx
testl %ebp, %ebp
movl $0x0, %edx
cmovgl %ebp, %edx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x1731e
movl %ecx, (%rax,%rsi,4)
incq %rsi
addl %r12d, %ecx
jmp 0x1730e
pushq $0x1
popq %r11
testl %ebx, %ebx
movl %ebx, 0x14(%rsp)
je 0x1733a
movq 0x28(%r15), %rax
movslq %ebx, %r10
movl %ebp, %ecx
movq -0x8(%rax,%r10,8), %rbp
jmp 0x173b7
movq 0x1b7cf(%rip), %r8      # 0x32b10
movl 0x1b7a8(%rip), %r9d     # 0x32af0
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
movl %ebp, %ecx
pushq %r11
pushq (%r15)
callq 0x16882
popq %rax
popq %rcx
movl %ebp, %eax
imull %r12d, %eax
cltq
leaq (,%rax,8), %rcx
testl %eax, %eax
pushq $-0x1
popq %rdi
cmovnsq %rcx, %rdi
callq 0x3030
movq %rax, %r13
movq 0x1b791(%rip), %r8      # 0x32b18
movl 0x1b766(%rip), %r9d     # 0x32af4
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
movl %ebp, %ecx
pushq $0x1
popq %rax
pushq %rax
pushq %r13
callq 0x16882
movl %ebp, %ecx
movq %r13, %rbp
pushq $0x1
popq %r13
movq %r13, %r11
addq $0x10, %rsp
xorl %r10d, %r10d
movq %r10, 0x18(%rsp)
movq 0x1b765(%rip), %r8      # 0x32b28
movl 0x1b732(%rip), %r9d     # 0x32afc
movq 0x8(%r15), %rax
movq %r15, %rdi
movq %rbp, %rsi
movl %r12d, %edx
movl %ecx, %r13d
pushq %r11
pushq (%rax,%r10,8)
movq %r11, %rbx
callq 0x16882
popq %rax
popq %rcx
movq 0x1b73f(%rip), %r8      # 0x32b30
movl 0x1b708(%rip), %r9d     # 0x32b00
movq 0x10(%r15), %rax
movq %r15, %rdi
movq %rbp, %rsi
movl %r12d, %edx
movl %r13d, %ecx
movl %r13d, 0x8(%rsp)
pushq %rbx
movq 0x20(%rsp), %rbx
pushq (%rax,%rbx,8)
callq 0x16882
popq %rax
popq %rcx
movq 0x1b714(%rip), %r8      # 0x32b38
movl 0x1b6d9(%rip), %r9d     # 0x32b04
movq 0x18(%r15), %rax
movq %r15, %rdi
movq %rbp, %rsi
movl %r12d, %edx
movl %r13d, %ecx
pushq $0x1
popq %r10
pushq %r10
pushq (%rax,%rbx,8)
movq %rbx, %r13
callq 0x16882
popq %rax
popq %rcx
movq 0x1b6eb(%rip), %r8      # 0x32b40
movl 0x1b6ac(%rip), %r9d     # 0x32b08
movq 0x20(%r15), %rax
movq %r15, %rdi
movq %rbp, %rsi
movl %r12d, %edx
movl 0x8(%rsp), %ecx
pushq $0x1
popq %rbx
pushq %rbx
pushq (%rax,%r13,8)
callq 0x16882
popq %rax
popq %rcx
movq 0x1b69d(%rip), %r8      # 0x32b20
movl 0x1b66e(%rip), %r9d     # 0x32af8
movq %r15, %rdi
movq %rbp, 0x20(%rsp)
movq %rbp, %rsi
movl %r12d, %edx
movl 0x8(%rsp), %ebp
movl %ebp, %ecx
pushq %rbx
pushq %r14
callq 0x16882
popq %rax
popq %rcx
movq 0x28(%r15), %rax
movq (%rax,%r13,8), %rsi
pushq $0x2
popq %r8
movl %ebp, %eax
cltd
idivl %r8d
movl %eax, %ecx
leal (%r12,%r12), %edi
movl %r12d, %eax
cltd
idivl %r8d
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
testl %ecx, %ecx
cmovlel %edx, %ecx
addl %eax, %eax
xorl %r8d, %r8d
movl 0x14(%rsp), %r11d
cmpq %rcx, %r8
je 0x1750c
movslq %edx, %r9
leaq (%r14,%r9,8), %r9
xorl %r10d, %r10d
cmpl %r10d, %eax
je 0x17505
movsd (%r9,%r10,8), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
addq $0x2, %r10
jmp 0x174ec
incq %r8
addl %edi, %edx
jmp 0x174dd
testl %r11d, %r11d
movq 0x20(%rsp), %rdi
jne 0x1752e
testq %rdi, %rdi
je 0x1752e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3380
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop