// File: rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::check_zero_crossing(Image&, int, int, int)
int ImageProc::check_zero_crossing(Image &img_modified_copy, int i, int j, int k)
{
	if(img_modified_copy.getvalue(i,j,k) != 128)
	{
	 	return (0);
	}
	else if(	(img_modified_copy.getvalue((i),(j-1),k) == 64 && img_modified_copy.getvalue((i),(j+1),k) == 192)
			||	(img_modified_copy.getvalue((i-1),(j-1),k) == 64 && img_modified_copy.getvalue((i+1),(j+1),k) == 192)
			||	(img_modified_copy.getvalue((i-1),(j),k) == 64 && img_modified_copy.getvalue((i+1),(j),k) == 192)
			||	(img_modified_copy.getvalue((i-1),(j+1),k) == 64 && img_modified_copy.getvalue((i+1),(j-1),k) == 192)
			||	(img_modified_copy.getvalue((i),(j-1),k) == 192 && img_modified_copy.getvalue((i),(j+1),k) == 64)
			||	(img_modified_copy.getvalue((i-1),(j-1),k) == 192 && img_modified_copy.getvalue((i+1),(j+1),k) == 64)
			||	(img_modified_copy.getvalue((i-1),(j),k) == 192 && img_modified_copy.getvalue((i+1),(j),k) == 64)
			||	(img_modified_copy.getvalue((i-1),(j+1),k) == 192 && img_modified_copy.getvalue((i+1),(j-1),k) == 64))
		return (1);
	else return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0x80, %eax
je 0x12faa
movl $0x0, -0x4(%rbp)
jmp 0x13196
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
subl $0x1, %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0x40, %eax
jne 0x12fe4
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
addl $0x1, %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0xc0, %eax
je 0x13186
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
subl $0x1, %esi
movl -0x18(%rbp), %edx
subl $0x1, %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0x40, %eax
jne 0x13024
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
addl $0x1, %esi
movl -0x18(%rbp), %edx
addl $0x1, %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0xc0, %eax
je 0x13186
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
subl $0x1, %esi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0x40, %eax
jne 0x1305e
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
addl $0x1, %esi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0xc0, %eax
je 0x13186
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
subl $0x1, %esi
movl -0x18(%rbp), %edx
addl $0x1, %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0x40, %eax
jne 0x1309e
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
addl $0x1, %esi
movl -0x18(%rbp), %edx
subl $0x1, %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0xc0, %eax
je 0x13186
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
subl $0x1, %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0xc0, %eax
jne 0x130d8
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
addl $0x1, %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0x40, %eax
je 0x13186
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
subl $0x1, %esi
movl -0x18(%rbp), %edx
subl $0x1, %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0xc0, %eax
jne 0x13114
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
addl $0x1, %esi
movl -0x18(%rbp), %edx
addl $0x1, %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0x40, %eax
je 0x13186
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
subl $0x1, %esi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0xc0, %eax
jne 0x1314a
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
addl $0x1, %esi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0x40, %eax
je 0x13186
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
subl $0x1, %esi
movl -0x18(%rbp), %edx
addl $0x1, %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0xc0, %eax
jne 0x1318f
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
addl $0x1, %esi
movl -0x18(%rbp), %edx
subl $0x1, %edx
movl -0x1c(%rbp), %ecx
callq 0x83b0
cmpl $0x40, %eax
jne 0x1318f
movl $0x1, -0x4(%rbp)
jmp 0x13196
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop