// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]pentagod/gtpagent.cpp
// Function: PentagoGTP::gtp_time(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_time(vecstr args){
	if(args.size() == 0)
		return GTPResponse(true, string("\n") +
			"Update the time settings, eg: time -s 2.5 -m 10 -g 600 -f 1\n" +
			"Method for distributing remaining time, current: " + time.method_name() + " " + to_str(time.param) + "\n" +
			"  -p --percent  Percentage of the remaining time every move            [10.0]\n" +
			"  -e --even     Multiple of even split of the maximum  remaining moves [2.0]\n" +
			"  -s --stats    Multiple of even split of the expected remaining moves [2.0]\n" +
			"Time allocation\n" +
			"  -m --move     Time per move                                          [" + to_str(time.move) + "]\n" +
			"  -g --game     Time per game                                          [" + to_str(time.game) + "]\n" +
			"  -f --flexible Add remaining time per move to remaining time          [" + to_str(time.flexible) + "]\n" +
			"  -i --maxsims  Maximum number of simulations per move                 [" + to_str(time.max_sims) + "]\n" +
			"Current game\n" +
			"  -r --remain   Remaining time for this game                           [" + to_str(time_remain) + "]\n");

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

		if(arg == "-p" || arg == "--percent"){
			time.method = TimeControl::PERCENT;
			time.param = 10;
			if(i+1 < args.size() && from_str<double>(args[i+1]) > 0) time.param = from_str<double>(args[++i]);
		}else if(arg == "-e" || arg == "--even"){
			time.method = TimeControl::EVEN;
			time.param = 2;
			if(i+1 < args.size() && from_str<double>(args[i+1]) > 0) time.param = from_str<double>(args[++i]);
		}else if(arg == "-s" || arg == "--stats"){
			time.method = TimeControl::STATS;
			time.param = 2;
			if(i+1 < args.size() && from_str<double>(args[i+1]) > 0) time.param = from_str<double>(args[++i]);
		}else if((arg == "-m" || arg == "--move") && i+1 < args.size()){
			time.move = from_str<double>(args[++i]);
		}else if((arg == "-g" || arg == "--game") && i+1 < args.size()){
			time.game = from_str<float>(args[++i]);
		}else if((arg == "-f" || arg == "--flexible") && i+1 < args.size()){
			time.flexible = from_str<bool>(args[++i]);
		}else if((arg == "-i" || arg == "--maxsims") && i+1 < args.size()){
			time.max_sims = from_str<int>(args[++i]);
		}else if((arg == "-r" || arg == "--remain") && i+1 < args.size()){
			time_remain = from_str<double>(args[++i]);
		}else{
			return GTPResponse(false, "Missing or unknown parameter");
		}
	}

	return GTPResponse(true);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x498, %rsp            # imm = 0x498
movq 0x8(%rdx), %rax
movq %rsi, (%rsp)
movq %rdi, 0x10(%rsp)
cmpq (%rdx), %rax
je 0xba62
leaq 0x18(%rsp), %r12
leaq 0x11f27(%rip), %rbx     # 0x1d596
movq %rdx, %r15
xorl %r13d, %r13d
movq (%r15), %rsi
movq 0x8(%r15), %rcx
movl %r13d, %eax
subq %rsi, %rcx
sarq $0x5, %rcx
cmpq %rax, %rcx
jbe 0xbfa5
shlq $0x5, %rax
movq %r12, %rdi
addq %rax, %rsi
callq 0x43f0
movq %r12, %rdi
movq %rbx, %rsi
callq 0x6462
testb %al, %al
jne 0xb6c0
leaq 0x11ee5(%rip), %rsi     # 0x1d599
movq %r12, %rdi
callq 0x6462
testb %al, %al
je 0xb72a
movq (%rsp), %rax
movabsq $0x4024000000000000, %rcx # imm = 0x4024000000000000
leal 0x1(%r13), %ebp
movb $0x1, %r14b
andl $0x0, 0x58(%rax)
movq %rcx, 0x60(%rax)
movq (%r15), %rdi
movq 0x8(%r15), %rax
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0xba44
movq %rbp, %rbx
shlq $0x5, %rbx
addq %rbx, %rdi
callq 0xf0be
vucomisd 0x11b95(%rip), %xmm0    # 0x1d2a0
jbe 0xb83a
addq (%r15), %rbx
movq %rbx, %rdi
callq 0xf0be
movq (%rsp), %rax
vmovsd %xmm0, 0x60(%rax)
jmp 0xb83d
leaq 0x11e72(%rip), %rsi     # 0x1d5a3
movq %r12, %rdi
callq 0x6462
testb %al, %al
jne 0xb750
leaq 0x11e62(%rip), %rsi     # 0x1d5a6
movq %r12, %rdi
callq 0x6462
testb %al, %al
je 0xb7b4
movq (%rsp), %rax
movabsq $0x4000000000000000, %rcx # imm = 0x4000000000000000
leal 0x1(%r13), %ebp
movb $0x1, %r14b
movl $0x1, 0x58(%rax)
movq %rcx, 0x60(%rax)
movq (%r15), %rdi
movq 0x8(%r15), %rax
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0xba44
movq %rbp, %rbx
shlq $0x5, %rbx
addq %rbx, %rdi
callq 0xf0be
vucomisd 0x11b02(%rip), %xmm0    # 0x1d2a0
jbe 0xb83a
addq (%r15), %rbx
movq %rbx, %rdi
callq 0xf0be
jmp 0xb71c
leaq 0x11df2(%rip), %rsi     # 0x1d5ad
movq %r12, %rdi
callq 0x6462
testb %al, %al
jne 0xb7da
leaq 0x11de2(%rip), %rsi     # 0x1d5b0
movq %r12, %rdi
callq 0x6462
testb %al, %al
je 0xb849
movq (%rsp), %rax
movabsq $0x4000000000000000, %rcx # imm = 0x4000000000000000
leal 0x1(%r13), %ebp
movb $0x1, %r14b
movl $0x2, 0x58(%rax)
movq %rcx, 0x60(%rax)
movq (%r15), %rdi
movq 0x8(%r15), %rax
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0xba44
movq %rbp, %rbx
shlq $0x5, %rbx
addq %rbx, %rdi
callq 0xf0be
vucomisd 0x11a78(%rip), %xmm0    # 0x1d2a0
jbe 0xb83a
addq (%r15), %rbx
movq %rbx, %rdi
callq 0xf0be
jmp 0xb71c
movl %r13d, %ebp
leaq 0x11d52(%rip), %rbx     # 0x1d596
jmp 0xba47
leaq 0x11d68(%rip), %rsi     # 0x1d5b8
movq %r12, %rdi
callq 0x6462
testb %al, %al
jne 0xb86f
leaq 0x11d58(%rip), %rsi     # 0x1d5bb
movq %r12, %rdi
callq 0x6462
testb %al, %al
je 0xb8a3
movq (%r15), %rdi
movq 0x8(%r15), %rax
leal 0x1(%r13), %ebp
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0xb8a3
movq %rbp, %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0xf0be
movq (%rsp), %rax
vmovsd %xmm0, 0x70(%rax)
jmp 0xba06
leaq 0x11d18(%rip), %rsi     # 0x1d5c2
movq %r12, %rdi
callq 0x6462
testb %al, %al
jne 0xb8c9
leaq 0x11d08(%rip), %rsi     # 0x1d5c5
movq %r12, %rdi
callq 0x6462
testb %al, %al
je 0xb901
movq (%r15), %rdi
movq 0x8(%r15), %rax
leal 0x1(%r13), %ebp
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0xb901
movq %rbp, %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0xf11e
movq (%rsp), %rax
vcvtss2sd %xmm0, %xmm0, %xmm0
vmovsd %xmm0, 0x68(%rax)
jmp 0xba06
leaq 0x109c5(%rip), %rsi     # 0x1c2cd
movq %r12, %rdi
callq 0x6462
testb %al, %al
jne 0xb927
leaq 0x11cb1(%rip), %rsi     # 0x1d5cc
movq %r12, %rdi
callq 0x6462
testb %al, %al
je 0xb959
movq (%r15), %rdi
movq 0x8(%r15), %rax
leal 0x1(%r13), %ebp
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0xb959
movq %rbp, %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0xf180
movq (%rsp), %rcx
movb %al, 0x78(%rcx)
jmp 0xba06
leaq 0x11c77(%rip), %rsi     # 0x1d5d7
movq %r12, %rdi
callq 0x6462
testb %al, %al
jne 0xb97f
leaq 0x11c67(%rip), %rsi     # 0x1d5da
movq %r12, %rdi
callq 0x6462
testb %al, %al
je 0xb9ae
movq (%r15), %rdi
movq 0x8(%r15), %rax
leal 0x1(%r13), %ebp
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0xb9ae
movq %rbp, %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0xac0f
movq (%rsp), %rcx
movl %eax, 0x7c(%rcx)
jmp 0xba06
leaq 0x11c2f(%rip), %rsi     # 0x1d5e4
movq %r12, %rdi
callq 0x6462
testb %al, %al
jne 0xb9d4
leaq 0x11c1f(%rip), %rsi     # 0x1d5e7
movq %r12, %rdi
callq 0x6462
testb %al, %al
je 0xba0e
movq (%r15), %rdi
movq 0x8(%r15), %rax
leal 0x1(%r13), %ebp
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0xba0e
movq %rbp, %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0xf0be
movq (%rsp), %rax
vmovsd %xmm0, 0x80(%rax)
movb $0x1, %r14b
jmp 0xb83d
leaq 0x478(%rsp), %r14
leaq 0x11bd3(%rip), %rsi     # 0x1d5f0
leaq 0x38(%rsp), %rdx
movq %r14, %rdi
callq 0x40f0
movq 0x10(%rsp), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x761c
movq %r14, %rdi
callq 0x4130
xorl %r14d, %r14d
movl %r13d, %ebp
movq %r12, %rdi
callq 0x4130
incl %ebp
movl %ebp, %r13d
testb %r14b, %r14b
jne 0xb675
jmp 0xbfd7
movq %rdi, %rbx
leaq 0x1104c(%rip), %rsi     # 0x1cab8
leaq 0x158(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x40f0
leaq 0x1182b(%rip), %rdx     # 0x1d2b0
leaq 0x178(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x6821
leaq 0x1184c(%rip), %rdx     # 0x1d2ed
leaq 0x198(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x6821
movq (%rsp), %rax
leaq 0x58(%rax), %rsi
leaq 0x138(%rsp), %rdi
callq 0xeffe
leaq 0x1b8(%rsp), %rdi
leaq 0x198(%rsp), %rsi
leaq 0x138(%rsp), %rdx
callq 0x8365
leaq 0x13cce(%rip), %rdx     # 0x1f7bd
leaq 0x1d8(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
callq 0x6821
movq (%rsp), %rax
vmovsd 0x60(%rax), %xmm0
leaq 0x118(%rsp), %rdi
callq 0xf05d
leaq 0x1f8(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
leaq 0x118(%rsp), %rdx
callq 0x8365
leaq 0x10f7a(%rip), %rdx     # 0x1cab8
leaq 0x218(%rsp), %rdi
leaq 0x1f8(%rsp), %rsi
callq 0x6821
leaq 0x117c5(%rip), %rdx     # 0x1d31f
leaq 0x238(%rsp), %rdi
leaq 0x218(%rsp), %rsi
callq 0x6821
leaq 0x117f8(%rip), %rdx     # 0x1d36e
leaq 0x258(%rsp), %rdi
leaq 0x238(%rsp), %rsi
callq 0x6821
leaq 0x1182a(%rip), %rdx     # 0x1d3bc
leaq 0x278(%rsp), %rdi
leaq 0x258(%rsp), %rsi
callq 0x6821
leaq 0x1185c(%rip), %rdx     # 0x1d40a
leaq 0x298(%rsp), %rdi
leaq 0x278(%rsp), %rsi
callq 0x6821
leaq 0x11851(%rip), %rdx     # 0x1d41b
leaq 0x2b8(%rsp), %rdi
leaq 0x298(%rsp), %rsi
callq 0x6821
movq (%rsp), %rax
vmovsd 0x70(%rax), %xmm0
leaq 0xf8(%rsp), %rdi
callq 0xf05d
leaq 0x2d8(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0x8365
leaq 0x11752(%rip), %rdx     # 0x1d36b
leaq 0x2f8(%rsp), %rdi
leaq 0x2d8(%rsp), %rsi
callq 0x6821
leaq 0x1182f(%rip), %rdx     # 0x1d464
leaq 0x318(%rsp), %rdi
leaq 0x2f8(%rsp), %rsi
callq 0x6821
movq (%rsp), %rax
vmovsd 0x68(%rax), %xmm0
leaq 0xd8(%rsp), %rdi
callq 0xf05d
leaq 0x338(%rsp), %rdi
leaq 0x318(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
callq 0x8365
leaq 0x116e7(%rip), %rdx     # 0x1d36b
leaq 0x358(%rsp), %rdi
leaq 0x338(%rsp), %rsi
callq 0x6821
leaq 0x1180d(%rip), %rdx     # 0x1d4ad
leaq 0x378(%rsp), %rdi
leaq 0x358(%rsp), %rsi
callq 0x6821
movq (%rsp), %rax
movzbl 0x78(%rax), %esi
leaq 0xb8(%rsp), %rdi
callq 0xaf38
leaq 0x398(%rsp), %rdi
leaq 0x378(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0x8365
leaq 0x1167d(%rip), %rdx     # 0x1d36b
leaq 0x3b8(%rsp), %rdi
leaq 0x398(%rsp), %rsi
callq 0x6821
leaq 0x117ec(%rip), %rdx     # 0x1d4f6
leaq 0x3d8(%rsp), %rdi
leaq 0x3b8(%rsp), %rsi
callq 0x6821
movq (%rsp), %rax
movl 0x7c(%rax), %esi
leaq 0x98(%rsp), %rdi
callq 0xaee1
leaq 0x3f8(%rsp), %rdi
leaq 0x3d8(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x8365
leaq 0x11614(%rip), %rdx     # 0x1d36b
leaq 0x418(%rsp), %rdi
leaq 0x3f8(%rsp), %rsi
callq 0x6821
leaq 0x117cc(%rip), %rdx     # 0x1d53f
leaq 0x438(%rsp), %rdi
leaq 0x418(%rsp), %rsi
callq 0x6821
leaq 0x117be(%rip), %rdx     # 0x1d54d
leaq 0x38(%rsp), %rdi
leaq 0x438(%rsp), %rsi
callq 0x6821
movq (%rsp), %rax
vmovsd 0x80(%rax), %xmm0
leaq 0x78(%rsp), %rdi
callq 0xf05d
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x8365
leaq 0x11599(%rip), %rdx     # 0x1d36b
leaq 0x458(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x6821
pushq $0x1
popq %rsi
leaq 0x458(%rsp), %rdx
movq %rbx, %rdi
callq 0x761c
leaq 0x458(%rsp), %rdi
callq 0x4130
leaq 0x18(%rsp), %rdi
callq 0x4130
leaq 0x78(%rsp), %rdi
callq 0x4130
leaq 0x38(%rsp), %rdi
callq 0x4130
leaq 0x438(%rsp), %rdi
callq 0x4130
leaq 0x418(%rsp), %rdi
callq 0x4130
leaq 0x3f8(%rsp), %rdi
callq 0x4130
leaq 0x98(%rsp), %rdi
callq 0x4130
leaq 0x3d8(%rsp), %rdi
callq 0x4130
leaq 0x3b8(%rsp), %rdi
callq 0x4130
leaq 0x398(%rsp), %rdi
callq 0x4130
leaq 0xb8(%rsp), %rdi
callq 0x4130
leaq 0x378(%rsp), %rdi
callq 0x4130
leaq 0x358(%rsp), %rdi
callq 0x4130
leaq 0x338(%rsp), %rdi
callq 0x4130
leaq 0xd8(%rsp), %rdi
callq 0x4130
leaq 0x318(%rsp), %rdi
callq 0x4130
leaq 0x2f8(%rsp), %rdi
callq 0x4130
leaq 0x2d8(%rsp), %rdi
callq 0x4130
leaq 0xf8(%rsp), %rdi
callq 0x4130
leaq 0x2b8(%rsp), %rdi
callq 0x4130
leaq 0x298(%rsp), %rdi
callq 0x4130
leaq 0x278(%rsp), %rdi
callq 0x4130
leaq 0x258(%rsp), %rdi
callq 0x4130
leaq 0x238(%rsp), %rdi
callq 0x4130
leaq 0x218(%rsp), %rdi
callq 0x4130
leaq 0x1f8(%rsp), %rdi
callq 0x4130
leaq 0x118(%rsp), %rdi
callq 0x4130
leaq 0x1d8(%rsp), %rdi
callq 0x4130
leaq 0x1b8(%rsp), %rdi
callq 0x4130
leaq 0x138(%rsp), %rdi
callq 0x4130
leaq 0x198(%rsp), %rdi
callq 0x4130
leaq 0x178(%rsp), %rdi
callq 0x4130
leaq 0x158(%rsp), %rdi
jmp 0xbfd2
leaq 0x10b0d(%rip), %rsi     # 0x1cab9
leaq 0x58(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x40f0
pushq $0x1
popq %rsi
movq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x761c
leaq 0x58(%rsp), %rdi
callq 0x4130
movq 0x10(%rsp), %rax
addq $0x498, %rsp            # imm = 0x498
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x478(%rsp), %rdi
movq %rax, %rbx
callq 0x4130
jmp 0xc2d2
jmp 0xc2cf
leaq 0x58(%rsp), %rdi
movq %rax, %rbx
jmp 0xc2d7
jmp 0xc2ca
leaq 0x458(%rsp), %rdi
movq %rax, %rbx
callq 0x4130
jmp 0xc02f
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x4130
jmp 0xc03e
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x4130
jmp 0xc04d
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x4130
jmp 0xc05c
movq %rax, %rbx
leaq 0x438(%rsp), %rdi
callq 0x4130
leaq 0x418(%rsp), %rdi
callq 0x4130
leaq 0x3f8(%rsp), %rdi
callq 0x4130
leaq 0x98(%rsp), %rdi
callq 0x4130
leaq 0x3d8(%rsp), %rdi
callq 0x4130
leaq 0x3b8(%rsp), %rdi
callq 0x4130
leaq 0x398(%rsp), %rdi
callq 0x4130
leaq 0xb8(%rsp), %rdi
callq 0x4130
leaq 0x378(%rsp), %rdi
callq 0x4130
leaq 0x358(%rsp), %rdi
callq 0x4130
leaq 0x338(%rsp), %rdi
callq 0x4130
leaq 0xd8(%rsp), %rdi
callq 0x4130
leaq 0x318(%rsp), %rdi
callq 0x4130
leaq 0x2f8(%rsp), %rdi
callq 0x4130
leaq 0x2d8(%rsp), %rdi
callq 0x4130
leaq 0xf8(%rsp), %rdi
callq 0x4130
leaq 0x2b8(%rsp), %rdi
callq 0x4130
leaq 0x298(%rsp), %rdi
callq 0x4130
leaq 0x278(%rsp), %rdi
callq 0x4130
leaq 0x258(%rsp), %rdi
callq 0x4130
leaq 0x238(%rsp), %rdi
callq 0x4130
leaq 0x218(%rsp), %rdi
callq 0x4130
leaq 0x1f8(%rsp), %rdi
callq 0x4130
leaq 0x118(%rsp), %rdi
callq 0x4130
leaq 0x1d8(%rsp), %rdi
callq 0x4130
leaq 0x1b8(%rsp), %rdi
callq 0x4130
leaq 0x138(%rsp), %rdi
callq 0x4130
leaq 0x198(%rsp), %rdi
callq 0x4130
leaq 0x178(%rsp), %rdi
callq 0x4130
leaq 0x158(%rsp), %rdi
jmp 0xc2d7
movq %rax, %rbx
jmp 0xc069
movq %rax, %rbx
jmp 0xc076
movq %rax, %rbx
jmp 0xc083
movq %rax, %rbx
jmp 0xc090
movq %rax, %rbx
jmp 0xc09d
movq %rax, %rbx
jmp 0xc0aa
movq %rax, %rbx
jmp 0xc0b7
movq %rax, %rbx
jmp 0xc0c4
movq %rax, %rbx
jmp 0xc0d1
movq %rax, %rbx
jmp 0xc0de
movq %rax, %rbx
jmp 0xc0eb
movq %rax, %rbx
jmp 0xc0f8
movq %rax, %rbx
jmp 0xc105
movq %rax, %rbx
jmp 0xc112
movq %rax, %rbx
jmp 0xc11f
movq %rax, %rbx
jmp 0xc12c
movq %rax, %rbx
jmp 0xc139
movq %rax, %rbx
jmp 0xc146
movq %rax, %rbx
jmp 0xc153
movq %rax, %rbx
jmp 0xc160
movq %rax, %rbx
jmp 0xc16d
movq %rax, %rbx
jmp 0xc17a
movq %rax, %rbx
jmp 0xc187
movq %rax, %rbx
jmp 0xc194
movq %rax, %rbx
jmp 0xc1a1
movq %rax, %rbx
jmp 0xc1ae
movq %rax, %rbx
jmp 0xc1bb
movq %rax, %rbx
jmp 0xc1c8
movq %rax, %rbx
jmp 0xc1d5
movq %rax, %rbx
jmp 0xc2dc
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x4130
movq %rbx, %rdi
callq 0x4590