// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]morat/havannah/board.cpp
// Function: Morat::Havannah::Board::to_s(bool, std::function<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> (Morat::Move)>) const
std::string Board::to_s(bool color, std::function<std::string(Move)> func) const {
	using std::string;
	string white = "O",
	       black = "@",
	       coord = "",
	       reset = "";
	if(color){
		string esc = "\033";
		reset = esc + "[0m";
		coord = esc + "[1;37m";
		white = esc + "[1;33m" + "@"; //yellow
		black = esc + "[1;34m" + "@"; //blue
	}

	string s;
	s += string(size_r_ + 3, ' ');
	for(int i = 0; i < size_r_; i++)
		s += " " + coord + char('A' + i);
	s += "\n";

	for(int y = 0; y < size_; y++){
		s += string(abs(size_r_m1_ - y) + (y + 1 < 10) + 1, ' ');
		s += coord + to_str(y + 1);
		int end = line_end(y);
		for(int x = line_start(y); x < end; x++){
			s += (last_move_ == Move(x, y)   ? coord + "[" :
			      last_move_ == Move(x-1, y) ? coord + "]" : " ");
			Side p = get(x, y);
			if(     p == Side::NONE) s += reset + func(Move(x, y));
			else if(p == Side::P1)   s += white;
			else if(p == Side::P2)   s += black;
			else                     s += "?";
		}
		s += (last_move_ == Move(end-1, y) ? coord + "]" : " ");
		if(y < size_r_m1_)
			s += coord + char('A' + size_r_ + y);
		s += '\n';
	}

	s += reset;
	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, 0x28(%rsp)
leaq 0xf8(%rsp), %rax
leaq 0x181ef(%rip), %rsi     # 0x38a31
leaq 0x181e9(%rip), %rdx     # 0x38a32
leaq 0xe8(%rsp), %rdi
movq %rcx, 0xc0(%rsp)
movq %rax, -0x10(%rax)
callq 0xb1f0
leaq 0xd8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x16968(%rip), %rsi     # 0x371dd
leaq 0x16962(%rip), %rdx     # 0x371de
leaq 0xc8(%rsp), %rdi
callq 0xb1f0
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x13078(%rip), %rdx     # 0x33911
leaq 0x50(%rsp), %rdi
movq %rdx, %rsi
callq 0xb1f0
leaq 0xa8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x13058(%rip), %rdx     # 0x33911
leaq 0x98(%rsp), %rdi
movq %rdx, %rsi
callq 0xb1f0
leaq 0x18(%rsp), %r12
testb %bpl, %bpl
je 0x20b0f
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x168f9(%rip), %rsi     # 0x371df
leaq 0x168f3(%rip), %rdx     # 0x371e0
callq 0xb1f0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x40(%rsp), %rbx
movq %rbx, -0x10(%rbx)
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0xa8c8
leaq 0x168c8(%rip), %rsi     # 0x371e1
leaq 0x30(%rsp), %rdi
callq 0x56e0
leaq 0x30(%rsp), %r13
leaq 0x98(%rsp), %rdi
movq %r13, %rsi
callq 0x5430
movq (%r13), %rdi
cmpq %rbx, %rdi
je 0x20946
callq 0x52e0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x30(%rsp), %rdi
movq %rbx, (%rdi)
addq %rsi, %rdx
callq 0xa8c8
leaq 0x1687e(%rip), %rsi     # 0x371e5
leaq 0x30(%rsp), %rdi
callq 0x56e0
leaq 0x30(%rsp), %r13
leaq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0x5430
movq (%r13), %rdi
cmpq %rbx, %rdi
je 0x20991
callq 0x52e0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x88(%rsp), %r12
movq %r12, -0x10(%r12)
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0xa8c8
leaq 0x16830(%rip), %rsi     # 0x371ec
leaq 0x78(%rsp), %rdi
callq 0x56e0
leaq 0x16810(%rip), %rsi     # 0x371dd
leaq 0x78(%rsp), %rdi
callq 0x56e0
movq %rbx, 0x30(%rsp)
movq %rax, %rcx
addq $0x10, %rcx
movq (%rax), %rdx
cmpq %rcx, %rdx
je 0x209fa
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x20a02
vmovups (%rcx), %xmm0
vmovups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq 0x30(%rsp), %r13
leaq 0xe8(%rsp), %rdi
movq %r13, %rsi
movq %rdx, 0x8(%r13)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x5430
movq (%r13), %rdi
cmpq %rbx, %rdi
je 0x20a3c
callq 0x52e0
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0x20a4b
callq 0x52e0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
addq %rsi, %rdx
callq 0xa8c8
leaq 0x16787(%rip), %rsi     # 0x371f3
leaq 0x78(%rsp), %rdi
callq 0x56e0
leaq 0x16760(%rip), %rsi     # 0x371dd
leaq 0x78(%rsp), %rdi
callq 0x56e0
movq %rbx, 0x30(%rsp)
movq %rax, %rcx
addq $0x10, %rcx
movq (%rax), %rdx
cmpq %rcx, %rdx
je 0x20aaa
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x20ab2
vmovups (%rcx), %xmm0
vmovups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq 0x30(%rsp), %r13
leaq 0xc8(%rsp), %rdi
movq %r13, %rsi
movq %rdx, 0x8(%r13)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x5430
movq (%r13), %rdi
cmpq %rbx, %rdi
je 0x20aec
callq 0x52e0
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0x20afb
callq 0x52e0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %r12
cmpq %r12, %rdi
je 0x20b0f
callq 0x52e0
movq 0x28(%rsp), %rbx
leaq 0x8(%rsp), %rdi
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %rax, 0xb8(%rsp)
movsbq 0x1(%r15), %rsi
movq %r12, (%rdi)
addq $0x3, %rsi
movl $0x20, %edx
callq 0x53b0
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x50c0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x20b6b
callq 0x52e0
cmpb $0x0, 0x1(%r15)
jle 0x20c3d
leaq 0x16e95(%rip), %r14     # 0x37a12
leaq 0x30(%rsp), %r13
leaq 0x50(%rsp), %rbp
xorl %ebx, %ebx
movq %r13, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x97f9
movq 0x38(%rsp), %rsi
leal 0x41(%rbx), %eax
movsbl %al, %r8d
movl $0x1, %ecx
movq %r13, %rdi
xorl %edx, %edx
callq 0x56c0
movq %r12, 0x8(%rsp)
movq %rax, %rcx
addq $0x10, %rcx
movq (%rax), %rdx
cmpq %rcx, %rdx
je 0x20bd5
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x20bdf
vmovups (%rcx), %xmm0
vmovups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x50c0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x20c1a
callq 0x52e0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x20c2e
callq 0x52e0
movsbl 0x1(%r15), %eax
incl %ebx
cmpl %eax, %ebx
jl 0x20b89
movq 0x28(%rsp), %rdi
leaq 0x12cc7(%rip), %rsi     # 0x33910
callq 0x56e0
leaq 0x8(%rsp), %r13
leaq 0x30(%rsp), %r14
xorl %r12d, %r12d
movsbl (%r15), %eax
cmpl %eax, %r12d
jge 0x210e9
movsbl 0x2(%r15), %eax
subl %r12d, %eax
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
cmpl $0x9, %r12d
leaq 0x18(%rsp), %rax
adcl $0x1, %esi
movq %rax, 0x8(%rsp)
movl $0x20, %edx
movq %r13, %rdi
callq 0x53b0
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x50c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x20cbd
callq 0x52e0
leal 0x1(%r12), %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x1145a
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r8
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
leaq 0x18(%rsp), %rsi
movq %rax, %rcx
addq $0x10, %rcx
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
cmpq %rcx, %rdx
je 0x20d0a
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x20d12
vmovups (%rcx), %xmm0
vmovups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x50c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x20d52
callq 0x52e0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
movl %ebx, 0x74(%rsp)
cmpq %rax, %rdi
je 0x20d6a
callq 0x52e0
movsbl 0x1(%r15), %eax
movsbl 0x2(%r15), %ecx
movsbl (%r15), %r14d
movl %r12d, %r13d
subl %ecx, %r13d
leal (%r12,%rax), %edx
cmpl %eax, %r12d
movl $0x0, %eax
cmovll %edx, %r14d
cmovll %eax, %r13d
cmpl %r14d, %r13d
jge 0x20fc0
movl %r13d, %ebx
shll $0x8, %ebx
addl %r12d, %ebx
movb 0x8(%r15), %cl
movb 0x9(%r15), %al
cmpb %r12b, %cl
jne 0x20deb
cmpb %al, %r13b
jne 0x20deb
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
addq %rsi, %rdx
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
callq 0xa8c8
leaq 0x1819b(%rip), %rsi     # 0x38f7c
movq %rbp, %rdi
callq 0x56e0
jmp 0x20e4f
cmpb %r12b, %cl
jne 0x20e2d
leal -0x1(%r13), %ecx
cmpb %al, %cl
jne 0x20e2d
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
addq %rsi, %rdx
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
callq 0xa8c8
leaq 0x15b98(%rip), %rsi     # 0x369bb
movq %rbp, %rdi
callq 0x56e0
jmp 0x20e4f
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
leaq 0x16bcf(%rip), %rsi     # 0x37a12
leaq 0x16bc9(%rip), %rdx     # 0x37a13
callq 0xb1f0
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x50c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x20e77
callq 0x52e0
movsbl (%r15), %eax
movq 0x10(%r15), %rcx
leaq 0x1827b(%rip), %rdx     # 0x39101
imull %r12d, %eax
addl %r13d, %eax
cltq
shlq $0x4, %rax
movb (%rcx,%rax), %al
cmpb (%rdx), %al
jne 0x20f06
movq 0xc0(%rsp), %rsi
movw %bx, 0x78(%rsp)
cmpq $0x0, 0x10(%rsi)
je 0x2117c
leaq 0x30(%rsp), %rbp
leaq 0x78(%rsp), %rdx
movq %rbp, %rdi
callq *0x18(%rsi)
movq 0x98(%rsp), %rcx
movq 0xa0(%rsp), %r8
movq %rbp, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
leaq 0x18(%rsp), %rsi
movq %rax, %rcx
addq $0x10, %rcx
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
cmpq %rcx, %rdx
je 0x20f3f
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x20f47
leaq 0x181f5(%rip), %rdx     # 0x39102
leaq 0xe8(%rsp), %rcx
cmpb (%rdx), %al
je 0x20f2c
leaq 0x181e3(%rip), %rdx     # 0x39103
leaq 0xc8(%rsp), %rcx
cmpb (%rdx), %al
jne 0x20f9d
movq 0x8(%rcx), %rdx
movq (%rcx), %rsi
movq 0x28(%rsp), %rdi
callq 0x50c0
jmp 0x20fae
vmovups (%rcx), %xmm0
vmovups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x50c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x20f87
callq 0x52e0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x20fae
callq 0x52e0
jmp 0x20fae
movq 0x28(%rsp), %rdi
leaq 0x16251(%rip), %rsi     # 0x371fa
callq 0x56e0
incl %r13d
addl $0x100, %ebx            # imm = 0x100
cmpl %r13d, %r14d
jne 0x20da4
cmpb %r12b, 0x8(%r15)
jne 0x21009
decb %r14b
cmpb %r14b, 0x9(%r15)
jne 0x21009
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
addq %rsi, %rdx
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0xa8c8
leaq 0x159c1(%rip), %rsi     # 0x369bb
movq %r13, %rdi
callq 0x56e0
leaq 0x30(%rsp), %r14
jmp 0x21033
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %r13
leaq 0x169f3(%rip), %rsi     # 0x37a12
leaq 0x169ed(%rip), %rdx     # 0x37a13
movq %r13, %rdi
callq 0xb1f0
leaq 0x30(%rsp), %r14
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x50c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2105b
callq 0x52e0
movsbl 0x2(%r15), %eax
cmpl %eax, %r12d
jge 0x210ce
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movb 0x1(%r15), %bl
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
addq %rsi, %rdx
movq %r13, %rdi
callq 0xa8c8
movq 0x10(%rsp), %rsi
addb %r12b, %bl
addb $0x41, %bl
movsbl %bl, %r8d
movl $0x1, %ecx
movq %r13, %rdi
xorl %edx, %edx
callq 0x56c0
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rbx
callq 0x50c0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x210ce
callq 0x52e0
movq 0x28(%rsp), %rdi
movl $0xa, %esi
callq 0x5290
movl 0x74(%rsp), %eax
movl %eax, %r12d
jmp 0x20c5b
movq 0xa0(%rsp), %rdx
movq 0x98(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x50c0
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2111d
callq 0x52e0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x21131
callq 0x52e0
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x2114b
callq 0x52e0
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x21165
callq 0x52e0
movq 0x28(%rsp), %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5100
jmp 0x21189
jmp 0x21189
jmp 0x211b2
jmp 0x21189
movq 0x78(%rsp), %rdi
movq %rax, %r14
cmpq %r12, %rdi
jne 0x211ab
jmp 0x211b5
jmp 0x211b2
jmp 0x2119e
jmp 0x211b2
movq 0x30(%rsp), %rdi
movq %rax, %r14
cmpq %rbx, %rdi
je 0x211b5
callq 0x52e0
jmp 0x211b5
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
jne 0x212a8
jmp 0x212ad
movq %rax, %r14
jmp 0x212ad
movq 0x8(%rsp), %rdi
movq %rax, %r14
cmpq %r12, %rdi
jne 0x21291
jmp 0x21296
jmp 0x2127a
movq %rax, %r14
jmp 0x212c7
movq %rax, %r14
jmp 0x212db
movq %rax, %r14
jmp 0x212f5
jmp 0x2127a
jmp 0x2127a
jmp 0x2127f
jmp 0x2127a
jmp 0x2127a
movq 0x8(%rsp), %rdi
movq %rax, %r14
cmpq %rbx, %rdi
jne 0x21291
jmp 0x21296
jmp 0x2127f
jmp 0x2127a
jmp 0x2126b
movq 0x8(%rsp), %rdi
movq %rax, %r14
cmpq %r12, %rdi
jne 0x21260
jmp 0x2126e
jmp 0x2127f
jmp 0x2127a
jmp 0x2127a
jmp 0x2127f
jmp 0x2124e
jmp 0x2126b
jmp 0x2127a
jmp 0x2127a
jmp 0x2127f
jmp 0x2127a
jmp 0x2127a
jmp 0x2127f
movq 0x8(%rsp), %rdi
movq %rax, %r14
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2126e
callq 0x52e0
jmp 0x2126e
jmp 0x2127a
jmp 0x2127a
movq %rax, %r14
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
jmp 0x2128c
movq %rax, %r14
jmp 0x21296
movq 0x8(%rsp), %rdi
movq %rax, %r14
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x21296
callq 0x52e0
movq 0x28(%rsp), %rax
movq (%rax), %rdi
cmpq 0xb8(%rsp), %rdi
je 0x212ad
callq 0x52e0
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x212c7
callq 0x52e0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x212db
callq 0x52e0
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x212f5
callq 0x52e0
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x2130f
callq 0x52e0
movq %r14, %rdi
callq 0x5670
nop