// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl %esi, 0x30(%rdi)
jne 0x1b076
cmpl %edx, 0x34(%rbx)
je 0x1b342
movl %esi, 0x30(%rbx)
movl %edx, 0x34(%rbx)
movq %rbx, %rdi
callq 0x1acb6
movq %rbx, %rdi
callq 0x1aeb4
movl $0x0, 0x38(%rbx)
movslq 0x34(%rbx), %r14
movl 0x30(%rbx), %ebp
cmpl %ebp, %r14d
movl %ebp, %ecx
cmovll %r14d, %ecx
movl 0x1ea5f(%rip), %eax     # 0x39b08
xorl %r12d, %r12d
cmpl %eax, %ecx
jle 0x1b0c9
xorl %r12d, %r12d
movl %ecx, %edx
incl %r12d
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
movl %edx, %ecx
cmpl %eax, %edx
jg 0x1b0b5
movl %r12d, 0x38(%rbx)
movq %r14, %rdi
shlq $0x2, %rdi
testl %r14d, %r14d
movq $-0x1, %r13
cmovsq %r13, %rdi
callq 0x3030
movq %rax, 0x40(%rbx)
imull %r14d, %ebp
movslq %ebp, %rax
leaq (,%rax,8), %rdi
testl %eax, %eax
cmovsq %r13, %rdi
callq 0x3030
movq %rax, (%rbx)
movslq %r12d, %r15
leaq (,%r15,8), %r14
movq %r14, %rdi
callq 0x3030
movq %rax, 0x8(%rbx)
testl %r15d, %r15d
jle 0x1b17c
xorl %r13d, %r13d
xorl %r15d, %r15d
movl %r13d, %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 0x1b151
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x3030
movq 0x8(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movl 0x38(%rbx), %r12d
movslq %r12d, %r14
addl $0x2, %r13d
cmpq %r14, %r15
jl 0x1b126
shlq $0x3, %r14
movq $-0x1, %r13
testl %r12d, %r12d
cmovnsq %r14, %r13
movq %r13, %rdi
callq 0x3030
movq %rax, 0x10(%rbx)
testl %r12d, %r12d
jle 0x1b1e9
xorl %r15d, %r15d
xorl %r13d, %r13d
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 0x1b1c5
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x3030
movq 0x10(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
incq %r13
movl 0x38(%rbx), %r12d
movslq %r12d, %r14
addl $0x2, %r15d
cmpq %r14, %r13
jl 0x1b19a
shlq $0x3, %r14
testl %r12d, %r12d
movq $-0x1, %r15
movq %r14, %rdi
cmovsq %r15, %rdi
callq 0x3030
movq %rax, 0x18(%rbx)
testl %r12d, %r12d
jle 0x1b264
xorl %r13d, %r13d
xorl %r15d, %r15d
movl %r13d, %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 0x1b239
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x3030
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movl 0x38(%rbx), %r12d
movslq %r12d, %r14
addl $0x2, %r13d
cmpq %r14, %r15
jl 0x1b20e
shlq $0x3, %r14
movq $-0x1, %r15
testl %r12d, %r12d
cmovnsq %r14, %r15
movq %r15, %rdi
callq 0x3030
movq %rax, 0x20(%rbx)
testl %r12d, %r12d
jle 0x1b2d1
xorl %r15d, %r15d
xorl %r13d, %r13d
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 0x1b2ad
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x3030
movq 0x20(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
incq %r13
movl 0x38(%rbx), %r12d
movslq %r12d, %r14
addl $0x2, %r15d
cmpq %r14, %r13
jl 0x1b282
shlq $0x3, %r14
testl %r12d, %r12d
movq $-0x1, %rdi
cmovnsq %r14, %rdi
callq 0x3030
movq %rax, 0x28(%rbx)
testl %r12d, %r12d
jle 0x1b342
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 0x1b321
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 0x1b2f6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop