// File: tewalds[P]morat/hex/agentpns.cpp
// Function: Morat::Hex::AgentPNS::gen_sgf(Morat::SGFPrinter<Morat::Move>&, unsigned int, Morat::Hex::AgentPNS::Node const&, Morat::Side) const
void AgentPNS::gen_sgf(SGFPrinter<Move> & sgf, unsigned int limit, const Node & node, Side side) const {
	for(auto & child : node.children){
		if(child.work >= limit && (side != node.to_outcome(~side) || child.to_outcome(side) == node.to_outcome(~side))){
			sgf.child_start();
			sgf.move(side, child.move);
			sgf.comment(child.to_s());
			gen_sgf(sgf, limit, child, ~side);
			sgf.child_end();
		}
	}
}

// Assembly:
subq $0xd8, %rsp
movb %r8b, %al
movb %al, 0xd7(%rsp)
movq %rdi, 0xc8(%rsp)
movq %rsi, 0xc0(%rsp)
movl %edx, 0xbc(%rsp)
movq %rcx, 0xb0(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0xb0(%rsp), %rax
addq $0x18, %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x30e90
movq %rax, 0xa0(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x30ee0
movq %rax, 0x98(%rsp)
movq 0xa0(%rsp), %rax
cmpq 0x98(%rsp), %rax
je 0x2fd6e
movq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rcx
movl 0xbc(%rsp), %eax
movl %eax, %edx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0x47(%rsp)
jb 0x2fc36
movq 0xb0(%rsp), %rax
movq %rax, 0x38(%rsp)
movb 0xd7(%rsp), %al
movb %al, 0x8d(%rsp)
movzbl 0x8d(%rsp), %edi
callq 0x1c680
movq 0x38(%rsp), %rdi
movb %al, 0x8e(%rsp)
movzbl 0x8e(%rsp), %esi
callq 0x30510
movb %al, 0x8f(%rsp)
leaq 0xd7(%rsp), %rdi
leaq 0x8f(%rsp), %rsi
callq 0x1cb90
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, 0x46(%rsp)
jne 0x2fc2e
movq 0x90(%rsp), %rdi
movb 0xd7(%rsp), %al
movb %al, 0x8b(%rsp)
movzbl 0x8b(%rsp), %esi
callq 0x30510
movb %al, 0x8c(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x30(%rsp)
movb 0xd7(%rsp), %al
movb %al, 0x88(%rsp)
movzbl 0x88(%rsp), %edi
callq 0x1c680
movq 0x30(%rsp), %rdi
movb %al, 0x89(%rsp)
movzbl 0x89(%rsp), %esi
callq 0x30510
movb %al, 0x8a(%rsp)
leaq 0x8c(%rsp), %rdi
leaq 0x8a(%rsp), %rsi
callq 0x1c810
movb %al, 0x46(%rsp)
movb 0x46(%rsp), %al
movb %al, 0x47(%rsp)
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0x2fc43
jmp 0x2fd53
movq 0xc0(%rsp), %rdi
callq 0x1cbd0
movq 0xc0(%rsp), %rdi
movb 0xd7(%rsp), %al
movb %al, 0x87(%rsp)
movq 0x90(%rsp), %rax
movw 0x12(%rax), %ax
movw %ax, 0x84(%rsp)
movzwl 0x84(%rsp), %edx
movzbl 0x87(%rsp), %esi
callq 0x1cd70
movq 0xc0(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x90(%rsp), %rsi
leaq 0x60(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x2c960
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x1cf70
jmp 0x2fcc4
leaq 0x60(%rsp), %rdi
callq 0x5260
movq 0xc0(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0xbc(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x18(%rsp)
movb 0xd7(%rsp), %al
movb %al, 0x52(%rsp)
movzbl 0x52(%rsp), %edi
callq 0x1c680
movq 0x48(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl 0x14(%rsp), %edx
movq 0x18(%rsp), %rcx
movb %al, 0x53(%rsp)
movzbl 0x53(%rsp), %r8d
callq 0x2fa70
movq 0xc0(%rsp), %rdi
callq 0x1d090
jmp 0x2fd53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x5260
jmp 0x2fd76
jmp 0x2fd55
movq 0xa0(%rsp), %rax
addq $0x20, %rax
movq %rax, 0xa0(%rsp)
jmp 0x2faeb
addq $0xd8, %rsp
retq
movq 0x58(%rsp), %rdi
callq 0x5760