// File: tewalds[P]morat/gomoku/agentmcts.cpp
// Function: Morat::Gomoku::AgentMCTS::AgentMCTS(Morat::Gomoku::Board const&)
AgentMCTS::AgentMCTS(const Board & b) : Agent(b), pool(this) {
	nodes = 0;
	runs = 0;
	gclimit = 5;

	profile     = false;
	ponder      = false;
//#ifdef SINGLE_THREAD ... make sure only 1 thread
	numthreads  = 1;
	pool.set_num_threads(numthreads);
	maxmem      = 1000*1024*1024;

	msrave      = -2;
	msexplore   = 0;

	explore     = 0;
	parentexplore = false;
	ravefactor  = 500;
	decrrave    = 200;
	knowledge   = true;
	userave     = 1;
	useexplore  = 1;
	fpurgency   = 1;
	rollouts    = 1;
	dynwiden    = 0;
	logdynwiden = (dynwiden ? std::log(dynwiden) : 0);

	shortrave   = false;
	keeptree    = true;
	minimax     = 2;
	visitexpand = 1;
	gcsolved    = 100000;

	localreply  = 0;
	locality    = 0;

	weightedrandom = false;
	lastgoodreply  = false;

	for(int i = 0; i < 4096; i++)
		gammas[i] = 1;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq 0x38(%rsp), %rsi
callq 0x1b360
movq 0x18(%rsp), %rdi
leaq 0x4de2a(%rip), %rax     # 0x65898
movq %rax, (%rdi)
addq $0x40c0, %rdi           # imm = 0x40C0
movq %rdi, 0x20(%rsp)
callq 0x1b3a0
jmp 0x17a84
movq 0x18(%rsp), %rdi
addq $0x4110, %rdi           # imm = 0x4110
movq %rdi, 0x10(%rsp)
callq 0x1b420
jmp 0x17a9c
movq 0x18(%rsp), %rsi
movq %rsi, %rdi
addq $0x54d0, %rdi           # imm = 0x54D0
movq %rdi, 0x8(%rsp)
callq 0x1b4b0
jmp 0x17ab7
movq 0x18(%rsp), %rax
movq $0x0, 0x40f0(%rax)
movq $0x0, 0x4100(%rax)
movl $0x5, 0x40f8(%rax)
movb $0x0, 0x60(%rax)
movb $0x0, 0x50(%rax)
movl $0x1, 0x54(%rax)
movq %rax, %rdi
addq $0x54d0, %rdi           # imm = 0x54D0
movl 0x54(%rax), %esi
callq 0x1b570
jmp 0x17aff
movq 0x18(%rsp), %rax
movq $0x3e800000, 0x58(%rax) # imm = 0x3E800000
vmovss 0x306e0(%rip), %xmm0    # 0x481f4
vmovss %xmm0, 0x64(%rax)
vpxor %xmm0, %xmm0, %xmm0
vmovss %xmm0, 0x68(%rax)
vpxor %xmm0, %xmm0, %xmm0
vmovss %xmm0, 0x70(%rax)
movb $0x0, 0x6c(%rax)
vmovss 0x306b9(%rip), %xmm0    # 0x481f0
vmovss %xmm0, 0x74(%rax)
vmovss 0x306a8(%rip), %xmm0    # 0x481ec
vmovss %xmm0, 0x78(%rax)
movb $0x1, 0x7c(%rax)
vmovss 0x30693(%rip), %xmm0    # 0x481e8
vmovss %xmm0, 0x80(%rax)
vmovss 0x30683(%rip), %xmm0    # 0x481e8
vmovss %xmm0, 0x84(%rax)
vmovss 0x30673(%rip), %xmm0    # 0x481e8
vmovss %xmm0, 0x88(%rax)
movl $0x1, 0x8c(%rax)
vpxor %xmm0, %xmm0, %xmm0
vmovss %xmm0, 0x90(%rax)
vmovss 0x90(%rax), %xmm0
vpxor %xmm1, %xmm1, %xmm1
vucomiss %xmm1, %xmm0
jne 0x17ba9
jp 0x17ba9
jmp 0x17bd0
movq 0x18(%rsp), %rax
vmovss 0x90(%rax), %xmm0
callq 0x1b7a0
vmovss %xmm0, 0x4(%rsp)
jmp 0x17bc3
vmovss 0x4(%rsp), %xmm0
vmovss %xmm0, (%rsp)
jmp 0x17bdb
vpxor %xmm0, %xmm0, %xmm0
vmovss %xmm0, (%rsp)
jmp 0x17bdb
movq 0x18(%rsp), %rax
vmovss (%rsp), %xmm0
vmovss %xmm0, 0x94(%rax)
movb $0x0, 0x98(%rax)
movb $0x1, 0x99(%rax)
movl $0x2, 0x9c(%rax)
movl $0x1, 0xa0(%rax)
movl $0x186a0, 0xa4(%rax)    # imm = 0x186A0
movl $0x0, 0xac(%rax)
movl $0x0, 0xb0(%rax)
movl $0x0, 0xb4(%rax)
movl $0x0, 0xb8(%rax)
movl $0x0, 0x28(%rsp)
cmpl $0x1000, 0x28(%rsp)     # imm = 0x1000
jge 0x17cc5
movq 0x18(%rsp), %rax
movslq 0x28(%rsp), %rcx
vmovss 0x30583(%rip), %xmm0    # 0x481e8
vmovss %xmm0, 0xbc(%rax,%rcx,4)
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x17c49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
jmp 0x17cde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
jmp 0x17cd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
jmp 0x17cca
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
callq 0x1b7c0
jmp 0x17cca
addq $0x48, %rsp
retq
movq 0x10(%rsp), %rdi
callq 0x1b830
movq 0x20(%rsp), %rdi
callq 0x1b8b0
movq 0x18(%rsp), %rdi
callq 0x1e190
movq 0x30(%rsp), %rdi
callq 0x5760
nopw %cs:(%rax,%rax)