// File: /workspace/github_cpp_makefile_star2_O3/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 0x18(%rdx), %rax
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
cmpq $0x2, %rax
jb 0x128c1
cmpw $0x0, 0x6(%rax)
jne 0x12a39
movq %r13, %rdi
addq $0x18, %rbx
callq 0xe682
leal (,%rax,8), %esi
leaq 0xe8(%r14), %rdx
movq %rbx, %rdi
callq 0x14a38
movq (%rbx), %rcx
movq %rbx, 0x8(%rsp)
xorl %r15d, %r15d
movl $0x0, %r12d
movl $0x0, %ebx
leaq 0x10(%rcx), %rax
cmpq $0x2, %rcx
cmovaeq %rax, %r12
jb 0x12914
movzwl 0x6(%rcx), %ecx
shll $0x5, %ecx
addq %rcx, %rax
movq %rax, %rbx
movzbl 0x6c(%r14), %edx
leaq 0x38(%rsp), %rbp
movq %r14, 0x30(%rsp)
movq %r13, %rsi
movq %rbp, %rdi
callq 0xe03e
movb 0x30(%rbp), %dl
cmpb $0x24, %dl
setge %al
cmpq %rbx, %r12
sete %cl
cmpb $0x23, %dl
jg 0x129d6
cmpq %rbx, %r12
je 0x129d6
leaq 0x1f450(%rip), %r14     # 0x31da6
leaq 0x10(%rsp), %r13
leaq 0x38(%rsp), %rbp
xorl %r15d, %r15d
movb (%r14), %al
movzwl 0x68(%rsp), %ecx
vxorps %xmm0, %xmm0, %xmm0
movw $0x0, 0x20(%rsp)
vmovaps %xmm0, 0x10(%rsp)
movb %al, 0x22(%rsp)
movb $0x0, 0x23(%rsp)
movw %cx, 0x24(%rsp)
movw $0xefc, 0x26(%rsp)      # imm = 0xEFC
movq $0x0, 0x28(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x142f0
movq %r13, %rdi
callq 0x13dc2
movq %rbp, %rdi
callq 0xe122
movb 0x68(%rsp), %dl
incl %r15d
addq $0x20, %r12
cmpb $0x24, %dl
setge %al
cmpq %rbx, %r12
sete %cl
cmpb $0x23, %dl
jg 0x129d6
cmpq %rbx, %r12
jne 0x12963
movq 0x30(%rsp), %rbx
cmpb $0x1, 0x6c(%rbx)
jne 0x129f3
movq 0x8(%rsp), %r14
movl %r15d, %esi
movq (%r14), %rdi
callq 0x16b38
jmp 0x129fc
movq 0x8(%rsp), %r14
testb %cl, %al
je 0x12a58
movq (%r14), %rax
cmpq $0x2, %rax
jb 0x12a0b
movzwl 0x6(%rax), %eax
jmp 0x12a0d
xorl %eax, %eax
lock
addq %rax, 0xc8(%rbx)
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x12a27
callq 0x5490
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1addd(%rip), %rdi     # 0x2d81d
leaq 0x1ad11(%rip), %rsi     # 0x2d758
leaq 0x1ade6(%rip), %rcx     # 0x2d834
movl $0x14b, %edx            # imm = 0x14B
callq 0x5200
leaq 0x1ae23(%rip), %rdi     # 0x2d882
leaq 0x1acf2(%rip), %rsi     # 0x2d758
leaq 0x1adc7(%rip), %rcx     # 0x2d834
movl $0x15b, %edx            # imm = 0x15B
callq 0x5200
leaq 0x10(%rsp), %rdi
movq %rax, %rbx
callq 0x13dc2
jmp 0x12a89
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x12a9b
callq 0x5490
movq %rbx, %rdi
callq 0x56c0
nop