// File: kebwi[P]Trifid/src/SteerablePyramid.cpp
// Function: SteerablePyramid::readFilterSet()
void SteerablePyramid::readFilterSet()
{
	ifstream ifs;
	ifs.open(skFilterSetFilename.c_str());
	
	if (!ifs)
	{
		string errMsg = "Could not find input file '" + skFilterSetFilename + "'.  Please make sure it is in the same directory as the executable.";
		die(errMsg.c_str());
	}
	
	for (int filter = 0; filter < 7; filter++)
	{
		string label;
		int filterDim;
		ifs >> label >> filterDim;
		
		assert(label == "H0" || label == "L0" || label == "L1" || label == "B1" || label == "B2" || label == "B3" || label == "B4");
		assert(filterDim > 0 && filterDim <= 25 && filterDim % 2 == 1);
		
		skFilterDims[filter] = filterDim;
		int numTaps = filterDim * filterDim;
		skFilters[filter] = new Float_t[numTaps];
		skFiltersInv[filter] = new Float_t[numTaps];
		
		for (int i = 0; i < numTaps; i++)
		{
			ifs >> skFilters[filter][i];
			assert(ifs);
		}
	}
	assert(ifs);
	ifs.get();
	assert(!ifs);
	
	ifs.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
leaq -0x208(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x4420
leaq 0x327c3(%rip), %rdi     # 0x5cb78
callq 0x4160
movq -0x298(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0x4230
jmp 0x2a3d0
movq -0x208(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x208(%rbp,%rax), %rdi
callq 0x41b0
movb %al, -0x299(%rbp)
jmp 0x2a3f0
movb -0x299(%rbp), %al
testb $0x1, %al
jne 0x2a3ff
jmp 0x2a4c4
leaq 0x21e7c(%rip), %rsi     # 0x4c282
leaq 0x3276b(%rip), %rdx     # 0x5cb78
leaq -0x258(%rbp), %rdi
callq 0xe460
jmp 0x2a41b
leaq 0x21e7c(%rip), %rdx     # 0x4c29e
leaq -0x238(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x25b40
jmp 0x2a437
leaq -0x258(%rbp), %rdi
callq 0x46c8
leaq -0x238(%rbp), %rdi
callq 0x4160
movq %rax, %rdi
callq 0x5360
jmp 0x2a459
leaq -0x238(%rbp), %rdi
callq 0x46c8
jmp 0x2a4c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x2a974
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x46c8
jmp 0x2a974
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x46c8
jmp 0x2a974
movl $0x0, -0x25c(%rbp)
cmpl $0x7, -0x25c(%rbp)
jge 0x2a8a9
leaq -0x280(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x4500
movq -0x2b0(%rbp), %rsi
leaq -0x208(%rbp), %rdi
callq 0x44b0
movq %rax, -0x2a8(%rbp)
jmp 0x2a50a
movq -0x2a8(%rbp), %rdi
leaq -0x284(%rbp), %rsi
callq 0x4210
jmp 0x2a51f
leaq 0x2204f(%rip), %rsi     # 0x4c575
leaq -0x280(%rbp), %rdi
callq 0xe570
movb %al, -0x2b1(%rbp)
jmp 0x2a53a
movb -0x2b1(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x2b2(%rbp)
jne 0x2a678
jmp 0x2a553
leaq 0x2201f(%rip), %rsi     # 0x4c579
leaq -0x280(%rbp), %rdi
callq 0xe570
movb %al, -0x2b3(%rbp)
jmp 0x2a56e
movb -0x2b3(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x2b2(%rbp)
jne 0x2a678
jmp 0x2a587
leaq 0x21fef(%rip), %rsi     # 0x4c57d
leaq -0x280(%rbp), %rdi
callq 0xe570
movb %al, -0x2b4(%rbp)
jmp 0x2a5a2
movb -0x2b4(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x2b2(%rbp)
jne 0x2a678
jmp 0x2a5bb
leaq 0x21fbf(%rip), %rsi     # 0x4c581
leaq -0x280(%rbp), %rdi
callq 0xe570
movb %al, -0x2b5(%rbp)
jmp 0x2a5d6
movb -0x2b5(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x2b2(%rbp)
jne 0x2a678
jmp 0x2a5ef
leaq 0x21f8f(%rip), %rsi     # 0x4c585
leaq -0x280(%rbp), %rdi
callq 0xe570
movb %al, -0x2b6(%rbp)
jmp 0x2a60a
movb -0x2b6(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x2b2(%rbp)
jne 0x2a678
jmp 0x2a61f
leaq 0x21f63(%rip), %rsi     # 0x4c589
leaq -0x280(%rbp), %rdi
callq 0xe570
movb %al, -0x2b7(%rbp)
jmp 0x2a63a
movb -0x2b7(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x2b2(%rbp)
jne 0x2a678
jmp 0x2a64f
leaq 0x21f37(%rip), %rsi     # 0x4c58d
leaq -0x280(%rbp), %rdi
callq 0xe570
movb %al, -0x2b8(%rbp)
jmp 0x2a66a
movb -0x2b8(%rbp), %al
movb %al, -0x2b2(%rbp)
jmp 0x2a678
movb -0x2b2(%rbp), %al
testb $0x1, %al
jne 0x2a684
jmp 0x2a686
jmp 0x2a6c8
leaq 0x21c55(%rip), %rdi     # 0x4c2e2
leaq 0x21cc2(%rip), %rsi     # 0x4c356
movl $0xf9, %edx
leaq 0x21ccb(%rip), %rcx     # 0x4c36b
callq 0x4240
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x46c8
jmp 0x2a974
xorl %eax, %eax
cmpl $0x0, -0x284(%rbp)
movb %al, -0x2b9(%rbp)
jle 0x2a704
xorl %eax, %eax
cmpl $0x19, -0x284(%rbp)
movb %al, -0x2b9(%rbp)
jg 0x2a704
movl -0x284(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x1, %edx
sete %al
movb %al, -0x2b9(%rbp)
movb -0x2b9(%rbp), %al
testb $0x1, %al
jne 0x2a710
jmp 0x2a712
jmp 0x2a731
leaq 0x21c80(%rip), %rdi     # 0x4c399
leaq 0x21c36(%rip), %rsi     # 0x4c356
movl $0xfa, %edx
leaq 0x21c3f(%rip), %rcx     # 0x4c36b
callq 0x4240
movl -0x284(%rbp), %edx
movslq -0x25c(%rbp), %rcx
leaq 0x3248b(%rip), %rax     # 0x5cbd0
movl %edx, (%rax,%rcx,4)
movl -0x284(%rbp), %eax
imull %eax, %eax
movl %eax, -0x288(%rbp)
movslq -0x288(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x4030
movq %rax, -0x2c8(%rbp)
jmp 0x2a782
movq -0x2c8(%rbp), %rdx
movslq -0x25c(%rbp), %rcx
leaq 0x32459(%rip), %rax     # 0x5cbf0
movq %rdx, (%rax,%rcx,8)
movslq -0x288(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x4030
movq %rax, -0x2d0(%rbp)
jmp 0x2a7c6
movq -0x2d0(%rbp), %rdx
movslq -0x25c(%rbp), %rcx
leaq 0x32455(%rip), %rax     # 0x5cc30
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x28c(%rbp)
movl -0x28c(%rbp), %eax
cmpl -0x288(%rbp), %eax
jge 0x2a889
movslq -0x25c(%rbp), %rcx
leaq 0x323e7(%rip), %rax     # 0x5cbf0
movq (%rax,%rcx,8), %rax
movslq -0x28c(%rbp), %rcx
leaq (%rax,%rcx,8), %rsi
leaq -0x208(%rbp), %rdi
callq 0x42f0
jmp 0x2a826
movq -0x208(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x208(%rbp,%rax), %rdi
callq 0x44a0
movb %al, -0x2d1(%rbp)
jmp 0x2a846
movb -0x2d1(%rbp), %al
testb $0x1, %al
jne 0x2a852
jmp 0x2a854
jmp 0x2a873
leaq 0x1f9d9(%rip), %rdi     # 0x4a234
leaq 0x21af4(%rip), %rsi     # 0x4c356
movl $0x104, %edx            # imm = 0x104
leaq 0x21afd(%rip), %rcx     # 0x4c36b
callq 0x4240
jmp 0x2a875
movl -0x28c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28c(%rbp)
jmp 0x2a7e9
leaq -0x280(%rbp), %rdi
callq 0x46c8
movl -0x25c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x25c(%rbp)
jmp 0x2a4ce
movq -0x208(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x208(%rbp,%rax), %rdi
callq 0x44a0
movb %al, -0x2d2(%rbp)
jmp 0x2a8c9
movb -0x2d2(%rbp), %al
testb $0x1, %al
jne 0x2a8d5
jmp 0x2a8d7
jmp 0x2a8f6
leaq 0x1f956(%rip), %rdi     # 0x4a234
leaq 0x21a71(%rip), %rsi     # 0x4c356
movl $0x107, %edx            # imm = 0x107
leaq 0x21a7a(%rip), %rcx     # 0x4c36b
callq 0x4240
leaq -0x208(%rbp), %rdi
callq 0x4460
jmp 0x2a904
movq -0x208(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x208(%rbp,%rax), %rdi
callq 0x41b0
movb %al, -0x2d3(%rbp)
jmp 0x2a924
movb -0x2d3(%rbp), %al
testb $0x1, %al
jne 0x2a930
jmp 0x2a932
jmp 0x2a951
leaq 0x1f8fa(%rip), %rdi     # 0x4a233
leaq 0x21a16(%rip), %rsi     # 0x4c356
movl $0x109, %edx            # imm = 0x109
leaq 0x21a1f(%rip), %rcx     # 0x4c36b
callq 0x4240
leaq -0x208(%rbp), %rdi
callq 0x40b0
jmp 0x2a95f
leaq -0x208(%rbp), %rdi
callq 0x40d0
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq
leaq -0x208(%rbp), %rdi
callq 0x40d0
movq -0x210(%rbp), %rdi
callq 0x4620
nopl (%rax)