// File: /workspace/github_cpp_makefile_star2_O3/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 0x22c60
movl (%r12), %esi
leaq 0x10(%rbx), %rdi
callq 0x9282
movl $0x0, 0x9e0(%rbx)
xorl %r15d, %r15d
movq %r15, 0x9e8(%rbx)
movb $0x0, 0x8(%rbx)
leaq 0xc0(%rsp), %r13
leaq 0xae0(%rbx), %rsi
leaq 0xaf8(%rbx), %rbp
movq 0x38(%rbx), %r14
movw $0x8efc, -0x4(%r13)     # imm = 0x8EFC
movq %r15, (%r13)
movq 0xaf8(%rbx), %rax
movzwl (%r12), %edx
movq %rsi, %r12
leaq 0x10(%rax), %rcx
cmpq $0x2, %rax
cmovaeq %rcx, %r15
addq $0x18, %r15
cmpq $0x2, %rax
jb 0x24643
movzwl 0x6(%rax), %edi
shll $0x5, %edi
addq %rcx, %rdi
jmp 0x24645
xorl %edi, %edi
leaq -0x18(%r15), %rsi
cmpq %rdi, %rsi
je 0x24695
cmpw %dx, -0x4(%r15)
je 0x2465b
addq $0x20, %r15
jmp 0x24631
leaq 0xa8(%rsp), %rdi
callq 0x23bde
movq 0xc0(%rsp), %rax
movq (%r15), %rcx
movq %rcx, 0xc0(%rsp)
movq %rax, (%r15)
cmpq $0x2, %rcx
jb 0x2468b
movq %r13, 0x8(%rcx)
movq (%r15), %rax
cmpq $0x2, %rax
jb 0x24695
movq %r15, 0x8(%rax)
leaq 0x50(%rbx), %rsi
movq %r12, %rdi
callq 0x2441c
movl %eax, %eax
subq %rax, 0x38(%rbx)
leaq 0xa8(%rsp), %rsi
movq %r12, %rdi
callq 0x23bde
movq (%rbp), %rax
movq 0xc0(%rsp), %rcx
movq %r14, %r15
movq %rcx, (%rbp)
movq %rax, 0xc0(%rsp)
cmpq $0x2, %rcx
jb 0x246e4
movq %rbp, 0x8(%rcx)
movq 0xc0(%rsp), %rax
cmpq $0x2, %rax
jb 0x246ee
movq %r13, 0x8(%rax)
testq %r15, %r15
jne 0x24739
movq 0x38(%rbx), %r15
movq %r12, %rdi
callq 0x24f82
movl %eax, %eax
cmpq %rax, %r15
jne 0x24bf0
cmpq $0x0, 0x38(%rbx)
jne 0x2471a
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x38(%rax)
leaq 0xa8(%rsp), %rdi
callq 0xd6fe
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %r14
leaq 0x138(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x7fb5(%rip), %rsi      # 0x2c705
leaq 0x7fc0(%rip), %rdx      # 0x2c717
leaq 0x128(%rsp), %rdi
callq 0xa810
leaq 0x108(%rsp), %rdi
movq %r15, %rsi
callq 0xd5e9
movq 0x130(%rsp), %r8
movq 0x110(%rsp), %rdx
movq 0x128(%rsp), %rcx
movl $0xf, %edi
leaq (%rdx,%r8), %rax
cmpq %r12, %rcx
je 0x247a2
movq 0x138(%rsp), %rdi
movq 0x108(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x247ce
leaq 0x118(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x247c9
movq 0x118(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x247dd
leaq 0x128(%rsp), %rdi
callq 0x40b0
jmp 0x247ee
leaq 0x108(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x18(%rsp), %rdx
leaq 0x10(%rax), %rcx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
cmpq %rcx, %rsi
jne 0x2480d
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rdx)
jmp 0x2481a
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rsi
movq %rax, %rdx
addq $0x8, %rdx
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x7161(%rip), %rsi      # 0x2b99f
leaq 0x8(%rsp), %rdi
callq 0x4610
leaq 0x78(%rsp), %r13
movq %rax, %rcx
addq $0x10, %rcx
movq %r13, -0x10(%r13)
movq (%rax), %rdx
cmpq %rcx, %rdx
jne 0x2486c
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r13)
jmp 0x24879
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x70(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x38(%rbx), %rsi
leaq 0xe8(%rsp), %rdi
callq 0xd5e9
movq 0x70(%rsp), %r8
movq 0xf0(%rsp), %rdx
movq 0x68(%rsp), %rcx
movl $0xf, %edi
leaq (%rdx,%r8), %rax
cmpq %r13, %rcx
je 0x248c7
movq 0x78(%rsp), %rdi
movq 0xe8(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x248f3
leaq 0xf8(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x248ee
movq 0xf8(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x248ff
leaq 0x68(%rsp), %rdi
callq 0x40b0
jmp 0x24910
leaq 0xe8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x38(%rsp), %rdx
leaq 0x10(%rax), %rcx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
cmpq %rcx, %rsi
jne 0x2492f
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rdx)
jmp 0x2493c
movq %rsi, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rsi
movq %rax, %rdx
addq $0x8, %rdx
movq %rsi, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x7049(%rip), %rsi      # 0x2b9a9
leaq 0x28(%rsp), %rdi
callq 0x4610
leaq 0x98(%rsp), %rbp
movq %rax, %rcx
addq $0x10, %rcx
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
cmpq %rcx, %rdx
jne 0x24990
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rbp)
jmp 0x249a3
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)
vcvtusi2sdq 0x38(%rbx), %xmm1, %xmm0
vmulsd 0x490b(%rip), %xmm0, %xmm0 # 0x292d8
vcvtusi2sd %r15, %xmm1, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
leaq 0xc8(%rsp), %rdi
movl $0x1, %esi
callq 0x15694
movq 0x90(%rsp), %r8
movq 0xd0(%rsp), %rdx
movq 0x88(%rsp), %rcx
movl $0xf, %edi
leaq (%rdx,%r8), %rax
cmpq %rbp, %rcx
je 0x24a17
movq 0x98(%rsp), %rdi
movq 0xc8(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x24a43
leaq 0xd8(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x24a3e
movq 0xd8(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x24a52
leaq 0x88(%rsp), %rdi
callq 0x40b0
jmp 0x24a63
leaq 0xc8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x58(%rsp), %rdx
leaq 0x10(%rax), %rcx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
cmpq %rcx, %rsi
jne 0x24a82
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rdx)
jmp 0x24a8f
movq %rsi, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rsi
movq %rax, %rdx
addq $0x8, %rdx
movq %rsi, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x6eff(%rip), %rsi      # 0x2b9b2
leaq 0x48(%rsp), %rdi
callq 0x4610
leaq 0x158(%rsp), %r15
movq %rax, %rcx
addq $0x10, %rcx
movq %r15, -0x10(%r15)
movq (%rax), %rdx
cmpq %rcx, %rdx
jne 0x24ae3
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r15)
jmp 0x24af6
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 0x114c8(%rip), %rax     # 0x35fe0
movq 0x148(%rsp), %rdi
movq (%rax), %rsi
callq 0x4320
movq 0x148(%rsp), %rdi
cmpq %r15, %rdi
je 0x24b3a
callq 0x42b0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x24b4d
callq 0x42b0
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x24b63
callq 0x42b0
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x24b75
callq 0x42b0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x24b88
callq 0x42b0
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x24b9e
callq 0x42b0
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0x24bad
callq 0x42b0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x24bc0
callq 0x42b0
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x24bd6
callq 0x42b0
movq 0x128(%rsp), %rdi
cmpq %r12, %rdi
je 0x24be8
callq 0x42b0
movq %r14, %r12
jmp 0x246f3
leaq 0x6dca(%rip), %rdi      # 0x2b9c1
leaq 0x4558(%rip), %rsi      # 0x29156
leaq 0x7b13(%rip), %rcx      # 0x2c718
movl $0xfb, %edx
callq 0x41b0
jmp 0x24cf1
leaq 0x58(%rsp), %rcx
movq %rax, %rbx
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x24c2f
callq 0x42b0
jmp 0x24c2f
movq %rax, %rbx
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x24c4a
callq 0x42b0
jmp 0x24c4a
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x24c61
callq 0x42b0
jmp 0x24c61
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x24c79
callq 0x42b0
jmp 0x24c79
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x24c94
callq 0x42b0
jmp 0x24c94
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0x24ca8
callq 0x42b0
jmp 0x24ca8
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x24cc0
callq 0x42b0
jmp 0x24cc0
movq %rax, %rbx
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x24cdb
callq 0x42b0
jmp 0x24cdb
movq %rax, %rbx
movq 0x128(%rsp), %rdi
cmpq %r12, %rdi
je 0x24cf4
callq 0x42b0
jmp 0x24cf4
jmp 0x24cf1
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0xd6fe
movq %rbx, %rdi
callq 0x45b0
nop