// File: /workspace/github_cpp_makefile_star2_O1/tewalds[P]pentagod/./agentpns.h
// Function: AgentPNS::move(Move const&)
void move(const Move & m){
		stop_threads();

		rootboard.move(m);
		reset();


		uint64_t nodesbefore = nodes;

		Node child;

		for(Node * i = root.children.begin(); i != root.children.end(); i++){
			if(i->move == m){
				child = *i;          //copy the child experience to temp
				child.swap_tree(*i); //move the child tree to temp
				break;
			}
		}

		nodes -= root.dealloc(ctmem);
		root = child;
		root.swap_tree(child);

		if(nodesbefore > 0)
			logerr(string("PNS Nodes before: ") + to_str(nodesbefore) + ", after: " + to_str(nodes) + ", saved " + to_str(100.0*nodes/nodesbefore, 1) + "% of the tree\n");

		assert(nodes == root.size());

		if(nodes == 0)
			clear_mem();
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rsi, %r12
movq %rdi, %rbx
callq 0x23304
leaq 0x10(%rbx), %rdi
movl (%r12), %esi
callq 0x9240
movl $0x0, 0x9e0(%rbx)
xorl %ebp, %ebp
movq %rbp, 0x9e8(%rbx)
movb $0x0, 0x8(%rbx)
movq 0x38(%rbx), %r15
leaq 0x80(%rsp), %r13
movw $0x8efc, -0x4(%r13)     # imm = 0x8EFC
movq %rbp, (%r13)
leaq 0xae0(%rbx), %r14
movq 0xaf8(%rbx), %rax
leaq 0x10(%rax), %rcx
cmpq $0x2, %rax
cmovaeq %rcx, %rbp
movzwl (%r12), %edx
addq $0x18, %rbp
cmpq $0x2, %rax
jb 0x24d2c
movzwl 0x6(%rax), %edi
shll $0x5, %edi
addq %rcx, %rdi
jmp 0x24d2e
xorl %edi, %edi
leaq -0x18(%rbp), %rsi
cmpq %rdi, %rsi
je 0x24d85
cmpw %dx, -0x4(%rbp)
je 0x24d43
addq $0x20, %rbp
jmp 0x24d1a
leaq 0x68(%rsp), %rdi
callq 0x242ce
movq 0x80(%rsp), %rax
movq (%rbp), %rcx
movq %rcx, 0x80(%rsp)
movq %rax, (%rbp)
movq 0x80(%rsp), %rax
cmpq $0x2, %rax
jb 0x24d77
movq %r13, 0x8(%rax)
movq (%rbp), %rax
cmpq $0x2, %rax
jb 0x24d85
movq %rbp, 0x8(%rax)
leaq 0x50(%rbx), %rsi
movq %r14, %rdi
callq 0x24b10
movl %eax, %eax
subq %rax, 0x38(%rbx)
leaq 0x68(%rsp), %rsi
movq %r14, %rdi
callq 0x242ce
movq 0xaf8(%rbx), %rcx
movq 0x80(%rsp), %rax
movq %rax, 0xaf8(%rbx)
movq %rcx, 0x80(%rsp)
cmpq $0x2, %rax
jb 0x24dd3
leaq 0xaf8(%rbx), %rcx
movq %rcx, 0x8(%rax)
movq 0x80(%rsp), %rax
cmpq $0x2, %rax
jb 0x24de5
movq %r13, 0x8(%rax)
testq %r15, %r15
jne 0x24e2d
movq 0x38(%rbx), %r15
movq %r14, %rdi
callq 0x25696
movl %eax, %eax
cmpq %rax, %r15
jne 0x25300
cmpq $0x0, 0x38(%rbx)
jne 0x24e11
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x38(%rax)
leaq 0x68(%rsp), %rdi
callq 0xd77e
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x138(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x88c4(%rip), %rsi      # 0x2d705
leaq 0x88cf(%rip), %rdx      # 0x2d717
leaq 0x128(%rsp), %rdi
callq 0xa874
leaq 0x108(%rsp), %rdi
movq %r15, %rsi
callq 0xd669
movq 0x128(%rsp), %rcx
movq 0x130(%rsp), %r8
movq 0x110(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r12, %rcx
je 0x24e93
movq 0x138(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x24eb8
leaq 0x118(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x24eb3
movq 0x118(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x24ecf
movq 0x108(%rsp), %rsi
leaq 0x128(%rsp), %rdi
callq 0x40b0
jmp 0x24ee0
leaq 0x108(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x18(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
jne 0x24eff
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rdx)
jmp 0x24f0c
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x7a6f(%rip), %rsi      # 0x2c99f
leaq 0x8(%rsp), %rdi
callq 0x4610
leaq 0x98(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x24f61
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r13)
jmp 0x24f74
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x90(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x38(%rbx), %rsi
leaq 0xe8(%rsp), %rdi
callq 0xd669
movq 0x88(%rsp), %rcx
movq 0x90(%rsp), %r8
movq 0xf0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r13, %rcx
je 0x24fce
movq 0x98(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x24ff3
leaq 0xf8(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x24fee
movq 0xf8(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x2500a
movq 0xe8(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0x40b0
jmp 0x2501b
leaq 0xe8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x38(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
jne 0x2503a
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rdx)
jmp 0x25047
movq %rsi, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x793e(%rip), %rsi      # 0x2c9a9
leaq 0x28(%rsp), %rdi
callq 0x4610
leaq 0xb8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x2509b
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rbp)
jmp 0x250ae
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0xb0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
vcvtusi2sdq 0x38(%rbx), %xmm1, %xmm0
vmulsd 0x5210(%rip), %xmm0, %xmm0 # 0x2a2e8
vcvtusi2sd %r15, %xmm1, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
leaq 0xc8(%rsp), %rdi
movl $0x1, %esi
callq 0x1579c
movq 0xa8(%rsp), %rcx
movq 0xb0(%rsp), %r8
movq 0xd0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %rbp, %rcx
je 0x25122
movq 0xb8(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x25147
leaq 0xd8(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x25142
movq 0xd8(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x2515e
movq 0xc8(%rsp), %rsi
leaq 0xa8(%rsp), %rdi
callq 0x40b0
jmp 0x2516f
leaq 0xc8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x58(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
jne 0x2518e
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rdx)
jmp 0x2519b
movq %rsi, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x77f3(%rip), %rsi      # 0x2c9b2
leaq 0x48(%rsp), %rdi
callq 0x4610
leaq 0x158(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x251ef
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r15)
jmp 0x25202
movq %rdx, 0x148(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x158(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x150(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x11dbc(%rip), %rax     # 0x36fe0
movq (%rax), %rsi
movq 0x148(%rsp), %rdi
callq 0x4320
movq 0x148(%rsp), %rdi
cmpq %r15, %rdi
je 0x25246
callq 0x42b0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25259
callq 0x42b0
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2526f
callq 0x42b0
movq 0xa8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x25281
callq 0x42b0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25294
callq 0x42b0
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x252aa
callq 0x42b0
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x252bc
callq 0x42b0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x252cf
callq 0x42b0
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x252e5
callq 0x42b0
movq 0x128(%rsp), %rdi
cmpq %r12, %rdi
je 0x24dea
callq 0x42b0
jmp 0x24dea
leaq 0x76ba(%rip), %rdi      # 0x2c9c1
leaq 0x4e58(%rip), %rsi      # 0x2a166
leaq 0x8403(%rip), %rcx      # 0x2d718
movl $0xfb, %edx
callq 0x41b0
jmp 0x25404
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2533f
callq 0x42b0
jmp 0x2533f
movq %rax, %rbx
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2535a
callq 0x42b0
jmp 0x2535a
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x25371
callq 0x42b0
jmp 0x25371
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25389
callq 0x42b0
jmp 0x25389
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x253a4
callq 0x42b0
jmp 0x253a4
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x253bb
callq 0x42b0
jmp 0x253bb
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x253d3
callq 0x42b0
jmp 0x253d3
movq %rax, %rbx
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x253ee
callq 0x42b0
jmp 0x253ee
movq %rax, %rbx
movq 0x128(%rsp), %rdi
cmpq %r12, %rdi
je 0x25407
callq 0x42b0
jmp 0x25407
jmp 0x25404
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xd77e
movq %rbx, %rdi
callq 0x45b0
nop