// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rdi, 0x10(%rsp)
movq 0x90(%rsi), %rdi
movq %rdx, %r15
testq %rdi, %rdi
je 0xce71
leaq 0x1defa(%rip), %rdx     # 0x2ad58
leaq 0x1dc03(%rip), %rsi     # 0x2aa68
xorl %ecx, %ecx
callq 0x4340
movq %rax, %r14
jmp 0xce74
xorl %r14d, %r14d
movq 0x8(%r15), %rax
cmpq (%r15), %rax
je 0xcfd4
leaq 0x28(%rsp), %rax
leaq 0x38(%rsp), %r12
leaq 0x178(%rsp), %rbx
xorl %r13d, %r13d
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%r15), %rsi
movq 0x8(%r15), %rcx
movl %r13d, %eax
subq %rsi, %rcx
sarq $0x5, %rcx
cmpq %rax, %rcx
jbe 0xd152
shlq $0x5, %rax
addq %rax, %rsi
movq %r12, %rdi
callq 0x43f0
leaq 0x10842(%rip), %rsi     # 0x1d714
movq %r12, %rdi
callq 0x6462
testb %al, %al
jne 0xcef1
leaq 0x10832(%rip), %rsi     # 0x1d717
movq %r12, %rdi
callq 0x6462
testb %al, %al
je 0xcf2e
movq (%r15), %rdi
movq 0x8(%r15), %rax
leal 0x1(%r13), %ebp
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0xcf2e
movq %rbp, %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0xf23e
movq (%r14), %rcx
shlq $0x14, %rax
movb $0x1, %bl
movq %r14, %rdi
movq %rax, %rsi
callq *0x30(%rcx)
jmp 0xcfb2
leaq 0x106af(%rip), %rsi     # 0x1d5e4
movq %r12, %rdi
callq 0x6462
testb %al, %al
jne 0xcf54
leaq 0x107d8(%rip), %rsi     # 0x1d720
movq %r12, %rdi
callq 0x6462
testb %al, %al
je 0xcf82
movq (%r15), %rdi
movq 0x8(%r15), %rax
leal 0x1(%r13), %ebp
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0xcf82
movq %rbp, %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0xac0f
movl %eax, 0x6c(%r14)
movb $0x1, %bl
jmp 0xcfb2
leaq 0x10667(%rip), %rsi     # 0x1d5f0
leaq 0x58(%rsp), %rdx
movq %rbx, %rdi
callq 0x40f0
movq 0x10(%rsp), %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x761c
movq %rbx, %rdi
callq 0x4130
xorl %ebx, %ebx
movl %r13d, %ebp
movq %r12, %rdi
callq 0x4130
incl %ebp
movl %ebp, %r13d
testb %bl, %bl
leaq 0x178(%rsp), %rbx
jne 0xcea2
jmp 0xd17d
leaq 0xfadd(%rip), %rsi      # 0x1cab8
leaq 0xd8(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x40f0
leaq 0x1066a(%rip), %rdx     # 0x1d65e
leaq 0xf8(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x6821
leaq 0x10676(%rip), %rdx     # 0x1d686
leaq 0x118(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x6821
movq 0x48(%r14), %rsi
shrq $0x14, %rsi
leaq 0xb8(%rsp), %rdi
callq 0xaf8f
leaq 0x138(%rsp), %rdi
leaq 0x118(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0x8365
leaq 0x1030d(%rip), %rdx     # 0x1d36b
leaq 0x58(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x6821
leaq 0x10656(%rip), %rdx     # 0x1d6cd
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x6821
movl 0x6c(%r14), %esi
leaq 0x98(%rsp), %rdi
callq 0xaee1
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x8365
leaq 0x102b6(%rip), %rdx     # 0x1d36b
leaq 0x158(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x6821
pushq $0x1
popq %rsi
movq 0x10(%rsp), %rdi
leaq 0x158(%rsp), %rdx
callq 0x761c
leaq 0x158(%rsp), %rdi
callq 0x4130
leaq 0x18(%rsp), %rdi
callq 0x4130
leaq 0x98(%rsp), %rdi
callq 0x4130
leaq 0x38(%rsp), %rdi
callq 0x4130
leaq 0x58(%rsp), %rdi
callq 0x4130
leaq 0x138(%rsp), %rdi
callq 0x4130
leaq 0xb8(%rsp), %rdi
callq 0x4130
leaq 0x118(%rsp), %rdi
callq 0x4130
leaq 0xf8(%rsp), %rdi
callq 0x4130
leaq 0xd8(%rsp), %rdi
jmp 0xd182
leaq 0x78(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x43f0
pushq $0x1
popq %rsi
movq 0x10(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x761c
leaq 0x78(%rsp), %rdi
callq 0x4130
leaq 0x18(%rsp), %rdi
callq 0x4130
movq 0x10(%rsp), %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x78(%rsp), %rdi
movq %rax, %rbx
jmp 0xd277
jmp 0xd27e
leaq 0x158(%rsp), %rdi
movq %rax, %rbx
callq 0x4130
jmp 0xd1c5
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x4130
jmp 0xd1d4
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x4130
jmp 0xd1e6
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x4130
jmp 0xd1f5
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x4130
leaq 0x138(%rsp), %rdi
callq 0x4130
leaq 0xb8(%rsp), %rdi
callq 0x4130
leaq 0x118(%rsp), %rdi
callq 0x4130
leaq 0xf8(%rsp), %rdi
callq 0x4130
leaq 0xd8(%rsp), %rdi
jmp 0xd286
movq %rax, %rbx
jmp 0xd1ff
movq %rax, %rbx
jmp 0xd20c
movq %rax, %rbx
jmp 0xd219
movq %rax, %rbx
jmp 0xd226
movq %rax, %rbx
jmp 0xd233
movq %rax, %rbx
jmp 0xd28b
leaq 0x178(%rsp), %rdi
movq %rax, %rbx
callq 0x4130
jmp 0xd272
jmp 0xd26f
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x4130
jmp 0xd281
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x4130
movq %rbx, %rdi
callq 0x4590
nop