// File: tewalds[P]morat/hex/agentpns.h
// Function: Morat::Hex::AgentPNS::move(Morat::Move const&)
void move(const Move & m){
		pool.pause();

		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(std::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 $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, 0x1d0(%rsp)
movq %rsi, 0x1c8(%rsp)
movq 0x1d0(%rsp), %rdi
movq %rdi, 0x30(%rsp)
addq $0x1430, %rdi           # imm = 0x1430
callq 0x31ee0
movq 0x30(%rsp), %rdi
addq $0x10, %rdi
movq 0x1c8(%rsp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0x1c500
movq 0x30(%rsp), %rdi
callq 0x34700
movq 0x30(%rsp), %rax
movq 0x58(%rax), %rax
movq %rax, 0x1c0(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0x300c0
movq 0x30(%rsp), %rdi
addq $0x1558, %rdi           # imm = 0x1558
callq 0x30e90
movq %rax, 0x38(%rsp)
jmp 0x3132d
movq 0x38(%rsp), %rax
movq %rax, 0x198(%rsp)
movq 0x30(%rsp), %rdi
movq 0x198(%rsp), %rax
movq %rax, 0x20(%rsp)
addq $0x1558, %rdi           # imm = 0x1558
callq 0x30ee0
movq %rax, 0x28(%rsp)
jmp 0x3135f
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpq %rcx, %rax
je 0x313f5
movq 0x198(%rsp), %rdi
addq $0x12, %rdi
movq 0x1c8(%rsp), %rsi
callq 0x1c3e0
testb $0x1, %al
jne 0x31391
jmp 0x313da
movq 0x198(%rsp), %rsi
leaq 0x1a0(%rsp), %rdi
callq 0x30cd0
jmp 0x313a8
movq 0x198(%rsp), %rsi
leaq 0x1a0(%rsp), %rdi
callq 0x34720
jmp 0x313bf
jmp 0x313f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x190(%rsp)
movl %eax, 0x18c(%rsp)
jmp 0x31834
jmp 0x313dc
movq 0x198(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x198(%rsp)
jmp 0x3133a
movq 0x30(%rsp), %rsi
movq %rsi, %rdi
addq $0x1540, %rdi           # imm = 0x1540
addq $0x70, %rsi
callq 0x30ff0
movl %eax, 0x1c(%rsp)
jmp 0x31413
movq 0x30(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, %eax
movl %eax, %ecx
movq 0x58(%rdi), %rax
subq %rcx, %rax
movq %rax, 0x58(%rdi)
addq $0x1540, %rdi           # imm = 0x1540
leaq 0x1a0(%rsp), %rsi
callq 0x30cd0
jmp 0x31441
movq 0x30(%rsp), %rdi
addq $0x1540, %rdi           # imm = 0x1540
leaq 0x1a0(%rsp), %rsi
callq 0x34720
jmp 0x3145c
cmpq $0x0, 0x1c0(%rsp)
jbe 0x317b2
leaq 0xa7(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x5770
movq 0x10(%rsp), %rdx
leaq 0x1d955(%rip), %rsi     # 0x4edde
leaq 0xa8(%rsp), %rdi
callq 0x5590
jmp 0x31498
movq 0x1c0(%rsp), %rsi
leaq 0x80(%rsp), %rdi
callq 0x1a9f0
jmp 0x314af
leaq 0xc8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x19e40
jmp 0x314ce
leaq 0x1bedb(%rip), %rdx     # 0x4d3b0
leaq 0xe8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0xb910
jmp 0x314ec
movq 0x30(%rsp), %rax
movq 0x58(%rax), %rsi
leaq 0x60(%rsp), %rdi
callq 0x1a9f0
jmp 0x31501
leaq 0x108(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0x19e40
jmp 0x3151d
leaq 0x1be96(%rip), %rdx     # 0x4d3ba
leaq 0x128(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0xb910
jmp 0x3153b
movq 0x30(%rsp), %rax
vcvtusi2sdq 0x58(%rax), %xmm0, %xmm0
vmovsd 0x1bc89(%rip), %xmm1    # 0x4d1d8
vmulsd %xmm1, %xmm0, %xmm0
vcvtusi2sdq 0x1c0(%rsp), %xmm1, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
leaq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0x48780
jmp 0x31570
leaq 0x148(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x19e40
jmp 0x3158c
leaq 0x1be30(%rip), %rdx     # 0x4d3c3
leaq 0x168(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0xb910
jmp 0x315aa
leaq 0x168(%rsp), %rdi
callq 0x1a9b0
leaq 0x168(%rsp), %rdi
callq 0x5260
leaq 0x148(%rsp), %rdi
callq 0x5260
leaq 0x40(%rsp), %rdi
callq 0x5260
leaq 0x128(%rsp), %rdi
callq 0x5260
leaq 0x108(%rsp), %rdi
callq 0x5260
leaq 0x60(%rsp), %rdi
callq 0x5260
leaq 0xe8(%rsp), %rdi
callq 0x5260
leaq 0xc8(%rsp), %rdi
callq 0x5260
leaq 0x80(%rsp), %rdi
callq 0x5260
leaq 0xa8(%rsp), %rdi
callq 0x5260
leaq 0xa7(%rsp), %rdi
callq 0x5450
jmp 0x317b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x190(%rsp)
movl %eax, 0x18c(%rsp)
jmp 0x317a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x190(%rsp)
movl %eax, 0x18c(%rsp)
jmp 0x31793
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x190(%rsp)
movl %eax, 0x18c(%rsp)
jmp 0x31786
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x190(%rsp)
movl %eax, 0x18c(%rsp)
jmp 0x31779
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x190(%rsp)
movl %eax, 0x18c(%rsp)
jmp 0x3176c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x190(%rsp)
movl %eax, 0x18c(%rsp)
jmp 0x31762
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x190(%rsp)
movl %eax, 0x18c(%rsp)
jmp 0x31755
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x190(%rsp)
movl %eax, 0x18c(%rsp)
jmp 0x31748
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x190(%rsp)
movl %eax, 0x18c(%rsp)
jmp 0x3173e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x190(%rsp)
movl %eax, 0x18c(%rsp)
leaq 0x148(%rsp), %rdi
callq 0x5260
leaq 0x40(%rsp), %rdi
callq 0x5260
leaq 0x128(%rsp), %rdi
callq 0x5260
leaq 0x108(%rsp), %rdi
callq 0x5260
leaq 0x60(%rsp), %rdi
callq 0x5260
leaq 0xe8(%rsp), %rdi
callq 0x5260
leaq 0xc8(%rsp), %rdi
callq 0x5260
leaq 0x80(%rsp), %rdi
callq 0x5260
leaq 0xa8(%rsp), %rdi
callq 0x5260
leaq 0xa7(%rsp), %rdi
callq 0x5450
jmp 0x31834
movq 0x30(%rsp), %rdi
movq 0x58(%rdi), %rax
movq %rax, (%rsp)
addq $0x1540, %rdi           # imm = 0x1540
callq 0x34750
movl %eax, 0xc(%rsp)
jmp 0x317d1
movq (%rsp), %rax
movl 0xc(%rsp), %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jne 0x317e2
jmp 0x31801
leaq 0x1bbe9(%rip), %rdi     # 0x4d3d2
leaq 0x1d206(%rip), %rsi     # 0x4e9f6
movl $0xe9, %edx
leaq 0x1d5f5(%rip), %rcx     # 0x4edf1
callq 0x52a0
movq 0x30(%rsp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x3181f
movq 0x30(%rsp), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
jmp 0x3181d
jmp 0x3181f
leaq 0x1a0(%rsp), %rdi
callq 0x30100
addq $0x1d8, %rsp            # imm = 0x1D8
retq
leaq 0x1a0(%rsp), %rdi
callq 0x30100
movq 0x190(%rsp), %rdi
callq 0x5760
nop