// File: /workspace/github_cpp_makefile_star2_O1/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 0x25131(%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 0x1abc9(%rip), %rsi     # 0x2ca99
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 0x11f16
movl 0x2c(%rbx), %eax
cmpl 0x2c(%r14), %eax
je 0x11f22
leaq 0x1ab8c(%rip), %rdi     # 0x2caa9
callq 0x403c
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x25392(%rip), %rax     # 0x372d0
movl (%rax), %eax
cmpq $0x3, %rax
ja 0x11fd0
leaq 0x1a557(%rip), %rcx     # 0x2c4a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
movq %rbx, %rsi
callq 0xf53e
movl $0x3, %r8d
leaq 0x1ab67(%rip), %rcx     # 0x2cad9
jmp 0x11fc0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10672
movl $0x4, %r8d
leaq 0x1ab55(%rip), %rcx     # 0x2cae1
jmp 0x11fc0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x118c9
movl $0x3, %r8d
leaq 0x1ab40(%rip), %rcx     # 0x2cae6
jmp 0x11fc0
movq %r14, %rdi
movq %rbx, %rsi
callq 0xfcde
movl $0x3, %r8d
leaq 0x1ab1d(%rip), %rcx     # 0x2cadd
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 0xa97e
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0xcf04
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x12013
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3310
leaq 0x78(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1aac7(%rip), %rsi     # 0x2caea
leaq 0x1aac3(%rip), %rdx     # 0x2caed
leaq 0x68(%rsp), %rdi
callq 0xaa0e
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0xcf1e
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x12058
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 0xa97e
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0xcf1e
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x1209c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3310
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x120b3
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 0x12109
movq 0x38(%rsp), %rsi
jmp 0x120fc
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x12109
movq 0x78(%rsp), %rsi
jmp 0x120fc
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x12109
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3310
jmp 0x12109
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x12120
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3310
movq %rbx, %rdi
callq 0x3500