// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/ImageProcs.cpp
// Function: denoiseGrayImage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void denoiseGrayImage(string filename, string manualShrinkageThresholdStr)
{
	cout << "Denoising gray image..." << endl;
	
	//Open the image
	ImageReal grayImage;
	grayImage.readFile(filename);
	
	//Construct a steerable pyramid of the image
	SteerablePyramid steerPyr;
	steerPyr.DoFullWaveletAnalysis(grayImage.img(), grayImage.width(), grayImage.height(), true);
	
	if (gGenerateIntermediateImages)
		steerPyr.GeneratePGMimages(grayImage.filename().c_str());
	
	int numLevels = steerPyr.NumLevels();
	cout << "Steerable pyramid will be built with " << numLevels << " levels" << endl;
	if (gManualShrinkageThresholds[0].size() != numLevels + 1)
		gManualShrinkageThresholds[0].resize(numLevels + 1);
	cout << "Thresholds:" << endl;
	cout << "  H:  " << setw(10) << gManualShrinkageThresholds[0][0] << endl;
	cout << "  B:  ";
	for (int i = 1; i < gManualShrinkageThresholds[0].size(); i++)
		cout << setw(10) << gManualShrinkageThresholds[0][i];
	cout << endl << endl;
	
	//Shrink the coefficients
	steerPyr.SoftThreshold(gManualShrinkageThresholds[0]);
	
	if (gGenerateIntermediateImages)
	{
		string s = grayImage.filename() + "_sk";
		steerPyr.GeneratePGMimages(s.c_str());
	}
	
	//Synthesize the steerable pyramid
	ImageReal grayImageShrunk(grayImage.width(), grayImage.height());
	steerPyr.DoFullWaveletSynthesis(grayImageShrunk.img());
	/*
	stringstream denoiseParamSS;
	denoiseParamSS << "_";
	for (int c = 0; c < 3; c++)
	{
		if (c == 0)
			denoiseParamSS << "R";
		else if (c == 1)
			denoiseParamSS << "G";
		else denoiseParamSS << "B";
		
		denoiseParamSS << gManualShrinkageThresholds[c][0];
		for (int i = 1; i < gManualShrinkageThresholds[c].size(); i++)
			denoiseParamSS << "," << gManualShrinkageThresholds[c][i];
	}
	*/
	grayImageShrunk.setFilename(grayImage.filename());
	grayImageShrunk.appendFilename("_dn");
	grayImageShrunk.appendFilename(manualShrinkageThresholdStr);
	grayImageShrunk.writeFile(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsi, %rbx
movq %rdi, %r14
movq 0x1f564(%rip), %r15     # 0x36fd0
leaq 0x14f80(%rip), %rsi     # 0x2c9f3
movl $0x17, %edx
movq %r15, %rdi
callq 0x3360
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
leaq 0x78(%rsp), %rdi
callq 0xcf0c
leaq 0x108(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0xf8(%rsp), %rdi
callq 0xa92c
leaq 0x78(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0xd5da
movq 0xf8(%rsp), %rdi
cmpq %r15, %rdi
je 0x17b03
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x118(%rsp), %rdi
callq 0x1ab34
movq 0xb0(%rsp), %rsi
movl 0xa0(%rsp), %edx
movl 0xa4(%rsp), %ecx
leaq 0x118(%rsp), %rdi
movl $0x1, %r8d
callq 0x1d788
leaq 0x1f9b1(%rip), %r15     # 0x374f1
cmpb $0x1, (%r15)
jne 0x17b95
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0xa92c
movq 0x20(%rsp), %rsi
leaq 0x118(%rsp), %rdi
callq 0x1f43c
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x17b95
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x118(%rsp), %rdi
callq 0x1c346
movl %eax, %ebp
movq 0x1f425(%rip), %rdi     # 0x36fd0
leaq 0x14e59(%rip), %rsi     # 0x2ca0b
movl $0x25, %edx
callq 0x3360
movq 0x1f40d(%rip), %rdi     # 0x36fd0
movl %ebp, %esi
callq 0x34e0
movq %rax, %r14
leaq 0x14e5d(%rip), %rsi     # 0x2ca31
movl $0x7, %edx
movq %rax, %rdi
callq 0x3360
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
leaq 0x1f941(%rip), %r12     # 0x37550
movq 0x8(%r12), %rax
subq (%r12), %rax
sarq $0x3, %rax
incl %ebp
movslq %ebp, %rsi
cmpq %rsi, %rax
je 0x17c32
leaq 0x1f923(%rip), %rdi     # 0x37550
callq 0xa036
movq 0x1f397(%rip), %r14     # 0x36fd0
leaq 0x14df9(%rip), %rsi     # 0x2ca39
movl $0xb, %edx
movq %r14, %rdi
callq 0x3360
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq 0x1f365(%rip), %rdi     # 0x36fd0
callq 0x3040
movq %rax, %rdi
callq 0x31f0
movq 0x1f351(%rip), %r14     # 0x36fd0
leaq 0x14dff(%rip), %rsi     # 0x2ca85
movl $0x6, %edx
movq %r14, %rdi
callq 0x3360
movq (%r14), %rax
movq -0x18(%rax), %rax
movq $0xa, 0x10(%r14,%rax)
movq (%r12), %rax
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x3480
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
movq 0x1f2ec(%rip), %r14     # 0x36fd0
leaq 0x14da3(%rip), %rsi     # 0x2ca8e
movl $0x6, %edx
movq %r14, %rdi
callq 0x3360
movq (%r12), %rax
movq 0x8(%r12), %rcx
subq %rax, %rcx
cmpq $0x9, %rcx
jb 0x17d46
movl $0x1, %r13d
movq (%r14), %rcx
movq -0x18(%rcx), %rcx
movq $0xa, 0x10(%r14,%rcx)
movsd (%rax,%r13,8), %xmm0
movq %r14, %rdi
callq 0x3480
incq %r13
movq (%r12), %rax
movq 0x8(%r12), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r13, %rcx
ja 0x17d10
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq 0x1f26c(%rip), %rdi     # 0x36fd0
callq 0x3040
movq %rax, %rdi
callq 0x31f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31f0
leaq 0x1f7ae(%rip), %rsi     # 0x37550
leaq 0x60(%rsp), %rdi
callq 0x1214e
leaq 0x118(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x1e822
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x17dd5
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x3310
cmpb $0x1, (%r15)
leaq 0x10(%rsp), %r14
jne 0x17e96
movq %rsp, %rdi
movq %r14, (%rdi)
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
addq %rsi, %rdx
callq 0xa92c
leaq 0x14c9a(%rip), %rsi     # 0x2caa3
movq %rsp, %rdi
callq 0x3540
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x17e38
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x17e3f
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x17e6d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3310
movq 0x20(%rsp), %rsi
leaq 0x118(%rsp), %rdi
callq 0x1f43c
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x17e96
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3310
movl 0xa0(%rsp), %esi
movl 0xa4(%rsp), %edx
leaq 0x20(%rsp), %rdi
callq 0xcfba
movq 0x58(%rsp), %rsi
leaq 0x118(%rsp), %rdi
callq 0x1e372
leaq 0xe8(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
addq %rsi, %rdx
leaq 0xd8(%rsp), %rdi
callq 0xa92c
leaq 0x20(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0xce40
movq 0xd8(%rsp), %rdi
cmpq %r15, %rdi
je 0x17f1b
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3310
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x14b1d(%rip), %rsi     # 0x2ca45
leaq 0x14b19(%rip), %rdx     # 0x2ca48
callq 0xa9c2
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0xce5a
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x17f57
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0xc8(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0xb8(%rsp), %rdi
callq 0xa92c
leaq 0x20(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0xce5a
movq 0xb8(%rsp), %rdi
cmpq %r14, %rdi
je 0x17fa9
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x168(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x1, %edx
callq 0xd9fc
leaq 0x178(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17fe1
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x20(%rsp), %rdi
callq 0xd038
leaq 0x118(%rsp), %rdi
callq 0x1aeae
leaq 0x78(%rsp), %rdi
callq 0xd038
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
jne 0x18053
jmp 0x18112
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x18112
movq 0x10(%rsp), %rsi
jmp 0x18058
jmp 0x1810f
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x18112
movq 0x30(%rsp), %rsi
incq %rsi
jmp 0x180cc
jmp 0x1810f
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
cmpq %r14, %rdi
je 0x18101
movq 0xc8(%rsp), %rsi
jmp 0x180ab
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x18101
movq 0x10(%rsp), %rsi
jmp 0x180ab
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
cmpq %r15, %rdi
je 0x18101
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3310
jmp 0x18101
jmp 0x1810f
movq %rax, %rbx
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x18112
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x3310
jmp 0x18112
jmp 0x1810f
jmp 0x180f9
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1811f
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x3310
jmp 0x1811f
movq %rax, %rbx
jmp 0x1811f
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xd038
jmp 0x18112
jmp 0x1810f
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x1aeae
leaq 0x78(%rsp), %rdi
callq 0xd038
movq %rbx, %rdi
callq 0x3500