// File: kebwi[P]Trifid/src/main.cpp
// Function: programBehaviorDenoise()
void programBehaviorDenoise()
{
	if (sInputFilenames.size() < 1)
		die("Supply at least one image as argument:\n  -- PGM - original gray image\n  -- PPM - original RGB image\n");
	
	cout << "Denoising with " << sManualShrinkageThresholdStr << endl;
	for (int imageIdx = 0; imageIdx < sInputFilenames.size(); imageIdx++)
	{
		string fileExtension = sInputFilenames[imageIdx].substr(sInputFilenames[imageIdx].length() - 3, 3);
		myAssert(fileExtension == "pgm" || fileExtension == "ppm");
		
		if (fileExtension == "pgm")
			denoiseGrayImage(sInputFilenames[imageIdx], sManualShrinkageThresholdStr);
		else if (fileExtension == "ppm")
			denoiseRGBImage(sInputFilenames[imageIdx], sManualShrinkageThresholdStr);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
leaq 0x51366(%rip), %rdi     # 0x5a5f8
callq 0xe730
cmpq $0x1, %rax
jae 0x92a9
leaq 0x4060f(%rip), %rdi     # 0x498b3
callq 0x5360
movq 0x50d20(%rip), %rdi     # 0x59fd0
leaq 0x40661(%rip), %rsi     # 0x49918
callq 0x4390
movq %rax, %rdi
leaq 0x51392(%rip), %rsi     # 0x5a658
callq 0x4330
movq %rax, %rdi
movq 0x50ce3(%rip), %rsi     # 0x59fb8
callq 0x43d0
movl $0x0, -0x4(%rbp)
movslq -0x4(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq 0x51305(%rip), %rdi     # 0x5a5f8
callq 0xe730
movq %rax, %rcx
movq -0xc0(%rbp), %rax
cmpq %rcx, %rax
jae 0x9570
movslq -0x4(%rbp), %rsi
leaq 0x512e2(%rip), %rdi     # 0x5a5f8
movq %rdi, -0xe0(%rbp)
callq 0xe750
movq -0xe0(%rbp), %rdi
movq %rax, -0xd8(%rbp)
movslq -0x4(%rbp), %rsi
callq 0xe750
movq %rax, %rdi
callq 0x4550
movq -0xd8(%rbp), %rsi
movq %rax, %rdx
addq $-0x3, %rdx
leaq -0x28(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
movl $0x3, %ecx
callq 0x43c0
movq -0xd0(%rbp), %rdi
leaq 0x40f44(%rip), %rsi     # 0x4a2b6
callq 0xe570
movb %al, -0xc1(%rbp)
jmp 0x937f
movb -0xc1(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0xe1(%rbp)
jne 0x93ba
jmp 0x9394
leaq 0x4110c(%rip), %rsi     # 0x4a4a7
leaq -0x28(%rbp), %rdi
callq 0xe570
movb %al, -0xe2(%rbp)
jmp 0x93ac
movb -0xe2(%rbp), %al
movb %al, -0xe1(%rbp)
jmp 0x93ba
movb -0xe1(%rbp), %al
movzbl %al, %edi
andl $0x1, %edi
callq 0x5470
jmp 0x93cd
leaq 0x40ee2(%rip), %rsi     # 0x4a2b6
leaq -0x28(%rbp), %rdi
callq 0xe570
movb %al, -0xe3(%rbp)
jmp 0x93e5
movb -0xe3(%rbp), %al
testb $0x1, %al
jne 0x93f4
jmp 0x948c
movslq -0x4(%rbp), %rsi
leaq 0x511f9(%rip), %rdi     # 0x5a5f8
callq 0xe750
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x4180
jmp 0x9412
leaq 0x5123f(%rip), %rsi     # 0x5a658
leaq -0x78(%rbp), %rdi
callq 0x4180
jmp 0x9424
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x24310
jmp 0x9433
leaq -0x78(%rbp), %rdi
callq 0x46c8
leaq -0x58(%rbp), %rdi
callq 0x46c8
jmp 0x954e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x9565
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x947e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x46c8
leaq -0x58(%rbp), %rdi
callq 0x46c8
jmp 0x9565
leaq 0x41014(%rip), %rsi     # 0x4a4a7
leaq -0x28(%rbp), %rdi
callq 0xe570
movb %al, -0xe4(%rbp)
jmp 0x94a4
movb -0xe4(%rbp), %al
testb $0x1, %al
jne 0x94b3
jmp 0x954c
movslq -0x4(%rbp), %rsi
leaq 0x5113a(%rip), %rdi     # 0x5a5f8
callq 0xe750
movq %rax, %rsi
leaq -0x98(%rbp), %rdi
callq 0x4180
jmp 0x94d4
leaq 0x5117d(%rip), %rsi     # 0x5a658
leaq -0xb8(%rbp), %rdi
callq 0x4180
jmp 0x94e9
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x249b0
jmp 0x94fe
leaq -0xb8(%rbp), %rdi
callq 0x46c8
leaq -0x98(%rbp), %rdi
callq 0x46c8
jmp 0x954c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x953e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x46c8
leaq -0x98(%rbp), %rdi
callq 0x46c8
jmp 0x9565
jmp 0x954e
leaq -0x28(%rbp), %rdi
callq 0x46c8
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x92e1
leaq -0x28(%rbp), %rdi
callq 0x46c8
jmp 0x9579
addq $0xf0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x4620
nopw %cs:(%rax,%rax)