// File: kebwi[P]Trifid/src/SteerablePyramid.cpp
// Function: SteerablePyramid::operator==(SteerablePyramid const&) const
bool SteerablePyramid::operator==(const SteerablePyramid& sp) const
{
	if (&sp == this)
		return true;
	
	if (width_ != sp.width_ || height_ != sp.height_ || numLevels_ != sp.numLevels_)
		return false;
	
	for (int lvl = 0; lvl < numLevels_; lvl++)
	{
		int totalPixels = (width_ * height_) / (int)(pow(4, lvl));
		if (lvl == 0)
		{
			for (int i = 0; i < totalPixels; i++)
				if (h0Coeffs_[i] != sp.h0Coeffs_[i])
					return false;
		}
		
		for (int i = 0; i < totalPixels; i++)
		{
			if (b1Coeffs_[lvl][i] != sp.b1Coeffs_[lvl][i])
				return false;
			if (b2Coeffs_[lvl][i] != sp.b2Coeffs_[lvl][i])
				return false;
			if (b3Coeffs_[lvl][i] != sp.b3Coeffs_[lvl][i])
				return false;
			if (b4Coeffs_[lvl][i] != sp.b4Coeffs_[lvl][i])
				return false;
		}
		
		totalPixels /= 4;
		for (int i = 0; i < totalPixels; i++)
			if (l1Coeffs_[lvl][i] != sp.l1Coeffs_[lvl][i])
				return false;
	}
	
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq %rax, -0x18(%rbp)
jne 0x2a117
movb $0x1, -0x1(%rbp)
jmp 0x2a385
movq -0x38(%rbp), %rax
movl 0x30(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x30(%rcx), %eax
jne 0x2a147
movq -0x38(%rbp), %rax
movl 0x34(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x34(%rcx), %eax
jne 0x2a147
movq -0x38(%rbp), %rax
movl 0x38(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x38(%rcx), %eax
je 0x2a150
movb $0x0, -0x1(%rbp)
jmp 0x2a385
movl $0x0, -0x1c(%rbp)
movq -0x38(%rbp), %rcx
movl -0x1c(%rbp), %eax
cmpl 0x38(%rcx), %eax
jge 0x2a381
movq -0x38(%rbp), %rcx
movl 0x30(%rcx), %eax
imull 0x34(%rcx), %eax
movl %eax, -0x3c(%rbp)
movl -0x1c(%rbp), %esi
movl $0x4, %edi
callq 0x1d7f0
movl -0x3c(%rbp), %eax
cvttsd2si %xmm0, %ecx
cltd
idivl %ecx
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x2a1e2
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x2a1e0
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jne 0x2a1ca
jp 0x2a1ca
jmp 0x2a1d3
movb $0x0, -0x1(%rbp)
jmp 0x2a385
jmp 0x2a1d5
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x2a19c
jmp 0x2a1e2
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x2a309
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jne 0x2a22d
jp 0x2a22d
jmp 0x2a236
movb $0x0, -0x1(%rbp)
jmp 0x2a385
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jne 0x2a26e
jp 0x2a26e
jmp 0x2a277
movb $0x0, -0x1(%rbp)
jmp 0x2a385
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jne 0x2a2af
jp 0x2a2af
jmp 0x2a2b8
movb $0x0, -0x1(%rbp)
jmp 0x2a385
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jne 0x2a2f0
jp 0x2a2f0
jmp 0x2a2f9
movb $0x0, -0x1(%rbp)
jmp 0x2a385
jmp 0x2a2fb
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2a1e9
movl -0x20(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, -0x20(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x2a371
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jne 0x2a35e
jp 0x2a35e
jmp 0x2a364
movb $0x0, -0x1(%rbp)
jmp 0x2a385
jmp 0x2a366
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2a31e
jmp 0x2a373
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2a157
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq