// File: tewalds[P]pentagod/gtpgeneral.cpp
// Function: PentagoGTP::gtp_undo(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_undo(vecstr args){
	int num = 1;
	if(args.size() >= 1)
		num = from_str<int>(args[0]);

	while(num--){
		game.undo();
		log("undo");
	}
	set_board(false);
	if(verbose >= 2)
		logerr(game.getboard().to_s(colorboard) + "\n");
	return GTPResponse(true);
}

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movq %rdx, 0x20(%rsp)
movq %rdi, %rax
movq 0x20(%rsp), %rdi
movq %rax, 0x28(%rsp)
movq %rax, %rcx
movq %rcx, 0x30(%rsp)
movq %rax, 0x120(%rsp)
movq %rsi, 0x118(%rsp)
movq %rdi, 0x110(%rsp)
movq 0x118(%rsp), %rax
movq %rax, 0x38(%rsp)
movl $0x1, 0x10c(%rsp)
callq 0xcbe0
cmpq $0x1, %rax
jb 0x138e9
movq 0x20(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xcc00
movq %rax, %rdi
callq 0x15a10
movl %eax, 0x10c(%rsp)
jmp 0x138eb
movl 0x10c(%rsp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, 0x10c(%rsp)
cmpl $0x0, %eax
je 0x139be
movq 0x38(%rsp), %rdi
addq $0x38, %rdi
callq 0x15a90
leaq 0xe7(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x4670
movq 0x18(%rsp), %rdx
leaq 0x29c70(%rip), %rsi     # 0x3d5a3
leaq 0xe8(%rsp), %rdi
callq 0x44d0
jmp 0x13942
movq 0x38(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0xcc20
jmp 0x13956
leaq 0xe8(%rsp), %rdi
callq 0x4210
leaq 0xe7(%rsp), %rdi
callq 0x43f0
jmp 0x138eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
jmp 0x139ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x4210
leaq 0xe7(%rsp), %rdi
callq 0x43f0
jmp 0x13b3f
movq 0x38(%rsp), %rdi
xorl %esi, %esi
callq 0xa540
movq 0x38(%rsp), %rax
cmpl $0x2, 0x50(%rax)
jl 0x13aa5
movq 0x38(%rsp), %rsi
addq $0x38, %rsi
leaq 0x68(%rsp), %rdi
movq %rdi, 0x8(%rsp)
xorl %edx, %edx
callq 0xcf40
movq 0x38(%rsp), %rax
movq 0x8(%rsp), %rsi
movzbl 0x54(%rax), %edx
andl $0x1, %edx
leaq 0x90(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x1f740
movq 0x10(%rsp), %rsi
leaq 0x2a08e(%rip), %rdx     # 0x3dab0
leaq 0xb0(%rsp), %rdi
callq 0x93b0
jmp 0x13a31
leaq 0xb0(%rsp), %rdi
callq 0x15ad0
jmp 0x13a40
leaq 0xb0(%rsp), %rdi
callq 0x4210
leaq 0x90(%rsp), %rdi
callq 0x4210
jmp 0x13aa5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
jmp 0x13a93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x4210
leaq 0x90(%rsp), %rdi
callq 0x4210
jmp 0x13b3f
leaq 0x47(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x4670
movq (%rsp), %rdx
leaq 0x29ff3(%rip), %rsi     # 0x3dab1
leaq 0x48(%rsp), %rdi
callq 0x44d0
jmp 0x13aca
movq 0x28(%rsp), %rdi
movl $0x1, %esi
leaq 0x48(%rsp), %rdx
callq 0xb680
jmp 0x13ae0
leaq 0x48(%rsp), %rdi
callq 0x4210
leaq 0x47(%rsp), %rdi
callq 0x43f0
movq 0x30(%rsp), %rax
addq $0x128, %rsp            # imm = 0x128
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
jmp 0x13b35
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x4210
leaq 0x47(%rsp), %rdi
callq 0x43f0
movq 0xd8(%rsp), %rdi
callq 0x4660
nopl (%rax)