// File: tewalds[P]pentagod/gtpagent.cpp
// Function: PentagoGTP::gtp_ab_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 PentagoGTP::gtp_ab_params(vecstr args){
	AgentAB * ab =  dynamic_cast<AgentAB *>(agent);

	if(args.size() == 0)
		return GTPResponse(true, string("\n") +
			"Set player parameters, eg: params -r 4\n" +
			"  -M --maxmem      Max memory in Mb to use for the tree              [" + to_str(ab->memlimit/(1024*1024)) + "]\n" +
			"  -r --randomness  How many bits of randomness to add to the eval    [" + to_str(ab->randomness) + "]\n"
			);

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

		if((arg == "-M" || arg == "--maxmem") && i+1 < args.size()){
			ab->set_memlimit(from_str<uint64_t>(args[++i])*1024*1024);
		}else if((arg == "-r" || arg == "--randomness") && i+1 < args.size()){
			ab->randomness = from_str<int>(args[++i]);
		}else{
			return GTPResponse(false, "Missing or unknown parameter");
		}
	}
	return GTPResponse(true, errs);
}

// Assembly:
subq $0x288, %rsp            # imm = 0x288
movq %rdx, 0x60(%rsp)
movq %rdi, 0x68(%rsp)
movq %rdi, %rax
movq %rax, 0x70(%rsp)
movq %rdi, 0x280(%rsp)
movq %rsi, 0x278(%rsp)
movq %rdx, 0x270(%rsp)
movq 0x278(%rsp), %rax
movq 0x90(%rax), %rax
movq %rax, 0x78(%rsp)
cmpq $0x0, %rax
je 0x1a8ee
movq 0x78(%rsp), %rdi
leaq 0x35189(%rip), %rsi     # 0x4fa60
leaq 0x35472(%rip), %rdx     # 0x4fd50
xorl %eax, %eax
movl %eax, %ecx
callq 0x4410
movq %rax, 0x58(%rsp)
jmp 0x1a8f7
xorl %eax, %eax
movq %rax, 0x58(%rsp)
jmp 0x1a8f7
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rax
movq %rax, 0x268(%rsp)
callq 0xcbe0
cmpq $0x0, %rax
jne 0x1ac98
leaq 0x167(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x4670
movq 0x50(%rsp), %rdx
leaq 0x2317a(%rip), %rsi     # 0x3dab0
leaq 0x168(%rsp), %rdi
callq 0x44d0
jmp 0x1a945
leaq 0x23d02(%rip), %rdx     # 0x3e64e
leaq 0x188(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x93b0
jmp 0x1a963
leaq 0x23d0c(%rip), %rdx     # 0x3e676
leaq 0x1a8(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x93b0
jmp 0x1a981
movq 0x268(%rsp), %rax
movq 0x48(%rax), %rsi
shrq $0x14, %rsi
leaq 0x130(%rsp), %rdi
callq 0x161a0
jmp 0x1a9a0
leaq 0x1c8(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
leaq 0x130(%rsp), %rdx
callq 0xe470
jmp 0x1a9bf
leaq 0x23995(%rip), %rdx     # 0x3e35b
leaq 0x1e8(%rsp), %rdi
leaq 0x1c8(%rsp), %rsi
callq 0x93b0
jmp 0x1a9dd
leaq 0x23cd9(%rip), %rdx     # 0x3e6bd
leaq 0x208(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x93b0
jmp 0x1a9fb
movq 0x268(%rsp), %rax
movl 0x6c(%rax), %esi
leaq 0x110(%rsp), %rdi
callq 0x16070
jmp 0x1aa15
leaq 0x228(%rsp), %rdi
leaq 0x208(%rsp), %rsi
leaq 0x110(%rsp), %rdx
callq 0xe470
jmp 0x1aa34
leaq 0x23920(%rip), %rdx     # 0x3e35b
leaq 0x248(%rsp), %rdi
leaq 0x228(%rsp), %rsi
callq 0x93b0
jmp 0x1aa52
movq 0x68(%rsp), %rdi
movl $0x1, %esi
leaq 0x248(%rsp), %rdx
callq 0xb680
jmp 0x1aa6b
leaq 0x248(%rsp), %rdi
callq 0x4210
leaq 0x228(%rsp), %rdi
callq 0x4210
leaq 0x110(%rsp), %rdi
callq 0x4210
leaq 0x208(%rsp), %rdi
callq 0x4210
leaq 0x1e8(%rsp), %rdi
callq 0x4210
leaq 0x1c8(%rsp), %rdi
callq 0x4210
leaq 0x130(%rsp), %rdi
callq 0x4210
leaq 0x1a8(%rsp), %rdi
callq 0x4210
leaq 0x188(%rsp), %rdi
callq 0x4210
leaq 0x168(%rsp), %rdi
callq 0x4210
leaq 0x167(%rsp), %rdi
callq 0x43f0
jmp 0x1b036
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0x1ac86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0x1ac79
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0x1ac6c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0x1ac5f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0x1ac52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0x1ac45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0x1ac38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0x1ac2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0x1ac1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0x1ac11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
leaq 0x248(%rsp), %rdi
callq 0x4210
leaq 0x228(%rsp), %rdi
callq 0x4210
leaq 0x110(%rsp), %rdi
callq 0x4210
leaq 0x208(%rsp), %rdi
callq 0x4210
leaq 0x1e8(%rsp), %rdi
callq 0x4210
leaq 0x1c8(%rsp), %rdi
callq 0x4210
leaq 0x130(%rsp), %rdi
callq 0x4210
leaq 0x1a8(%rsp), %rdi
callq 0x4210
leaq 0x188(%rsp), %rdi
callq 0x4210
leaq 0x168(%rsp), %rdi
callq 0x4210
leaq 0x167(%rsp), %rdi
callq 0x43f0
jmp 0x1b043
leaq 0xf0(%rsp), %rdi
callq 0x44e0
movl $0x0, 0xec(%rsp)
movq 0x60(%rsp), %rdi
movl 0xec(%rsp), %eax
movq %rax, 0x48(%rsp)
callq 0xcbe0
movq %rax, %rcx
movq 0x48(%rsp), %rax
cmpq %rcx, %rax
jae 0x1afab
movq 0x60(%rsp), %rdi
movl 0xec(%rsp), %eax
movl %eax, %esi
callq 0xcc00
movq %rax, %rsi
leaq 0xc8(%rsp), %rdi
callq 0x4170
jmp 0x1acfc
leaq 0x23a01(%rip), %rsi     # 0x3e704
leaq 0xc8(%rsp), %rdi
callq 0x8b90
movb %al, 0x47(%rsp)
jmp 0x1ad16
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0x1ad47
jmp 0x1ad20
leaq 0x239e0(%rip), %rsi     # 0x3e707
leaq 0xc8(%rsp), %rdi
callq 0x8b90
movb %al, 0x46(%rsp)
jmp 0x1ad3a
movb 0x46(%rsp), %al
testb $0x1, %al
jne 0x1ad47
jmp 0x1adfb
movq 0x60(%rsp), %rdi
movl 0xec(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movq %rax, 0x38(%rsp)
callq 0xcbe0
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0x1adfb
movq 0x60(%rsp), %rdi
movq 0x268(%rsp), %rax
movq %rax, 0x28(%rsp)
movl 0xec(%rsp), %eax
incl %eax
movl %eax, 0xec(%rsp)
movl %eax, %esi
callq 0xcc00
movq %rax, %rdi
callq 0x1e6e0
movq %rax, 0x30(%rsp)
jmp 0x1adab
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
shlq $0x14, %rsi
movq (%rdi), %rax
movq 0x30(%rax), %rax
callq *%rax
jmp 0x1adc4
jmp 0x1af5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0x1b027
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0x1af9c
leaq 0x237d2(%rip), %rsi     # 0x3e5d4
leaq 0xc8(%rsp), %rdi
callq 0x8b90
movb %al, 0x27(%rsp)
jmp 0x1ae15
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x1ae43
jmp 0x1ae1f
leaq 0x238ea(%rip), %rsi     # 0x3e710
leaq 0xc8(%rsp), %rdi
callq 0x8b90
movb %al, 0x26(%rsp)
jmp 0x1ae39
movb 0x26(%rsp), %al
testb $0x1, %al
jne 0x1ae43
jmp 0x1aea9
movq 0x60(%rsp), %rdi
movl 0xec(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movq %rax, 0x18(%rsp)
callq 0xcbe0
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jae 0x1aea9
movq 0x60(%rsp), %rdi
movl 0xec(%rsp), %eax
incl %eax
movl %eax, 0xec(%rsp)
movl %eax, %esi
callq 0xcc00
movq %rax, %rdi
callq 0x15a10
movl %eax, 0x14(%rsp)
jmp 0x1ae95
movl 0x14(%rsp), %ecx
movq 0x268(%rsp), %rax
movl %ecx, 0x6c(%rax)
jmp 0x1af59
leaq 0xa7(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x4670
movq 0x8(%rsp), %rdx
leaq 0x23719(%rip), %rsi     # 0x3e5e0
leaq 0xa8(%rsp), %rdi
callq 0x44d0
jmp 0x1aed6
movq 0x68(%rsp), %rdi
xorl %esi, %esi
leaq 0xa8(%rsp), %rdx
callq 0xb680
jmp 0x1aeec
leaq 0xa8(%rsp), %rdi
callq 0x4210
leaq 0xa7(%rsp), %rdi
callq 0x43f0
movl $0x1, 0xa0(%rsp)
jmp 0x1af66
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0x1af4a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x4210
leaq 0xa7(%rsp), %rdi
callq 0x43f0
jmp 0x1af9c
jmp 0x1af5b
movl $0x0, 0xa0(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x4210
movl 0xa0(%rsp), %eax
testl %eax, %eax
jne 0x1b018
jmp 0x1af84
jmp 0x1af86
movl 0xec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xec(%rsp)
jmp 0x1acb0
leaq 0xc8(%rsp), %rdi
callq 0x4210
jmp 0x1b027
leaq 0x80(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x4170
jmp 0x1afc2
movq 0x68(%rsp), %rdi
movl $0x1, %esi
leaq 0x80(%rsp), %rdx
callq 0xb680
jmp 0x1afdb
leaq 0x80(%rsp), %rdi
callq 0x4210
movl $0x1, 0xa0(%rsp)
jmp 0x1b018
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x4210
jmp 0x1b027
leaq 0xf0(%rsp), %rdi
callq 0x4210
jmp 0x1b036
leaq 0xf0(%rsp), %rdi
callq 0x4210
jmp 0x1b043
movq 0x70(%rsp), %rax
addq $0x288, %rsp            # imm = 0x288
retq
movq 0x158(%rsp), %rdi
callq 0x4660