// File: iTruth[P]klotski/klotski_board.cpp
// Function: klotski_board::get_pos_info(int, int) const
std::shared_ptr<klotski_board::pos_info> klotski_board::get_pos_info(int x, int y) const noexcept{
	auto info = std::make_shared<pos_info>();
	try{
		if(situation.at(y).at(x) == 0){
			info->is_item_can_move = false;
			return info;
		}
	}catch(const std::out_of_range&){
		info->is_item_can_move = false;
		return info;
	}
	for(int i=0; i<dy; ++i){
		if(situation[i][x] == 0){
			info->is_item_can_move = true;
			info->is_zero_in_top_or_left = y - i > 0;
			info->Orientation = pos_info::Horizontal;
			info->zero_distance = abs(y - i);
			zero_x = x;
			zero_y = i;
			return info;
		}
	}
	for(int i=0; i<dx; ++i){
		if(situation[y][i] == 0){
			info->is_item_can_move = true;
			info->is_zero_in_top_or_left = x - i > 0;
			info->Orientation = pos_info::Vertical;
			info->zero_distance = abs(x - i);
			zero_x = i;
			zero_y = y;
			return info;
		}
	}
	info->is_item_can_move = false;
	return info;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x58(%rbp)
movq %rdi, %rax
movq %rax, -0x50(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movb $0x0, -0x19(%rbp)
callq 0xe9f0
jmp 0xd717
movq -0x48(%rbp), %rdi
addq $0x18, %rdi
movslq -0x18(%rbp), %rsi
callq 0xea60
movq %rax, -0x60(%rbp)
jmp 0xd72e
movq -0x60(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0xeaa0
movq %rax, -0x68(%rbp)
jmp 0xd741
movq -0x68(%rbp), %rax
cmpl $0x0, (%rax)
jne 0xd7af
movq -0x58(%rbp), %rdi
callq 0xe800
movb $0x0, 0x5(%rax)
movb $0x1, -0x19(%rbp)
movl $0x1, -0x30(%rbp)
jmp 0xd95b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0xd97f
movq -0x28(%rbp), %rdi
callq 0x30e0
movq -0x58(%rbp), %rdi
movq %rax, -0x38(%rbp)
callq 0xe800
movb $0x0, 0x5(%rax)
movb $0x1, -0x19(%rbp)
movl $0x1, -0x30(%rbp)
callq 0x3480
jmp 0xd7b1
jmp 0xd7b6
jmp 0xd95b
movl $0x0, -0x3c(%rbp)
movq -0x48(%rbp), %rcx
movl -0x3c(%rbp), %eax
cmpl 0xc(%rcx), %eax
jge 0xd87e
movq -0x48(%rbp), %rdi
addq $0x18, %rdi
movslq -0x3c(%rbp), %rsi
callq 0xe7c0
movq %rax, %rdi
movslq -0x14(%rbp), %rsi
callq 0xe7e0
cmpl $0x0, (%rax)
jne 0xd86e
movq -0x58(%rbp), %rdi
callq 0xe800
movq -0x58(%rbp), %rdi
movb $0x1, 0x5(%rax)
movl -0x18(%rbp), %eax
subl -0x3c(%rbp), %eax
cmpl $0x0, %eax
setg %al
movb %al, -0x6d(%rbp)
callq 0xe800
movb -0x6d(%rbp), %cl
movq -0x58(%rbp), %rdi
andb $0x1, %cl
movb %cl, 0x4(%rax)
callq 0xe800
movq -0x58(%rbp), %rdi
movl $0x0, (%rax)
movl -0x18(%rbp), %eax
subl -0x3c(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, -0x6c(%rbp)
callq 0xe800
movl -0x6c(%rbp), %edx
movq %rax, %rcx
movq -0x48(%rbp), %rax
movl %edx, 0x8(%rcx)
movl -0x14(%rbp), %ecx
movl %ecx, 0x10(%rax)
movl -0x3c(%rbp), %ecx
movl %ecx, 0x14(%rax)
movb $0x1, -0x19(%rbp)
movl $0x1, -0x30(%rbp)
jmp 0xd95b
jmp 0xd870
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xd7bd
movl $0x0, -0x40(%rbp)
movq -0x48(%rbp), %rcx
movl -0x40(%rbp), %eax
cmpl 0x8(%rcx), %eax
jge 0xd943
movq -0x48(%rbp), %rdi
addq $0x18, %rdi
movslq -0x18(%rbp), %rsi
callq 0xe7c0
movq %rax, %rdi
movslq -0x40(%rbp), %rsi
callq 0xe7e0
cmpl $0x0, (%rax)
jne 0xd933
movq -0x58(%rbp), %rdi
callq 0xe800
movq -0x58(%rbp), %rdi
movb $0x1, 0x5(%rax)
movl -0x14(%rbp), %eax
subl -0x40(%rbp), %eax
cmpl $0x0, %eax
setg %al
movb %al, -0x75(%rbp)
callq 0xe800
movb -0x75(%rbp), %cl
movq -0x58(%rbp), %rdi
andb $0x1, %cl
movb %cl, 0x4(%rax)
callq 0xe800
movq -0x58(%rbp), %rdi
movl $0x1, (%rax)
movl -0x14(%rbp), %eax
subl -0x40(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, -0x74(%rbp)
callq 0xe800
movl -0x74(%rbp), %edx
movq %rax, %rcx
movq -0x48(%rbp), %rax
movl %edx, 0x8(%rcx)
movl -0x40(%rbp), %ecx
movl %ecx, 0x10(%rax)
movl -0x18(%rbp), %ecx
movl %ecx, 0x14(%rax)
movb $0x1, -0x19(%rbp)
movl $0x1, -0x30(%rbp)
jmp 0xd95b
jmp 0xd935
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xd885
movq -0x58(%rbp), %rdi
callq 0xe800
movb $0x0, 0x5(%rax)
movb $0x1, -0x19(%rbp)
movl $0x1, -0x30(%rbp)
testb $0x1, -0x19(%rbp)
jne 0xd96a
movq -0x58(%rbp), %rdi
callq 0xe850
movq -0x50(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x5bd0
movq -0x28(%rbp), %rdi
callq 0x5bd0
nopl (%rax,%rax)