// File: /workspace/github_cpp_makefile_star2_O2/kebwi[P]Trifid/src/SteerablePyramid.cpp
// Function: SteerablePyramid::GeneratePGMimages(char const*)
void SteerablePyramid::GeneratePGMimages(const char* filenameHeader)
{
	vector<Float_t> maxCoeffs, maxThumbnailPixels;
	FindStrongestCoefficients(maxCoeffs, maxThumbnailPixels);
	Float_t maxCoeff = 0;
	for (int i = 0; i < maxCoeffs.size(); i++)
		if (maxCoeffs[i] > maxCoeff)
			maxCoeff = maxCoeffs[i];
	Float_t maxThumbnailPixel = 0;
	for (int i = 0; i < maxThumbnailPixels.size(); i++)
		if (maxThumbnailPixels[i] > maxThumbnailPixel)
			maxThumbnailPixel = maxThumbnailPixels[i];
	
	//maxCoeff = .5;//���
	Float_t coeffScalar = 127.0 / maxCoeff, thumbnailScalar = 255.0 / maxThumbnailPixel;
	
	cout << "maxCoeff/maxThumbnailPixel: " << maxCoeff << "    " << maxThumbnailPixel << endl;
	cout << "coeffScalar/thumnailScalar: " << coeffScalar << "    " << thumbnailScalar << endl;
	
	//Write each set of coefficients to a pgm file
	for (int i = 0; i < numLevels_; i++)
	{
		int horDim = width_ / pow(2, i);
		int verDim = height_ / pow(2, i);
		
		stringstream levelSS;
		levelSS << i;
		string filename;
		
		if (i == 0)
		{
			//Add an 'a' to push h0 to the beginning of the alphebetically sorted list of files
			filename = string(filenameHeader) + levelSS.str() + "_ah0" + ".pgm";
			GeneratePGMimage(h0Coeffs_, horDim, verDim, coeffScalar, 128, filename);
		}
		filename = string(filenameHeader) + levelSS.str() + "_b1" + ".pgm";
		GeneratePGMimage(b1Coeffs_[i], horDim, verDim, coeffScalar, 128, filename);
		filename = string(filenameHeader) + levelSS.str() + "_b2" + ".pgm";
		GeneratePGMimage(b2Coeffs_[i], horDim, verDim, coeffScalar, 128, filename);
		filename = string(filenameHeader) + levelSS.str() + "_b3" + ".pgm";
		GeneratePGMimage(b3Coeffs_[i], horDim, verDim, coeffScalar, 128, filename);
		filename = string(filenameHeader) + levelSS.str() + "_b4" + ".pgm";
		GeneratePGMimage(b4Coeffs_[i], horDim, verDim, coeffScalar, 128, filename);
		filename = string(filenameHeader) + levelSS.str() + "_l1" + ".pgm";
		GeneratePGMimage(l1Coeffs_[i], horDim / 2, verDim / 2, thumbnailScalar, 0, filename);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x398, %rsp            # imm = 0x398
movq %rsi, 0x20(%rsp)
movq %rdi, %rbx
xorpd %xmm0, %xmm0
leaq 0x110(%rsp), %rsi
movapd %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0xf0(%rsp), %rdx
movapd %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
callq 0x191a8
movq 0x110(%rsp), %rax
movq 0x118(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
xorpd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x19458
movsd (%rax,%rdx,8), %xmm0
maxsd 0x10(%rsp), %xmm0
incq %rdx
movsd %xmm0, 0x10(%rsp)
jmp 0x1943d
movq 0xf0(%rsp), %rax
movq 0xf8(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x19496
movsd (%rax,%rdx,8), %xmm0
maxsd 0x8(%rsp), %xmm0
incq %rdx
movsd %xmm0, 0x8(%rsp)
jmp 0x1947b
movq %rbx, 0x18(%rsp)
movq 0x16b2e(%rip), %rdi     # 0x2ffd0
leaq 0xce56(%rip), %rsi      # 0x262ff
callq 0x32c0
movq %rax, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x3460
leaq 0x9415(%rip), %rsi      # 0x228d8
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x3460
movq %rax, %rdi
callq 0x3120
movq 0x16ae8(%rip), %rdi     # 0x2ffd0
leaq 0xce2d(%rip), %rsi      # 0x2631c
callq 0x32c0
movsd 0xbc8c(%rip), %xmm0     # 0x25188
divsd 0x10(%rsp), %xmm0
movq %rax, %rdi
movsd %xmm0, 0x28(%rsp)
callq 0x3460
leaq 0x93c1(%rip), %rsi      # 0x228d8
movq %rax, %rdi
callq 0x32c0
movsd 0x9aa1(%rip), %xmm0     # 0x22fc8
divsd 0x8(%rsp), %xmm0
movq %rax, %rdi
movsd %xmm0, 0x90(%rsp)
callq 0x3460
movq %rax, %rdi
callq 0x3120
xorl %r13d, %r13d
leaq 0x50(%rsp), %r12
leaq 0xb0(%rsp), %rbp
leaq 0xd0(%rsp), %rbx
leaq 0x1f0(%rsp), %r14
movq 0x18(%rsp), %r15
movslq 0x38(%r15), %rax
cmpq %rax, %r13
jge 0x19bbe
cvtsi2sdl 0x30(%r15), %xmm0
movsd %xmm0, 0x8(%rsp)
cvtsi2sd %r13d, %xmm0
movsd %xmm0, 0x10(%rsp)
callq 0x3280
movsd %xmm0, 0xa0(%rsp)
cvtsi2sdl 0x34(%r15), %xmm0
movsd %xmm0, 0xa8(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x3280
movsd %xmm0, 0x98(%rsp)
leaq 0x210(%rsp), %rdi
callq 0x31e0
leaq 0x220(%rsp), %rdi
movl %r13d, %esi
callq 0x34b0
movsd 0x8(%rsp), %xmm0
divsd 0xa0(%rsp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x10(%rsp)
movsd 0xa8(%rsp), %xmm0
divsd 0x98(%rsp), %xmm0
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
andq $0x0, 0x78(%rsp)
cvttsd2si %xmm0, %eax
movl %eax, 0x8(%rsp)
movb $0x0, 0x80(%rsp)
testq %r13, %r13
jne 0x19711
leaq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
leaq 0x7(%rsp), %rdx
callq 0x7fcc
movq %r12, %rdi
leaq 0x228(%rsp), %rsi
callq 0x3420
movq %rbp, %rdi
leaq 0x30(%rsp), %rsi
movq %r12, %rdx
callq 0x1a97a
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0xccc6(%rip), %rdx      # 0x26339
callq 0x1390d
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x9b48(%rip), %rdx      # 0x231cd
callq 0x1390d
leaq 0x70(%rsp), %rdi
movq %r14, %rsi
callq 0x3360
movq %r14, %rdi
callq 0x3548
movq %rbx, %rdi
callq 0x3548
movq %rbp, %rdi
callq 0x3548
movq %r12, %rdi
callq 0x3548
leaq 0x30(%rsp), %rdi
callq 0x3548
movq 0x18(%rsp), %rax
movq (%rax), %r15
leaq 0x1d0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x33b0
movq %r15, %rsi
movl 0x10(%rsp), %edx
movl 0x8(%rsp), %ecx
movsd 0x28(%rsp), %xmm0
movsd 0xba9c(%rip), %xmm1     # 0x25190
leaq 0x1d0(%rsp), %r15
movq %r15, %r8
callq 0x19d1c
movq %r15, %rdi
callq 0x3548
leaq 0x50(%rsp), %r12
leaq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
leaq 0x7(%rsp), %rdx
callq 0x7fcc
movq %r12, %rdi
leaq 0x228(%rsp), %rsi
callq 0x3420
movq %rbp, %rdi
leaq 0x30(%rsp), %rsi
movq %r12, %rdx
callq 0x1a97a
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0xcbec(%rip), %rdx      # 0x2633e
callq 0x1390d
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x9a69(%rip), %rdx      # 0x231cd
callq 0x1390d
leaq 0x70(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x3360
movq %r14, %rdi
callq 0x3548
movq %rbx, %rdi
callq 0x3548
movq %rbp, %rdi
callq 0x3548
leaq 0x50(%rsp), %rdi
callq 0x3548
leaq 0x30(%rsp), %rdi
callq 0x3548
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax,%r13,8), %r15
leaq 0x1b0(%rsp), %rdi
movq %r12, %rsi
callq 0x33b0
movq %r15, %rsi
movl 0x10(%rsp), %edx
movl 0x8(%rsp), %ecx
movsd 0x28(%rsp), %xmm0
movsd 0xb9b5(%rip), %xmm1     # 0x25190
leaq 0x1b0(%rsp), %r15
movq %r15, %r8
callq 0x19d1c
movq %r15, %rdi
callq 0x3548
leaq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
leaq 0x7(%rsp), %rdx
callq 0x7fcc
leaq 0x50(%rsp), %r15
movq %r15, %rdi
leaq 0x228(%rsp), %rsi
callq 0x3420
movq %rbp, %rdi
leaq 0x30(%rsp), %rsi
movq %r15, %rdx
callq 0x1a97a
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0xcb09(%rip), %rdx      # 0x26342
callq 0x1390d
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x9982(%rip), %rdx      # 0x231cd
callq 0x1390d
leaq 0x70(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x3360
movq %r14, %rdi
callq 0x3548
movq %rbx, %rdi
callq 0x3548
movq %rbp, %rdi
callq 0x3548
leaq 0x50(%rsp), %rdi
callq 0x3548
leaq 0x30(%rsp), %rdi
callq 0x3548
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r13,8), %r15
leaq 0x190(%rsp), %rdi
movq %r12, %rsi
callq 0x33b0
movq %r15, %rsi
movl 0x10(%rsp), %edx
movl 0x8(%rsp), %ecx
movsd 0x28(%rsp), %xmm0
movsd 0xb8ce(%rip), %xmm1     # 0x25190
leaq 0x190(%rsp), %r15
movq %r15, %r8
callq 0x19d1c
movq %r15, %rdi
callq 0x3548
leaq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
leaq 0x7(%rsp), %rdx
callq 0x7fcc
leaq 0x50(%rsp), %r15
movq %r15, %rdi
leaq 0x228(%rsp), %rsi
callq 0x3420
movq %rbp, %rdi
leaq 0x30(%rsp), %rsi
movq %r15, %rdx
callq 0x1a97a
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0xca26(%rip), %rdx      # 0x26346
callq 0x1390d
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x989b(%rip), %rdx      # 0x231cd
callq 0x1390d
leaq 0x70(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x3360
movq %r14, %rdi
callq 0x3548
movq %rbx, %rdi
callq 0x3548
movq %rbp, %rdi
callq 0x3548
leaq 0x50(%rsp), %rdi
callq 0x3548
leaq 0x30(%rsp), %rdi
callq 0x3548
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax,%r13,8), %r15
leaq 0x170(%rsp), %rdi
movq %r12, %rsi
callq 0x33b0
movq %r15, %rsi
movl 0x10(%rsp), %edx
movl 0x8(%rsp), %ecx
movsd 0x28(%rsp), %xmm0
movsd 0xb7e7(%rip), %xmm1     # 0x25190
leaq 0x170(%rsp), %r15
movq %r15, %r8
callq 0x19d1c
movq %r15, %rdi
callq 0x3548
leaq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
leaq 0x7(%rsp), %rdx
callq 0x7fcc
leaq 0x50(%rsp), %r15
movq %r15, %rdi
leaq 0x228(%rsp), %rsi
callq 0x3420
movq %rbp, %rdi
leaq 0x30(%rsp), %rsi
movq %r15, %rdx
callq 0x1a97a
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0xc943(%rip), %rdx      # 0x2634a
callq 0x1390d
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x97b4(%rip), %rdx      # 0x231cd
callq 0x1390d
leaq 0x70(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x3360
movq %r14, %rdi
callq 0x3548
movq %rbx, %rdi
callq 0x3548
movq %rbp, %rdi
callq 0x3548
leaq 0x50(%rsp), %rdi
callq 0x3548
leaq 0x30(%rsp), %rdi
callq 0x3548
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq (%rax,%r13,8), %r15
leaq 0x150(%rsp), %rdi
movq %r12, %rsi
callq 0x33b0
movq %r15, %rsi
movl 0x10(%rsp), %edx
movl 0x8(%rsp), %ecx
movsd 0x28(%rsp), %xmm0
movsd 0xb700(%rip), %xmm1     # 0x25190
leaq 0x150(%rsp), %r15
movq %r15, %r8
callq 0x19d1c
movq %r15, %rdi
callq 0x3548
leaq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
leaq 0x7(%rsp), %rdx
callq 0x7fcc
leaq 0x50(%rsp), %r15
movq %r15, %rdi
leaq 0x228(%rsp), %rsi
callq 0x3420
movq %rbp, %rdi
leaq 0x30(%rsp), %rsi
movq %r15, %rdx
callq 0x1a97a
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0xc860(%rip), %rdx      # 0x2634e
callq 0x1390d
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x96cd(%rip), %rdx      # 0x231cd
callq 0x1390d
leaq 0x70(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x3360
movq %r14, %rdi
callq 0x3548
movq %rbx, %rdi
callq 0x3548
movq %rbp, %rdi
callq 0x3548
leaq 0x50(%rsp), %rdi
callq 0x3548
leaq 0x30(%rsp), %rdi
callq 0x3548
movq 0x18(%rsp), %rax
movq 0x28(%rax), %rax
movq (%rax,%r13,8), %r15
leaq 0x130(%rsp), %rdi
movq %r12, %rsi
callq 0x33b0
movl 0x8(%rsp), %eax
cltd
pushq $0x2
popq %rsi
idivl %esi
movl %eax, %ecx
movl 0x10(%rsp), %eax
cltd
idivl %esi
xorps %xmm1, %xmm1
movq %r15, %rsi
movl %eax, %edx
movsd 0x90(%rsp), %xmm0
leaq 0x130(%rsp), %r15
movq %r15, %r8
callq 0x19d1c
movq %r15, %rdi
callq 0x3548
leaq 0x70(%rsp), %rdi
callq 0x3548
leaq 0x210(%rsp), %rdi
callq 0x3200
incq %r13
leaq 0x50(%rsp), %r12
jmp 0x19566
leaq 0xf0(%rsp), %rdi
callq 0x8a42
leaq 0x110(%rsp), %rdi
callq 0x8a42
addq $0x398, %rsp            # imm = 0x398
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x19c88
jmp 0x19c88
jmp 0x19c94
jmp 0x19c8f
jmp 0x19c9e
jmp 0x19c99
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
jmp 0x19cca
jmp 0x19ce0
jmp 0x19c8f
jmp 0x19ce0
jmp 0x19c9e
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
jmp 0x19cca
jmp 0x19c9e
jmp 0x19c99
jmp 0x19ce0
jmp 0x19c94
jmp 0x19c8f
jmp 0x19ce0
jmp 0x19c9e
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
jmp 0x19cca
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
jmp 0x19cca
jmp 0x19c94
jmp 0x19c8f
jmp 0x19c99
jmp 0x19c94
jmp 0x19c99
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
jmp 0x19cca
jmp 0x19c94
jmp 0x19c99
movq %rax, %rbx
jmp 0x19ced
jmp 0x19c9e
jmp 0x19ce0
movq %rax, %rbx
jmp 0x19cfa
jmp 0x19c8f
movq %rax, %rbx
jmp 0x19cae
movq %rax, %rbx
jmp 0x19cc5
movq %rax, %rbx
jmp 0x19cbb
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x3548
leaq 0xb0(%rsp), %rdi
callq 0x3548
leaq 0x50(%rsp), %rdi
callq 0x3548
leaq 0x30(%rsp), %rdi
callq 0x3548
jmp 0x19ce3
movq %rax, %rbx
leaq 0x1b0(%rsp), %rdi
jmp 0x19cca
jmp 0x19ce0
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x3548
leaq 0x210(%rsp), %rdi
callq 0x3200
leaq 0xf0(%rsp), %rdi
callq 0x8a42
leaq 0x110(%rsp), %rdi
callq 0x8a42
movq %rbx, %rdi
callq 0x34d0