// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/gtpagent.cpp
// Function: Morat::Hex::GTP::gtp_pns_params(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
GTPResponse GTP::gtp_pns_params(vecstr args){
	AgentPNS * pns =  dynamic_cast<AgentPNS *>(agent);

	if(args.size() == 0)
		return GTPResponse(true, string("\n") +
			"Update the pns solver settings, eg: pns_params -m 100 -s 0 -d 1 -e 0.25 -a 2 -l 0\n"
			"  -m --memory   Memory limit in Mb                                       [" + to_str(pns->memlimit/(1024*1024)) + "]\n"
			"  -t --threads  How many threads to run                                  [" + to_str(pns->numthreads) + "]\n"
			"  -s --ties     Which side to assign ties to, 0 = handle, 1 = p1, 2 = p2 [" + to_str(pns->ties.to_i()) + "]\n"
			"  -d --df       Use depth-first thresholds                               [" + to_str(pns->df) + "]\n"
			"  -e --epsilon  How big should the threshold be                          [" + to_str(pns->epsilon) + "]\n"
			"  -a --abdepth  Run an alpha-beta search of this size at each leaf       [" + to_str(pns->ab) + "]\n"
			);

	string errs;
	for(unsigned int i = 0; i < args.size(); i++) {
		string arg = args[i];

		if((arg == "-t" || arg == "--threads") && i+1 < args.size()){
			pns->numthreads = from_str<int>(args[++i]);
			pns->pool.set_num_threads(pns->numthreads);
		}else if((arg == "-m" || arg == "--memory") && i+1 < args.size()){
			uint64_t mem = from_str<uint64_t>(args[++i]);
			if(mem < 1) return GTPResponse(false, "Memory can't be less than 1mb");
			pns->set_memlimit(mem*1024*1024);
		}else if((arg == "-s" || arg == "--ties") && i+1 < args.size()){
			pns->ties = Side(from_str<int8_t>(args[++i]));
			pns->clear_mem();
		}else if((arg == "-d" || arg == "--df") && i+1 < args.size()){
			pns->df = from_str<bool>(args[++i]);
		}else if((arg == "-e" || arg == "--epsilon") && i+1 < args.size()){
			pns->epsilon = from_str<float>(args[++i]);
		}else if((arg == "-a" || arg == "--abdepth") && i+1 < args.size()){
			pns->ab = from_str<int>(args[++i]);
		}else{
			return GTPResponse(false, "Missing or unknown parameter");
		}
	}

	return GTPResponse(true, errs);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2f8, %rsp            # imm = 0x2F8
movq %rdi, 0x8(%rsp)
movq 0xd8(%rsi), %rdi
movq %rdx, %r15
testq %rdi, %rdi
je 0x1c02d
leaq 0x1fbb6(%rip), %rdx     # 0x3bbd0
leaq 0x1f907(%rip), %rsi     # 0x3b928
xorl %ecx, %ecx
callq 0x53a0
movq %rax, %r14
jmp 0x1c030
xorl %r14d, %r14d
movq 0x8(%r15), %rax
cmpq (%r15), %rax
je 0x1c362
leaq 0x28(%rsp), %rax
leaq 0x58(%rsp), %r13
leaq 0x2b8(%rsp), %rbp
xorl %r12d, %r12d
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x1430(%r14), %rax
movq %rax, 0x10(%rsp)
movq (%r15), %rsi
movq 0x8(%r15), %rcx
movl %r12d, %eax
subq %rsi, %rcx
sarq $0x5, %rcx
cmpq %rax, %rcx
jbe 0x1c665
shlq $0x5, %rax
addq %rax, %rsi
movq %r13, %rdi
callq 0x5490
leaq 0x9fb1(%rip), %rsi      # 0x2604b
movq %r13, %rdi
callq 0x7c91
testb %al, %al
jne 0x1c0b9
leaq 0x9fa1(%rip), %rsi      # 0x2604e
movq %r13, %rdi
callq 0x7c91
testb %al, %al
je 0x1c0fb
movq (%r15), %rdi
movq 0x8(%r15), %rax
leal 0x1(%r12), %ebx
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbx, %rax
jbe 0x1c0fb
movq %rbx, %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0x94a7
movb $0x1, %bpl
movl %eax, 0x1538(%r14)
movq 0x10(%rsp), %rdi
movl %eax, %esi
callq 0x16524
jmp 0x1c33f
leaq 0x9ff7(%rip), %rsi      # 0x260f9
movq %r13, %rdi
callq 0x7c91
testb %al, %al
jne 0x1c121
leaq 0xa326(%rip), %rsi      # 0x2643b
movq %r13, %rdi
callq 0x7c91
testb %al, %al
je 0x1c169
movq (%r15), %rdi
movq 0x8(%r15), %rax
leal 0x1(%r12), %ebx
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbx, %rax
jbe 0x1c169
movq %rbx, %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0xea68
testq %rax, %rax
je 0x1c2d8
movq (%r14), %rcx
shlq $0x14, %rax
movb $0x1, %bpl
movq %r14, %rdi
movq %rax, %rsi
callq *0x30(%rcx)
jmp 0x1c33f
leaq 0x9f6c(%rip), %rsi      # 0x260dc
movq %r13, %rdi
callq 0x7c91
testb %al, %al
jne 0x1c18f
leaq 0xa2df(%rip), %rsi      # 0x26462
movq %r13, %rdi
callq 0x7c91
testb %al, %al
je 0x1c1ce
movq (%r15), %rdi
movq 0x8(%r15), %rax
leal 0x1(%r12), %ebx
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbx, %rax
jbe 0x1c1ce
movq %rbx, %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0x1cb37
movb %al, 0x1534(%r14)
movb $0x1, %bpl
movq (%r14), %rax
movq %r14, %rdi
callq *0x38(%rax)
jmp 0x1c33f
leaq 0x9eea(%rip), %rsi      # 0x260bf
movq %r13, %rdi
callq 0x7c91
testb %al, %al
jne 0x1c1f4
leaq 0xa281(%rip), %rsi      # 0x26469
movq %r13, %rdi
callq 0x7c91
testb %al, %al
je 0x1c227
movq (%r15), %rdi
movq 0x8(%r15), %rax
leal 0x1(%r12), %ebx
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbx, %rax
jbe 0x1c227
movq %rbx, %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0x1cae1
movb %al, 0x152c(%r14)
jmp 0x1c2d3
leaq 0x9e67(%rip), %rsi      # 0x26095
movq %r13, %rdi
callq 0x7c91
testb %al, %al
jne 0x1c24d
leaq 0xa22d(%rip), %rsi      # 0x2646e
movq %r13, %rdi
callq 0x7c91
testb %al, %al
je 0x1c27f
movq (%r15), %rdi
movq 0x8(%r15), %rax
leal 0x1(%r12), %ebx
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbx, %rax
jbe 0x1c27f
movq %rbx, %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0xeac0
vmovss %xmm0, 0x1530(%r14)
jmp 0x1c2d3
leaq 0x9e47(%rip), %rsi      # 0x260cd
movq %r13, %rdi
callq 0x7c91
testb %al, %al
jne 0x1c2a5
leaq 0xa1df(%rip), %rsi      # 0x26478
movq %r13, %rdi
callq 0x7c91
testb %al, %al
je 0x1c30f
movq (%r15), %rdi
movq 0x8(%r15), %rax
leal 0x1(%r12), %ebx
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbx, %rax
jbe 0x1c30f
movq %rbx, %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0x94a7
movl %eax, 0x1528(%r14)
movb $0x1, %bpl
jmp 0x1c33f
leaq 0x2d8(%rsp), %r12
leaq 0xa15d(%rip), %rsi      # 0x26444
leaq 0x38(%rsp), %rdx
movq %r12, %rdi
callq 0x5110
movq 0x8(%rsp), %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x8d00
movq %r12, %rdi
callq 0x5150
xorl %ebp, %ebp
jmp 0x1c33f
leaq 0x9eea(%rip), %rsi      # 0x26200
leaq 0x38(%rsp), %rdx
movq %rbp, %rdi
callq 0x5110
movq 0x8(%rsp), %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x8d00
movq %rbp, %rdi
callq 0x5150
xorl %ebp, %ebp
movl %r12d, %ebx
movq %r13, %rdi
callq 0x5150
incl %ebx
movl %ebx, %r12d
testb %bpl, %bpl
leaq 0x2b8(%rsp), %rbp
jne 0x1c06a
jmp 0x1c690
leaq 0x6573(%rip), %rsi      # 0x228dc
leaq 0x158(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x5110
leaq 0x9e9b(%rip), %rdx      # 0x2621d
leaq 0x178(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x8051
movq 0x60(%r14), %rsi
shrq $0x14, %rsi
leaq 0x138(%rsp), %rdi
callq 0xd463
leaq 0x198(%rsp), %rdi
leaq 0x178(%rsp), %rsi
leaq 0x138(%rsp), %rdx
callq 0xcf24
leaq 0x9eea(%rip), %rdx      # 0x262ba
leaq 0x1b8(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0x8051
movl 0x1538(%r14), %esi
leaq 0x118(%rsp), %rdi
callq 0xd1be
leaq 0x1d8(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
leaq 0x118(%rsp), %rdx
callq 0xcf24
leaq 0x9eea(%rip), %rdx      # 0x26307
leaq 0x1f8(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0x8051
movsbl 0x1534(%r14), %esi
leaq 0xf8(%rsp), %rdi
callq 0x1860f
leaq 0x218(%rsp), %rdi
leaq 0x1f8(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0xcf24
leaq 0x9ee9(%rip), %rdx      # 0x26354
leaq 0x238(%rsp), %rdi
leaq 0x218(%rsp), %rsi
callq 0x8051
movzbl 0x152c(%r14), %esi
leaq 0xd8(%rsp), %rdi
callq 0x1ca27
leaq 0x258(%rsp), %rdi
leaq 0x238(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
callq 0xcf24
leaq 0x9ee8(%rip), %rdx      # 0x263a1
leaq 0x278(%rsp), %rdi
leaq 0x258(%rsp), %rsi
callq 0x8051
vmovss 0x1530(%r14), %xmm0
leaq 0xb8(%rsp), %rdi
callq 0x1ca7e
leaq 0x38(%rsp), %rdi
leaq 0x278(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0xcf24
leaq 0x9ee9(%rip), %rdx      # 0x263ee
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x8051
movl 0x1528(%r14), %esi
leaq 0x98(%rsp), %rdi
callq 0xd1be
leaq 0x18(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0xcf24
leaq 0xa69d(%rip), %rdx      # 0x26be3
leaq 0x298(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x8051
pushq $0x1
popq %rsi
movq 0x8(%rsp), %rdi
leaq 0x298(%rsp), %rdx
callq 0x8d00
leaq 0x298(%rsp), %rdi
callq 0x5150
leaq 0x18(%rsp), %rdi
callq 0x5150
leaq 0x98(%rsp), %rdi
callq 0x5150
leaq 0x58(%rsp), %rdi
callq 0x5150
leaq 0x38(%rsp), %rdi
callq 0x5150
leaq 0xb8(%rsp), %rdi
callq 0x5150
leaq 0x278(%rsp), %rdi
callq 0x5150
leaq 0x258(%rsp), %rdi
callq 0x5150
leaq 0xd8(%rsp), %rdi
callq 0x5150
leaq 0x238(%rsp), %rdi
callq 0x5150
leaq 0x218(%rsp), %rdi
callq 0x5150
leaq 0xf8(%rsp), %rdi
callq 0x5150
leaq 0x1f8(%rsp), %rdi
callq 0x5150
leaq 0x1d8(%rsp), %rdi
callq 0x5150
leaq 0x118(%rsp), %rdi
callq 0x5150
leaq 0x1b8(%rsp), %rdi
callq 0x5150
leaq 0x198(%rsp), %rdi
callq 0x5150
leaq 0x138(%rsp), %rdi
callq 0x5150
leaq 0x178(%rsp), %rdi
callq 0x5150
leaq 0x158(%rsp), %rdi
jmp 0x1c695
leaq 0x78(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x5490
pushq $0x1
popq %rsi
movq 0x8(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x8d00
leaq 0x78(%rsp), %rdi
callq 0x5150
leaq 0x18(%rsp), %rdi
callq 0x5150
movq 0x8(%rsp), %rax
addq $0x2f8, %rsp            # imm = 0x2F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x78(%rsp), %rdi
movq %rax, %rbx
jmp 0x1c883
jmp 0x1c876
leaq 0x298(%rsp), %rdi
movq %rax, %rbx
callq 0x5150
jmp 0x1c6d8
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x5150
jmp 0x1c6e7
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x5150
jmp 0x1c6f9
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x5150
jmp 0x1c708
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x5150
leaq 0xb8(%rsp), %rdi
callq 0x5150
leaq 0x278(%rsp), %rdi
callq 0x5150
leaq 0x258(%rsp), %rdi
callq 0x5150
leaq 0xd8(%rsp), %rdi
callq 0x5150
leaq 0x238(%rsp), %rdi
callq 0x5150
leaq 0x218(%rsp), %rdi
callq 0x5150
leaq 0xf8(%rsp), %rdi
callq 0x5150
leaq 0x1f8(%rsp), %rdi
callq 0x5150
leaq 0x1d8(%rsp), %rdi
callq 0x5150
leaq 0x118(%rsp), %rdi
callq 0x5150
leaq 0x1b8(%rsp), %rdi
callq 0x5150
leaq 0x198(%rsp), %rdi
callq 0x5150
leaq 0x138(%rsp), %rdi
callq 0x5150
leaq 0x178(%rsp), %rdi
callq 0x5150
leaq 0x158(%rsp), %rdi
jmp 0x1c88d
movq %rax, %rbx
jmp 0x1c712
movq %rax, %rbx
jmp 0x1c71f
movq %rax, %rbx
jmp 0x1c72c
movq %rax, %rbx
jmp 0x1c739
movq %rax, %rbx
jmp 0x1c746
movq %rax, %rbx
jmp 0x1c753
movq %rax, %rbx
jmp 0x1c760
movq %rax, %rbx
jmp 0x1c76d
movq %rax, %rbx
jmp 0x1c77a
movq %rax, %rbx
jmp 0x1c787
movq %rax, %rbx
jmp 0x1c794
movq %rax, %rbx
jmp 0x1c7a1
movq %rax, %rbx
jmp 0x1c7ae
movq %rax, %rbx
jmp 0x1c7bb
movq %rax, %rbx
jmp 0x1c7c8
movq %rax, %rbx
jmp 0x1c892
leaq 0x2b8(%rsp), %rdi
jmp 0x1c866
jmp 0x1c87b
leaq 0x2d8(%rsp), %rdi
movq %rax, %rbx
callq 0x5150
jmp 0x1c87e
jmp 0x1c87b
jmp 0x1c87b
jmp 0x1c87b
movq %rax, %rbx
jmp 0x1c888
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x5150
leaq 0x18(%rsp), %rdi
callq 0x5150
movq %rbx, %rdi
callq 0x5650