// File: /workspace/github_cpp_makefile_star2_O2/kebwi[P]Trifid/src/SteerablePyramid.cpp
// Function: SteerablePyramid::DoOneStepWaveletAnalysisUsingFT(double*, int)
void SteerablePyramid::DoOneStepWaveletAnalysisUsingFT(Float_t* pixelValues, int level)
{
	int horDim = width_ / pow(2, level);
	int verDim = height_ / pow(2, level);
	
	int filterIndex = getFilterFTIndex();
	
	for (int i = 0; i < verDim; i++)
		yLookup_[i] = i * horDim;
	
	Float_t *l0OriginalCoeffs = NULL;
	
	if (level == 0)
	{
		assert(doFourierAnalysis(pixelValues, scratch_2D_B_, horDim, verDim));
		assert(multiplyFourierTransformsAndInvert(scratch_2D_B_, skFiltersFTs[filterIndex].filtersFTs[0][level], horDim, verDim, h0Coeffs_));
		
		l0OriginalCoeffs = new Float_t[horDim * verDim];
		assert(l0OriginalCoeffs);
		assert(multiplyFourierTransformsAndInvert(scratch_2D_B_, skFiltersFTs[filterIndex].filtersFTs[1][level], horDim, verDim, l0OriginalCoeffs));
	}
	else l0OriginalCoeffs = l1Coeffs_[level - 1];
	
	assert(doFourierAnalysis(l0OriginalCoeffs, scratch_2D_B_, horDim, verDim));
	
	assert(multiplyFourierTransformsAndInvert(scratch_2D_B_, skFiltersFTs[filterIndex].filtersFTs[3][level], horDim, verDim, b1Coeffs_[level]));
	assert(multiplyFourierTransformsAndInvert(scratch_2D_B_, skFiltersFTs[filterIndex].filtersFTs[4][level], horDim, verDim, b2Coeffs_[level]));
	assert(multiplyFourierTransformsAndInvert(scratch_2D_B_, skFiltersFTs[filterIndex].filtersFTs[5][level], horDim, verDim, b3Coeffs_[level]));
	assert(multiplyFourierTransformsAndInvert(scratch_2D_B_, skFiltersFTs[filterIndex].filtersFTs[6][level], horDim, verDim, b4Coeffs_[level]));
	assert(multiplyFourierTransformsAndInvert(scratch_2D_B_, skFiltersFTs[filterIndex].filtersFTs[2][level], horDim, verDim, pixelValues));
	
	const Float_t *pixelPtr;
	Float_t *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, %r15
cvtsi2sdl 0x30(%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0xaaf1(%rip), %xmm0     # 0x22058
movl %edx, %edi
callq 0x33f0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
cvttsd2si %xmm1, %r12d
cvtsi2sdl 0x34(%r15), %xmm0
movsd %xmm0, (%rsp)
movsd 0xaac8(%rip), %xmm0     # 0x22058
movl %ebx, 0x8(%rsp)
movl %ebx, %edi
callq 0x33f0
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
cvttsd2si %xmm1, %ebp
movq %r15, %rdi
callq 0x15ee0
movq 0x40(%r15), %rcx
xorl %edx, %edx
testl %ebp, %ebp
movl $0x0, %esi
cmovgl %ebp, %esi
xorl %edi, %edi
cmpq %rdi, %rsi
je 0x175d2
movl %edx, (%rcx,%rdi,4)
incq %rdi
addl %r12d, %edx
jmp 0x175c2
movslq %eax, %rbx
movl 0x8(%rsp), %eax
movslq %eax, %r13
testl %eax, %eax
je 0x175ee
movq 0x28(%r15), %rax
movq -0x8(%rax,%r13,8), %rdi
jmp 0x1769d
movq 0x1b4e3(%rip), %rsi     # 0x32ad8
movq %r14, %rdi
movl %r12d, %edx
movl %ebp, %ecx
callq 0x140ee
testb %al, %al
je 0x17902
movq 0x1b4c7(%rip), %rdi     # 0x32ad8
movq 0x1b4a0(%rip), %rax     # 0x32ab8
movq %rbx, (%rsp)
imulq $0x158, %rbx, %rcx      # imm = 0x158
movq %rcx, 0x10(%rsp)
movq 0x8(%rax,%rcx), %rax
movq (%rax), %rsi
movq (%r15), %r8
movl %r12d, %edx
movl %ebp, %ecx
callq 0x142ba
testb %al, %al
je 0x17921
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, %rbx
movq 0x1b46b(%rip), %rdi     # 0x32ad8
movq 0x1b444(%rip), %rax     # 0x32ab8
movq 0x10(%rsp), %rcx
movq 0x20(%rax,%rcx), %rax
movq (%rax), %rsi
movl %r12d, %edx
movl %ebp, %ecx
movq %rbx, %r8
callq 0x142ba
movq %rbx, %rdi
testb %al, %al
movq (%rsp), %rbx
je 0x17940
movq 0x1b434(%rip), %rsi     # 0x32ad8
movq %rdi, (%rsp)
movl %r12d, %edx
movl %ebp, %ecx
callq 0x140ee
testb %al, %al
je 0x17848
movq 0x1b417(%rip), %rdi     # 0x32ad8
movq 0x1b3f0(%rip), %rax     # 0x32ab8
imulq $0x158, %rbx, %rbx      # imm = 0x158
movq 0x50(%rax,%rbx), %rax
movq (%rax,%r13,8), %rsi
movq 0x8(%r15), %rax
movq (%rax,%r13,8), %r8
movl %r12d, %edx
movl %ebp, %ecx
callq 0x142ba
testb %al, %al
je 0x17867
movq 0x1b3df(%rip), %rdi     # 0x32ad8
movq 0x1b3b8(%rip), %rax     # 0x32ab8
movq 0x68(%rax,%rbx), %rax
movq (%rax,%r13,8), %rsi
movq 0x10(%r15), %rax
movq (%rax,%r13,8), %r8
movl %r12d, %edx
movl %ebp, %ecx
callq 0x142ba
testb %al, %al
je 0x17886
movq 0x1b3ae(%rip), %rdi     # 0x32ad8
movq 0x1b387(%rip), %rax     # 0x32ab8
movq 0x80(%rax,%rbx), %rax
movq (%rax,%r13,8), %rsi
movq 0x18(%r15), %rax
movq (%rax,%r13,8), %r8
movl %r12d, %edx
movl %ebp, %ecx
callq 0x142ba
testb %al, %al
je 0x178a5
movq 0x1b37a(%rip), %rdi     # 0x32ad8
movq 0x1b353(%rip), %rax     # 0x32ab8
movq 0x98(%rax,%rbx), %rax
movq (%rax,%r13,8), %rsi
movq 0x20(%r15), %rax
movq (%rax,%r13,8), %r8
movl %r12d, %edx
movl %ebp, %ecx
callq 0x142ba
testb %al, %al
je 0x178c4
movq 0x1b346(%rip), %rdi     # 0x32ad8
movq 0x1b31f(%rip), %rax     # 0x32ab8
movq 0x38(%rax,%rbx), %rax
movq (%rax,%r13,8), %rsi
movl %r12d, %edx
movl %ebp, %ecx
movq %r14, %r8
callq 0x142ba
testb %al, %al
je 0x178e3
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
cmpq %rcx, %r8
je 0x17816
movslq %edx, %r9
leaq (%r14,%r9,8), %r9
xorl %r10d, %r10d
cmpl %r10d, %eax
je 0x1780f
movsd (%r9,%r10,8), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
addq $0x2, %r10
jmp 0x177f6
incq %r8
addl %edi, %edx
jmp 0x177e7
cmpl $0x0, 0x8(%rsp)
movq (%rsp), %rdi
jne 0x17839
testq %rdi, %rdi
je 0x17839
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3380
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xdf61(%rip), %rdi      # 0x257b0
leaq 0xda6c(%rip), %rsi      # 0x252c2
leaq 0xde0b(%rip), %rcx      # 0x25668
movl $0x4cc, %edx            # imm = 0x4CC
callq 0x31a0
leaq 0xdf85(%rip), %rdi      # 0x257f3
leaq 0xda4d(%rip), %rsi      # 0x252c2
leaq 0xddec(%rip), %rcx      # 0x25668
movl $0x4ce, %edx            # imm = 0x4CE
callq 0x31a0
leaq 0xdfea(%rip), %rdi      # 0x25877
leaq 0xda2e(%rip), %rsi      # 0x252c2
leaq 0xddcd(%rip), %rcx      # 0x25668
movl $0x4cf, %edx            # imm = 0x4CF
callq 0x31a0
leaq 0xe04f(%rip), %rdi      # 0x258fb
leaq 0xda0f(%rip), %rsi      # 0x252c2
leaq 0xddae(%rip), %rcx      # 0x25668
movl $0x4d0, %edx            # imm = 0x4D0
callq 0x31a0
leaq 0xe0b4(%rip), %rdi      # 0x2597f
leaq 0xd9f0(%rip), %rsi      # 0x252c2
leaq 0xdd8f(%rip), %rcx      # 0x25668
movl $0x4d1, %edx            # imm = 0x4D1
callq 0x31a0
leaq 0xe119(%rip), %rdi      # 0x25a03
leaq 0xd9d1(%rip), %rsi      # 0x252c2
leaq 0xdd70(%rip), %rcx      # 0x25668
movl $0x4d2, %edx            # imm = 0x4D2
callq 0x31a0
leaq 0xdd21(%rip), %rdi      # 0x2562a
leaq 0xd9b2(%rip), %rsi      # 0x252c2
leaq 0xdd51(%rip), %rcx      # 0x25668
movl $0x4c3, %edx            # imm = 0x4C3
callq 0x31a0
leaq 0xdd87(%rip), %rdi      # 0x256af
leaq 0xd993(%rip), %rsi      # 0x252c2
leaq 0xdd32(%rip), %rcx      # 0x25668
movl $0x4c4, %edx            # imm = 0x4C4
callq 0x31a0
leaq 0xdde5(%rip), %rdi      # 0x2572c
leaq 0xd974(%rip), %rsi      # 0x252c2
leaq 0xdd13(%rip), %rcx      # 0x25668
movl $0x4c8, %edx            # imm = 0x4C8
callq 0x31a0
nop