// File: 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:
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rdi, 0x1e0(%rsp)
movq %rsi, 0x1d8(%rsp)
movq 0x1e0(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x34f30
movq 0x38(%rsp), %rdi
addq $0x10, %rdi
movq 0x1d8(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x1d4(%rsp)
movl 0x1d4(%rsp), %esi
callq 0xd040
movq 0x38(%rsp), %rdi
callq 0x16380
movq 0x38(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x1c8(%rsp)
leaq 0x1a8(%rsp), %rdi
callq 0x16340
movq 0x38(%rsp), %rdi
addq $0xaf8, %rdi            # imm = 0xAF8
callq 0x369f0
movq %rax, 0x40(%rsp)
jmp 0x372ef
movq 0x40(%rsp), %rax
movq %rax, 0x1a0(%rsp)
movq 0x38(%rsp), %rdi
movq 0x1a0(%rsp), %rax
movq %rax, 0x28(%rsp)
addq $0xaf8, %rdi            # imm = 0xAF8
callq 0x36a40
movq %rax, 0x30(%rsp)
jmp 0x37321
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq %rcx, %rax
je 0x373b7
movq 0x1a0(%rsp), %rdi
addq $0x14, %rdi
movq 0x1d8(%rsp), %rsi
callq 0x285a0
testb $0x1, %al
jne 0x37353
jmp 0x3739c
movq 0x1a0(%rsp), %rsi
leaq 0x1a8(%rsp), %rdi
callq 0x36870
jmp 0x3736a
movq 0x1a0(%rsp), %rsi
leaq 0x1a8(%rsp), %rdi
callq 0x383c0
jmp 0x37381
jmp 0x373b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x198(%rsp)
movl %eax, 0x194(%rsp)
jmp 0x377f8
jmp 0x3739e
movq 0x1a0(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x1a0(%rsp)
jmp 0x372fc
movq 0x38(%rsp), %rsi
movq %rsi, %rdi
addq $0xae0, %rdi            # imm = 0xAE0
addq $0x50, %rsi
callq 0x37000
movl %eax, 0x24(%rsp)
jmp 0x373d5
movq 0x38(%rsp), %rdi
movl 0x24(%rsp), %eax
movl %eax, %eax
movl %eax, %ecx
movq 0x38(%rdi), %rax
subq %rcx, %rax
movq %rax, 0x38(%rdi)
addq $0xae0, %rdi            # imm = 0xAE0
leaq 0x1a8(%rsp), %rsi
callq 0x36870
jmp 0x37403
movq 0x38(%rsp), %rdi
addq $0xae0, %rdi            # imm = 0xAE0
leaq 0x1a8(%rsp), %rsi
callq 0x383c0
jmp 0x3741e
cmpq $0x0, 0x1c8(%rsp)
jbe 0x37774
leaq 0xaf(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x4670
movq 0x18(%rsp), %rdx
leaq 0xa146(%rip), %rsi      # 0x41591
leaq 0xb0(%rsp), %rdi
callq 0x44d0
jmp 0x3745a
movq 0x1c8(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0x161a0
jmp 0x37471
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0xe470
jmp 0x37490
leaq 0x946c(%rip), %rdx      # 0x40903
leaq 0xf0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x93b0
jmp 0x374ae
movq 0x38(%rsp), %rax
movq 0x38(%rax), %rsi
leaq 0x68(%rsp), %rdi
callq 0x161a0
jmp 0x374c3
leaq 0x110(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0xe470
jmp 0x374df
leaq 0x9427(%rip), %rdx      # 0x4090d
leaq 0x130(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x93b0
jmp 0x374fd
movq 0x38(%rsp), %rax
vcvtusi2sdq 0x38(%rax), %xmm0, %xmm0
vmovsd 0x6d87(%rip), %xmm1     # 0x3e298
vmulsd %xmm1, %xmm0, %xmm0
vcvtusi2sdq 0x1c8(%rsp), %xmm1, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
leaq 0x48(%rsp), %rdi
movl $0x1, %esi
callq 0x1e870
jmp 0x37532
leaq 0x150(%rsp), %rdi
leaq 0x130(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0xe470
jmp 0x3754e
leaq 0x93c1(%rip), %rdx      # 0x40916
leaq 0x170(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x93b0
jmp 0x3756c
leaq 0x170(%rsp), %rdi
callq 0x15ad0
leaq 0x170(%rsp), %rdi
callq 0x4210
leaq 0x150(%rsp), %rdi
callq 0x4210
leaq 0x48(%rsp), %rdi
callq 0x4210
leaq 0x130(%rsp), %rdi
callq 0x4210
leaq 0x110(%rsp), %rdi
callq 0x4210
leaq 0x68(%rsp), %rdi
callq 0x4210
leaq 0xf0(%rsp), %rdi
callq 0x4210
leaq 0xd0(%rsp), %rdi
callq 0x4210
leaq 0x88(%rsp), %rdi
callq 0x4210
leaq 0xb0(%rsp), %rdi
callq 0x4210
leaq 0xaf(%rsp), %rdi
callq 0x43f0
jmp 0x37774
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x198(%rsp)
movl %eax, 0x194(%rsp)
jmp 0x37762
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x198(%rsp)
movl %eax, 0x194(%rsp)
jmp 0x37755
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x198(%rsp)
movl %eax, 0x194(%rsp)
jmp 0x37748
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x198(%rsp)
movl %eax, 0x194(%rsp)
jmp 0x3773b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x198(%rsp)
movl %eax, 0x194(%rsp)
jmp 0x3772e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x198(%rsp)
movl %eax, 0x194(%rsp)
jmp 0x37724
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x198(%rsp)
movl %eax, 0x194(%rsp)
jmp 0x37717
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x198(%rsp)
movl %eax, 0x194(%rsp)
jmp 0x3770a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x198(%rsp)
movl %eax, 0x194(%rsp)
jmp 0x37700
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x198(%rsp)
movl %eax, 0x194(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x4210
leaq 0x48(%rsp), %rdi
callq 0x4210
leaq 0x130(%rsp), %rdi
callq 0x4210
leaq 0x110(%rsp), %rdi
callq 0x4210
leaq 0x68(%rsp), %rdi
callq 0x4210
leaq 0xf0(%rsp), %rdi
callq 0x4210
leaq 0xd0(%rsp), %rdi
callq 0x4210
leaq 0x88(%rsp), %rdi
callq 0x4210
leaq 0xb0(%rsp), %rdi
callq 0x4210
leaq 0xaf(%rsp), %rdi
callq 0x43f0
jmp 0x377f8
movq 0x38(%rsp), %rdi
movq 0x38(%rdi), %rax
movq %rax, 0x8(%rsp)
addq $0xae0, %rdi            # imm = 0xAE0
callq 0x383f0
movl %eax, 0x14(%rsp)
jmp 0x37794
movq 0x8(%rsp), %rax
movl 0x14(%rsp), %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jne 0x377a6
jmp 0x377c5
leaq 0x9178(%rip), %rdi      # 0x40925
leaq 0x6956(%rip), %rsi      # 0x3e10a
movl $0xfb, %edx
leaq 0x9de4(%rip), %rcx      # 0x415a4
callq 0x4250
movq 0x38(%rsp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x377e3
movq 0x38(%rsp), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
jmp 0x377e1
jmp 0x377e3
leaq 0x1a8(%rsp), %rdi
callq 0x163b0
addq $0x1e8, %rsp            # imm = 0x1E8
retq
leaq 0x1a8(%rsp), %rdi
callq 0x163b0
movq 0x198(%rsp), %rdi
callq 0x4660
nopw %cs:(%rax,%rax)
nopl (%rax)