// File: bestcoder12[P]Sudoku_Game/sudokusolver.cpp
// Function: safetyInGrid(s_brd::cell (*) [9], int, int, int)
bool safetyInGrid(cell t_board[9][9], int temp_num, int t_row, int t_col)
{
	int i = 0, j = 0;
	
	for (j = 0; j < 9; j++)
	{
		if (temp_num == t_board[t_row][j].get_Int())
		{
			return false;
		}
	}
	
	for (i = 0; i < 9; i++)
	{
		if (temp_num == t_board[i][t_col].get_Int())
		{
			return false;
		}
	}

	i = t_row - (t_row%3);
	j = t_col - (t_col%3);
	int row_lim = i+3;
	int col_lim = j+3;

	for (i = t_row - (t_row%3); i < row_lim; i++)
	{
		for (j = t_col - (t_col%3); j < col_lim; j++)
		{
			if (temp_num == t_board[i][j].get_Int())
			{
				return false;
			}
		}
	}
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x9, -0x24(%rbp)
jge 0x3ed4
movl -0x14(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rax
imulq $0x48, %rax, %rax
addq %rax, %rdi
movslq -0x24(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
callq 0x23a0
movl %eax, %ecx
movl -0x30(%rbp), %eax
cmpl %ecx, %eax
jne 0x3ec7
movb $0x0, -0x1(%rbp)
jmp 0x3ffd
jmp 0x3ec9
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x3e8a
movl $0x0, -0x20(%rbp)
cmpl $0x9, -0x20(%rbp)
jge 0x3f25
movl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x20(%rbp), %rax
imulq $0x48, %rax, %rax
addq %rax, %rdi
movslq -0x1c(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
callq 0x23a0
movl %eax, %ecx
movl -0x34(%rbp), %eax
cmpl %ecx, %eax
jne 0x3f18
movb $0x0, -0x1(%rbp)
jmp 0x3ffd
jmp 0x3f1a
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x3edb
movl -0x18(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x18(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl -0x40(%rbp), %eax
subl %edx, %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x1c(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl -0x3c(%rbp), %eax
subl %edx, %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x2c(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x18(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl -0x38(%rbp), %eax
subl %edx, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x3ff9
movl -0x1c(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x1c(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl -0x44(%rbp), %eax
subl %edx, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x3fec
movl -0x14(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x20(%rbp), %rax
imulq $0x48, %rax, %rax
addq %rax, %rdi
movslq -0x24(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
callq 0x23a0
movl %eax, %ecx
movl -0x48(%rbp), %eax
cmpl %ecx, %eax
jne 0x3fdf
movb $0x0, -0x1(%rbp)
jmp 0x3ffd
jmp 0x3fe1
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x3fa3
jmp 0x3fee
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x3f82
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)