// File: /workspace/github_cpp_makefile_star2_O1/kebwi[P]Trifid/src/SteerablePyramid.cpp
// Function: SteerablePyramid::Init(int, int)
void SteerablePyramid::Init(int width, int height)
{
	if (width_ == width && height_ == height)
		return;
	width_ = width;
	height_ = height;
	
	CreateScratch();
	
	Destroy();
	
	DetermineNumLevels();
	
	yLookup_ = new int[height_];
	
	int totalPixels = width_ * height_;
	h0Coeffs_ = new Float_t[totalPixels];
	
	b1Coeffs_ = new Float_t*[numLevels_];
	for (int i = 0; i < numLevels_; i++)
		b1Coeffs_[i] = new Float_t[totalPixels / (int)(pow(4, i))];
	
	b2Coeffs_ = new Float_t*[numLevels_];
	for (int i = 0; i < numLevels_; i++)
		b2Coeffs_[i] = new Float_t[totalPixels / (int)(pow(4, i))];
	
	b3Coeffs_ = new Float_t*[numLevels_];
	for (int i = 0; i < numLevels_; i++)
		b3Coeffs_[i] = new Float_t[totalPixels / (int)(pow(4, i))];
	
	b4Coeffs_ = new Float_t*[numLevels_];
	for (int i = 0; i < numLevels_; i++)
		b4Coeffs_[i] = new Float_t[totalPixels / (int)(pow(4, i))];
	
	l1Coeffs_ = new Float_t*[numLevels_];
	for (int i = 0; i < numLevels_; i++)
		l1Coeffs_[i] = new Float_t[totalPixels / (int)(pow(4, i + 1))];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
cmpl %esi, 0x30(%rdi)
jne 0x1b4e7
cmpl %edx, 0x34(%rbx)
je 0x1b7ac
movl %esi, 0x30(%rbx)
movl %edx, 0x34(%rbx)
movq %rbx, %rdi
callq 0x1b142
movq %rbx, %rdi
callq 0x1b340
movl $0x0, 0x38(%rbx)
movslq 0x34(%rbx), %r15
movl 0x30(%rbx), %ebp
cmpl %ebp, %r15d
movl %ebp, %ecx
cmovll %r15d, %ecx
movl 0x1e5ee(%rip), %eax     # 0x39b08
cmpl %eax, %ecx
jle 0x1b534
xorl %edx, %edx
movl %ecx, %esi
incl %edx
shrl $0x1f, %esi
addl %ecx, %esi
sarl %esi
movl %esi, %ecx
cmpl %eax, %esi
jg 0x1b522
movl %edx, 0x38(%rbx)
movq %r15, %rdi
shlq $0x2, %rdi
testl %r15d, %r15d
movq $-0x1, %r14
cmovsq %r14, %rdi
callq 0x3030
movq %rax, 0x40(%rbx)
imull %r15d, %ebp
movslq %ebp, %rax
leaq (,%rax,8), %rdi
testl %eax, %eax
cmovsq %r14, %rdi
callq 0x3030
movq %rax, (%rbx)
movslq 0x38(%rbx), %rax
leaq (,%rax,8), %rdi
testq %rax, %rax
cmovsq %r14, %rdi
callq 0x3030
movq %rax, 0x8(%rbx)
movl 0x38(%rbx), %eax
testl %eax, %eax
jle 0x1b5e0
xorl %r15d, %r15d
xorl %r12d, %r12d
movl %r15d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x32a0
cvttsd2si %xmm0, %ecx
movl %ebp, %eax
cltd
idivl %ecx
movq $-0x1, %rdi
testl %eax, %eax
js 0x1b5c3
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x3030
movq 0x8(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
movslq 0x38(%rbx), %rax
addl $0x2, %r15d
cmpq %rax, %r12
jl 0x1b598
cltq
leaq (,%rax,8), %rdi
testl %eax, %eax
cmovsq %r14, %rdi
callq 0x3030
movq %rax, 0x10(%rbx)
movl 0x38(%rbx), %eax
testl %eax, %eax
jle 0x1b64e
xorl %r14d, %r14d
xorl %r15d, %r15d
movl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x32a0
cvttsd2si %xmm0, %ecx
movl %ebp, %eax
cltd
idivl %ecx
movq $-0x1, %rdi
testl %eax, %eax
js 0x1b631
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x3030
movq 0x10(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movslq 0x38(%rbx), %rax
addl $0x2, %r14d
cmpq %rax, %r15
jl 0x1b606
cltq
leaq (,%rax,8), %rdi
testl %eax, %eax
movq $-0x1, %r14
cmovsq %r14, %rdi
callq 0x3030
movq %rax, 0x18(%rbx)
movl 0x38(%rbx), %eax
testl %eax, %eax
jle 0x1b6c3
xorl %r15d, %r15d
xorl %r12d, %r12d
movl %r15d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x32a0
cvttsd2si %xmm0, %ecx
movl %ebp, %eax
cltd
idivl %ecx
movq $-0x1, %rdi
testl %eax, %eax
js 0x1b6a6
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x3030
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
movslq 0x38(%rbx), %rax
addl $0x2, %r15d
cmpq %rax, %r12
jl 0x1b67b
cltq
leaq (,%rax,8), %rdi
testl %eax, %eax
cmovsq %r14, %rdi
callq 0x3030
movq %rax, 0x20(%rbx)
movl 0x38(%rbx), %eax
testl %eax, %eax
jle 0x1b731
xorl %r14d, %r14d
xorl %r15d, %r15d
movl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x32a0
cvttsd2si %xmm0, %ecx
movl %ebp, %eax
cltd
idivl %ecx
movq $-0x1, %rdi
testl %eax, %eax
js 0x1b714
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x3030
movq 0x20(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movslq 0x38(%rbx), %rax
addl $0x2, %r14d
cmpq %rax, %r15
jl 0x1b6e9
cltq
leaq (,%rax,8), %rcx
testl %eax, %eax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x3030
movq %rax, 0x28(%rbx)
cmpl $0x0, 0x38(%rbx)
jle 0x1b7ac
movl $0x2, %r14d
xorl %r15d, %r15d
movl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x32a0
cvttsd2si %xmm0, %ecx
movl %ebp, %eax
cltd
idivl %ecx
movq $-0x1, %rdi
testl %eax, %eax
js 0x1b78b
movslq %eax, %rdi
shlq $0x3, %rdi
leaq 0x1(%r15), %r12
callq 0x3030
movq 0x28(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
movslq 0x38(%rbx), %rax
addl $0x2, %r14d
movq %r12, %r15
cmpq %rax, %r12
jl 0x1b760
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop