// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movq $0x0, (%rdi)
movl $0x20, %edi
callq 0x3250
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x8(%rax)
leaq 0x7aca(%rip), %rcx      # 0xecf8
movq %rcx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq $0x0, 0x10(%rax)
movl $0x0, 0x18(%rax)
movq %rax, 0x8(%rbx)
movq %rcx, (%rbx)
movslq %ebp, %rsi
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rcx
subq %rdi, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
cmpq %rsi, %rdx
jbe 0x7385
leaq (%rsi,%rsi,2), %rdx
movslq %r15d, %rsi
movq (%rdi,%rdx,8), %rcx
movq 0x8(%rdi,%rdx,8), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %rsi, %rdx
jbe 0x7385
cmpl $0x0, (%rcx,%rsi,4)
je 0x7373
movslq 0xc(%r14), %r8
testq %r8, %r8
setg %dl
jle 0x72c8
xorl %edx, %edx
movq (%rdi), %r9
cmpl $0x0, (%r9,%rsi,4)
je 0x7300
incq %rdx
addq $0x18, %rdi
cmpq %rdx, %r8
jne 0x72af
seta %dl
movslq 0x8(%r14), %r8
testq %r8, %r8
setg %sil
jle 0x7360
cmpl $0x0, (%rcx)
je 0x7327
leaq -0x1(%r8), %r9
xorl %esi, %esi
cmpq %rsi, %r9
je 0x7356
leaq 0x1(%rsi), %rdi
cmpl $0x0, 0x4(%rcx,%rsi,4)
movq %rdi, %rsi
jne 0x72e4
cmpq %r8, %rdi
setb %sil
jmp 0x7329
movb $0x1, 0x15(%rax)
subl %edx, %ebp
testl %ebp, %ebp
setg 0x14(%rax)
movl %ebp, %ecx
negl %ecx
cmovsl %ebp, %ecx
movl $0x0, 0x10(%rax)
movl %ecx, 0x18(%rax)
movl %r15d, 0x10(%r14)
movl %edx, 0x14(%r14)
jmp 0x7377
xorl %edi, %edi
movb $0x1, 0x15(%rax)
subl %edi, %r15d
testl %r15d, %r15d
setg 0x14(%rax)
movl $0x1, 0x10(%rax)
movl %r15d, %ecx
negl %ecx
cmovsl %r15d, %ecx
movl %ecx, 0x18(%rax)
movl %edi, 0x10(%r14)
movl %ebp, 0x14(%r14)
movb $0x1, %dl
jmp 0x7360
incq %rsi
cmpq %r8, %rsi
setb %sil
testb %sil, %sil
je 0x7373
testb %dl, %dl
jne 0x7377
movq %rax, %rdi
callq 0x5648
jmp 0x7377
movb $0x0, 0x15(%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x334d(%rip), %rdi      # 0xa6d9
xorl %eax, %eax
callq 0x3330
cmpl $0x2, %edx
jne 0x73ae
movq %rax, %rdi
callq 0x30c0
movq (%rbx), %rax
movb $0x0, 0x5(%rax)
callq 0x3390
jmp 0x7377
movq %rax, %rdi
callq 0x563d