// File: kebwi[P]Trifid/src/SteerablePyramid.cpp
// Function: FilterFT::init()
void init()
	{
		assert(filtersFTs[0].size() == 0);
		
		int numLevels = 0;
		int shorterDim = min(width_, height_);
		while (shorterDim > skFilterDims[2])	//Limit is determined by the dimensions of the L1 filter (probably 17x17)
		{
			numLevels++;
			shorterDim /= 2;
		}
		
		for (int i = 0; i < 7; i++)
		{
			filtersFTs[i].resize(numLevels);
			filtersInvFTs[i].resize(numLevels);
			for (int j = 0; j < numLevels; j++)
			{
				int totalPixels = (width_ * height_) / pow(4, j);
				filtersFTs[i][j] = new Float_t[totalPixels];
				filtersInvFTs[i][j] = new Float_t[totalPixels];
				
				//Make absolutely certain the space is cleared to zeroes since much of it won't be overwritten during initialization.
				memset(filtersFTs[i][j], 0, totalPixels * sizeof(Float_t));
				memset(filtersInvFTs[i][j], 0, totalPixels * sizeof(Float_t));
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
addq $0x8, %rdi
callq 0x336e0
cmpq $0x0, %rax
jne 0x334c5
jmp 0x334e4
leaq 0x1a061(%rip), %rdi     # 0x4d52d
leaq 0x18e83(%rip), %rsi     # 0x4c356
movl $0x58, %edx
leaq 0x1a068(%rip), %rcx     # 0x4d547
callq 0x4240
movq -0x28(%rbp), %rdi
movl $0x0, -0xc(%rbp)
movq %rdi, %rsi
addq $0x4, %rsi
callq 0x32f00
movl (%rax), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl 0x296cf(%rip), %eax     # 0x5cbd8
jle 0x33524
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x10(%rbp)
jmp 0x33500
movl $0x0, -0x14(%rbp)
cmpl $0x7, -0x14(%rbp)
jge 0x336ce
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
movslq -0x14(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movslq -0xc(%rbp), %rsi
callq 0x33700
movq -0x28(%rbp), %rdi
addq $0xb0, %rdi
movslq -0x14(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movslq -0xc(%rbp), %rsi
callq 0x33700
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x336be
movq -0x28(%rbp), %rcx
movl (%rcx), %eax
imull 0x4(%rcx), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x40(%rbp)
movl -0x18(%rbp), %esi
movl $0x4, %edi
callq 0x1d7f0
movaps %xmm0, %xmm1
movsd -0x40(%rbp), %xmm0
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x4030
movq -0x28(%rbp), %rdi
movq %rax, -0x38(%rbp)
addq $0x8, %rdi
movslq -0x14(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movslq -0x18(%rbp), %rsi
callq 0x32c90
movq -0x38(%rbp), %rcx
movq %rcx, (%rax)
movslq -0x1c(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x4030
movq -0x28(%rbp), %rdi
movq %rax, -0x30(%rbp)
addq $0xb0, %rdi
movslq -0x14(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movslq -0x18(%rbp), %rsi
callq 0x32c90
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rdi
movq %rcx, (%rax)
addq $0x8, %rdi
movslq -0x14(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movslq -0x18(%rbp), %rsi
callq 0x32c90
movq (%rax), %rdi
movslq -0x1c(%rbp), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x41e0
movq -0x28(%rbp), %rdi
addq $0xb0, %rdi
movslq -0x14(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movslq -0x18(%rbp), %rsi
callq 0x32c90
movq (%rax), %rdi
movslq -0x1c(%rbp), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x41e0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x33577
jmp 0x336c0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3352b
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop