// File: tewalds[P]morat/gomoku/board.cpp
// Function: Morat::Gomoku::Board::gen_neighbor_list() const
std::shared_ptr<MoveValid> Board::gen_neighbor_list() const {
	std::shared_ptr<MoveValid> list(new MoveValid[vec_size()*24]);
	MoveValid * a = list.get();
	for(int y = 0; y < size_; y++){
		for(int x = 0; x < size_; x++){
			Move pos(x,y);

			for(int i = 0; i < 24; i++){
				Move loc = pos + neighbor_offsets[i];
				*a = MoveValid(loc, (on_board(loc) ? xy(loc) : -1) );
				++a;
			}
		}
	}

	return list;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x28(%rsp)
movq %rdi, %rax
movq %rax, 0x30(%rsp)
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq 0x88(%rsp), %rdi
movq %rdi, 0x38(%rsp)
movb $0x0, 0x87(%rsp)
callq 0x10190
imull $0x18, %eax, %eax
cltq
movq %rax, 0x40(%rsp)
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x48(%rsp)
cmpq $0x0, %rax
je 0x34318
movq 0x48(%rsp), %rax
movq 0x40(%rsp), %rdx
shlq $0x2, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x1fba0
jmp 0x34300
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rax
addq $0x4, %rax
cmpq %rcx, %rax
movq %rax, 0x20(%rsp)
jne 0x342ea
movq 0x28(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x34750
movq 0x28(%rsp), %rdi
callq 0x11690
movq %rax, 0x68(%rsp)
movl $0x0, 0x64(%rsp)
movq 0x38(%rsp), %rcx
movl 0x64(%rsp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x3449f
movl $0x0, 0x60(%rsp)
movq 0x38(%rsp), %rcx
movl 0x60(%rsp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x3448d
movl 0x60(%rsp), %esi
movl 0x64(%rsp), %edx
leaq 0x5e(%rsp), %rdi
callq 0x11460
jmp 0x34382
movl $0x0, 0x58(%rsp)
cmpl $0x18, 0x58(%rsp)
jge 0x3447b
movslq 0x58(%rsp), %rcx
leaq 0x320cf(%rip), %rax     # 0x66470
leaq (%rax,%rcx,4), %rsi
leaq 0x5e(%rsp), %rdi
callq 0x34780
movw %ax, 0xe(%rsp)
jmp 0x343b6
movq 0x38(%rsp), %rdi
movw 0xe(%rsp), %ax
movw %ax, 0x56(%rsp)
leaq 0x56(%rsp), %rsi
callq 0x347c0
movb %al, 0xd(%rsp)
jmp 0x343d5
movb 0xd(%rsp), %al
testb $0x1, %al
jne 0x343df
jmp 0x343fe
movq 0x38(%rsp), %rdi
leaq 0x56(%rsp), %rsi
callq 0x11490
movl %eax, 0x8(%rsp)
jmp 0x343f4
movl 0x8(%rsp), %eax
movl %eax, 0x4(%rsp)
jmp 0x34409
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x4(%rsp)
jmp 0x34409
movl 0x4(%rsp), %edx
leaq 0x52(%rsp), %rdi
leaq 0x56(%rsp), %rsi
callq 0x114c0
jmp 0x3441e
movq 0x68(%rsp), %rax
movl 0x52(%rsp), %ecx
movl %ecx, (%rax)
movq 0x68(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x68(%rsp)
movl 0x58(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58(%rsp)
jmp 0x3438a
movq 0x48(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
callq 0x5530
jmp 0x344c8
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
callq 0xff20
jmp 0x344c8
jmp 0x3447d
movl 0x60(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0x3435a
jmp 0x3448f
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x3433e
movb $0x1, 0x87(%rsp)
testb $0x1, 0x87(%rsp)
jne 0x344bb
movq 0x28(%rsp), %rdi
callq 0xff20
movq 0x30(%rsp), %rax
addq $0x98, %rsp
retq
movq 0x78(%rsp), %rdi
callq 0x5760
nopw %cs:(%rax,%rax)
nopl (%rax)