// File: /workspace/github_cpp_makefile_star2_O1/tewalds[P]morat/pentago/agentmcts.cpp
// Function: Morat::Pentago::AgentMCTS::create_children_simple(Morat::Pentago::Board const&, Morat::Pentago::AgentMCTS::Node*)
void AgentMCTS::create_children_simple(const Board & board, Node * node){
	assert(node->children.empty());

	node->children.alloc(board.moves_avail(), ctmem);

	Node * child = node->children.begin(),
		 * end   = node->children.end();
	MoveIterator moveit(board, prunesymmetry);
	int num_moves = 0;
	for(; !moveit.done() && child != end; ++moveit, ++child){
		*child = Node(*moveit);
		num_moves++;
	}

	if(prunesymmetry)
		node->children.shrink(num_moves); //shrink the node to ignore the extra moves
	else //both end conditions should happen in parallel
		assert(moveit.done() && child == end);

	PLUS(nodes, node->children.num());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
movq 0x18(%rdx), %rax
cmpq $0x2, %rax
jb 0x12a0f
cmpw $0x0, 0x6(%rax)
jne 0x12b87
addq $0x18, %rbx
movq %r13, %rdi
callq 0xe726
leal (,%rax,8), %esi
leaq 0xe8(%r14), %rdx
movq %rbx, %rdi
callq 0x14bda
movq %rbx, 0x8(%rsp)
movq (%rbx), %rcx
leaq 0x10(%rcx), %rax
xorl %r15d, %r15d
movl $0x0, %r12d
movl $0x0, %ebx
cmpq $0x2, %rcx
cmovaeq %rax, %r12
jb 0x12a62
movzwl 0x6(%rcx), %ecx
shll $0x5, %ecx
addq %rcx, %rax
movq %rax, %rbx
movq %r14, 0x30(%rsp)
movzbl 0x6c(%r14), %edx
leaq 0x38(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0xe0ba
movb 0x30(%rbp), %dl
cmpb $0x24, %dl
setge %al
cmpq %rbx, %r12
sete %cl
cmpb $0x23, %dl
jg 0x12b24
cmpq %rbx, %r12
je 0x12b24
xorl %r15d, %r15d
leaq 0x1f2ff(%rip), %r14     # 0x31da6
leaq 0x10(%rsp), %r13
leaq 0x38(%rsp), %rbp
movb (%r14), %al
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x10(%rsp)
movw $0x0, 0x20(%rsp)
movb %al, 0x22(%rsp)
movb $0x0, 0x23(%rsp)
movzwl 0x68(%rsp), %eax
movw %ax, 0x24(%rsp)
movw $0xefc, 0x26(%rsp)      # imm = 0xEFC
movq $0x0, 0x28(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x1447c
movq %r13, %rdi
callq 0x13f14
movq %rbp, %rdi
callq 0xe1b8
incl %r15d
addq $0x20, %r12
movb 0x68(%rsp), %dl
cmpb $0x24, %dl
setge %al
cmpq %rbx, %r12
sete %cl
cmpb $0x23, %dl
jg 0x12b24
cmpq %rbx, %r12
jne 0x12ab1
movq 0x30(%rsp), %rbx
cmpb $0x1, 0x6c(%rbx)
jne 0x12b41
movq 0x8(%rsp), %r14
movq (%r14), %rdi
movl %r15d, %esi
callq 0x16d02
jmp 0x12b4a
testb %cl, %al
movq 0x8(%rsp), %r14
je 0x12ba6
movq (%r14), %rax
cmpq $0x2, %rax
jb 0x12b59
movzwl 0x6(%rax), %eax
jmp 0x12b5b
xorl %eax, %eax
lock
addq %rax, 0xc8(%rbx)
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x12b75
callq 0x5490
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ac8f(%rip), %rdi     # 0x2d81d
leaq 0x1abc3(%rip), %rsi     # 0x2d758
leaq 0x1ac98(%rip), %rcx     # 0x2d834
movl $0x14b, %edx            # imm = 0x14B
callq 0x5200
leaq 0x1acd5(%rip), %rdi     # 0x2d882
leaq 0x1aba4(%rip), %rsi     # 0x2d758
leaq 0x1ac79(%rip), %rcx     # 0x2d834
movl $0x15b, %edx            # imm = 0x15B
callq 0x5200
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x13f14
jmp 0x12bd7
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x12be9
callq 0x5490
movq %rbx, %rdi
callq 0x56c0
nop