// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/DebayerProcs.cpp
// Function: deBayer(ImageReal&, Image3ChnlReal&)
void deBayer(ImageReal &grayImage, Image3ChnlReal &rgbImage)
{
	cout << endl << "DeBayerizing..." << endl;
	
	if (rgbImage.width() != grayImage.width() || rgbImage.height() != grayImage.height())
		die("DeBayer output isn't same size as deBayer input");
	
	string suffix;
	switch (gDeBayerMethod)
	{
		case DB_NEAREST_NEIGHBOR:
			nn_deBayer(grayImage, rgbImage);
			suffix = "-nn";
			break;
		case DB_BILINEAR:
			bilinear_deBayer(grayImage, rgbImage);
			suffix = "-bl";
			break;
		case DB_SMOOTH_HUE:
			hue_deBayer(grayImage, rgbImage);
			suffix = "-hue";
			break;
		case DB_ALTERNATING_PROJECTIONS:
			altProj_deBayer(grayImage, rgbImage);
			suffix = "-ap";
			break;
	}
	
	rgbImage.setFilename(grayImage.filename());
	rgbImage.appendFilename("_db");
	rgbImage.appendFilename(suffix);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x2519a(%rip), %r15     # 0x36fd0
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
movq %rax, %r15
leaq 0x19c1a(%rip), %rsi     # 0x2ba81
movl $0xf, %edx
movq %rax, %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
movl 0x28(%rbx), %eax
cmpl 0x28(%r14), %eax
jne 0x11ead
movl 0x2c(%rbx), %eax
cmpl 0x2c(%r14), %eax
je 0x11eb9
leaq 0x19bdd(%rip), %rdi     # 0x2ba91
callq 0x403c
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x253fb(%rip), %rax     # 0x372d0
movl (%rax), %eax
cmpq $0x3, %rax
ja 0x11f67
leaq 0x195a8(%rip), %rcx     # 0x2b490
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
movq %rbx, %rsi
callq 0xf43f
movl $0x3, %r8d
leaq 0x19bb8(%rip), %rcx     # 0x2bac1
jmp 0x11f57
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10620
movl $0x4, %r8d
leaq 0x19ba6(%rip), %rcx     # 0x2bac9
jmp 0x11f57
movq %r14, %rdi
movq %rbx, %rsi
callq 0x11860
movl $0x3, %r8d
leaq 0x19b91(%rip), %rcx     # 0x2bace
jmp 0x11f57
movq %r14, %rdi
movq %rbx, %rsi
callq 0xfc37
movl $0x3, %r8d
leaq 0x19b6e(%rip), %rcx     # 0x2bac5
leaq 0x8(%rsp), %rdi
movq 0x8(%rdi), %rdx
xorl %esi, %esi
callq 0x3430
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0xa92c
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0xce40
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x11faa
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x78(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x19b18(%rip), %rsi     # 0x2bad2
leaq 0x19b14(%rip), %rdx     # 0x2bad5
leaq 0x68(%rsp), %rdi
callq 0xa9c2
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0xce5a
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x11fef
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0xa92c
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0xce5a
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x12033
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3310
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1204a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3310
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x120a0
movq 0x38(%rsp), %rsi
jmp 0x12093
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x120a0
movq 0x78(%rsp), %rsi
jmp 0x12093
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x120a0
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3310
jmp 0x120a0
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x120b7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3310
movq %rbx, %rdi
callq 0x3500
nop