// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rcx, 0xc0(%rsp)
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, 0x28(%rsp)
leaq 0xf8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x17f65(%rip), %rsi     # 0x38a31
leaq 0x17f5f(%rip), %rdx     # 0x38a32
leaq 0xe8(%rsp), %rdi
callq 0xb23a
leaq 0xd8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x166ea(%rip), %rsi     # 0x371dd
leaq 0x166e4(%rip), %rdx     # 0x371de
leaq 0xc8(%rsp), %rdi
callq 0xb23a
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x12dfa(%rip), %rdx     # 0x33911
leaq 0x50(%rsp), %rdi
movq %rdx, %rsi
callq 0xb23a
leaq 0xa8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x12dda(%rip), %rdx     # 0x33911
leaq 0x98(%rsp), %rdi
movq %rdx, %rsi
callq 0xb23a
leaq 0x18(%rsp), %r12
testb %bpl, %bpl
je 0x20d8d
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1667b(%rip), %rsi     # 0x371df
leaq 0x16675(%rip), %rdx     # 0x371e0
callq 0xb23a
leaq 0x40(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0xa916
leaq 0x1664a(%rip), %rsi     # 0x371e1
leaq 0x30(%rsp), %rdi
callq 0x56e0
leaq 0x98(%rsp), %rdi
leaq 0x30(%rsp), %r13
movq %r13, %rsi
callq 0x5430
movq (%r13), %rdi
cmpq %rbx, %rdi
je 0x20bc4
callq 0x52e0
leaq 0x30(%rsp), %rdi
movq %rbx, (%rdi)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
callq 0xa916
leaq 0x16600(%rip), %rsi     # 0x371e5
leaq 0x30(%rsp), %rdi
callq 0x56e0
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %r13
movq %r13, %rsi
callq 0x5430
movq (%r13), %rdi
cmpq %rbx, %rdi
je 0x20c0f
callq 0x52e0
leaq 0x88(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0xa916
leaq 0x165b2(%rip), %rsi     # 0x371ec
leaq 0x78(%rsp), %rdi
callq 0x56e0
leaq 0x16592(%rip), %rsi     # 0x371dd
leaq 0x78(%rsp), %rdi
callq 0x56e0
movq %rbx, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x20c78
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x20c80
vmovups (%rcx), %xmm0
vmovups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq 0x30(%rsp), %r13
movq %rdx, 0x8(%r13)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xe8(%rsp), %rdi
movq %r13, %rsi
callq 0x5430
movq (%r13), %rdi
cmpq %rbx, %rdi
je 0x20cba
callq 0x52e0
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0x20cc9
callq 0x52e0
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
callq 0xa916
leaq 0x16509(%rip), %rsi     # 0x371f3
leaq 0x78(%rsp), %rdi
callq 0x56e0
leaq 0x164e2(%rip), %rsi     # 0x371dd
leaq 0x78(%rsp), %rdi
callq 0x56e0
movq %rbx, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x20d28
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x20d30
vmovups (%rcx), %xmm0
vmovups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq 0x30(%rsp), %r13
movq %rdx, 0x8(%r13)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xc8(%rsp), %rdi
movq %r13, %rsi
callq 0x5430
movq (%r13), %rdi
cmpq %rbx, %rdi
je 0x20d6a
callq 0x52e0
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0x20d79
callq 0x52e0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %r12
cmpq %r12, %rdi
je 0x20d8d
callq 0x52e0
movq 0x28(%rsp), %rbx
leaq 0x10(%rbx), %rax
movq %rax, 0xb8(%rsp)
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movsbq 0x1(%r15), %rsi
addq $0x3, %rsi
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
movl $0x20, %edx
callq 0x53b0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x50c0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x20de9
callq 0x52e0
cmpb $0x0, 0x1(%r15)
jle 0x20ebb
xorl %ebx, %ebx
leaq 0x16c15(%rip), %r14     # 0x37a12
leaq 0x30(%rsp), %r13
leaq 0x50(%rsp), %rbp
movq %r13, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x9863
leal 0x41(%rbx), %eax
movq 0x38(%rsp), %rsi
movsbl %al, %r8d
movl $0x1, %ecx
movq %r13, %rdi
xorl %edx, %edx
callq 0x56c0
movq %r12, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x20e53
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x20e5d
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 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x28(%rsp), %rdi
callq 0x50c0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x20e98
callq 0x52e0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x20eac
callq 0x52e0
incl %ebx
movsbl 0x1(%r15), %eax
cmpl %eax, %ebx
jl 0x20e07
leaq 0x12a4e(%rip), %rsi     # 0x33910
movq 0x28(%rsp), %rdi
callq 0x56e0
leaq 0x8(%rsp), %r13
leaq 0x30(%rsp), %r14
xorl %r12d, %r12d
movsbl (%r15), %eax
cmpl %eax, %r12d
jge 0x21368
movsbl 0x2(%r15), %eax
subl %r12d, %eax
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
cmpl $0x9, %r12d
adcl $0x1, %esi
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r13, %rdi
movl $0x20, %edx
callq 0x53b0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x28(%rsp), %rdi
callq 0x50c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x20f3b
callq 0x52e0
leal 0x1(%r12), %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x11493
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r8
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
leaq 0x18(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x20f88
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x20f90
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 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x28(%rsp), %rdi
callq 0x50c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x20fd0
callq 0x52e0
movl %ebx, 0x74(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x20fe8
callq 0x52e0
movsbl 0x1(%r15), %eax
leal (%r12,%rax), %ecx
movsbl 0x2(%r15), %edx
movl %r12d, %r13d
subl %edx, %r13d
cmpl %eax, %r12d
movsbl (%r15), %r14d
cmovll %ecx, %r14d
movl $0x0, %eax
cmovll %eax, %r13d
cmpl %r14d, %r13d
jge 0x2123e
movl %r13d, %ebx
shll $0x8, %ebx
addl %r12d, %ebx
movb 0x8(%r15), %cl
movb 0x9(%r15), %al
cmpb %r12b, %cl
jne 0x21069
cmpb %al, %r13b
jne 0x21069
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
callq 0xa916
movq %rbp, %rdi
leaq 0x17f1a(%rip), %rsi     # 0x38f7c
callq 0x56e0
jmp 0x210cd
cmpb %r12b, %cl
jne 0x210ab
leal -0x1(%r13), %ecx
cmpb %al, %cl
jne 0x210ab
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
callq 0xa916
movq %rbp, %rdi
leaq 0x15917(%rip), %rsi     # 0x369bb
callq 0x56e0
jmp 0x210cd
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
leaq 0x16951(%rip), %rsi     # 0x37a12
leaq 0x1694b(%rip), %rdx     # 0x37a13
callq 0xb23a
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x28(%rsp), %rdi
callq 0x50c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x210f5
callq 0x52e0
movsbl (%r15), %eax
imull %r12d, %eax
addl %r13d, %eax
cltq
movq 0x10(%r15), %rcx
shlq $0x4, %rax
movb (%rcx,%rax), %al
leaq 0x17fed(%rip), %rcx     # 0x39101
cmpb (%rcx), %al
jne 0x21184
movw %bx, 0x78(%rsp)
movq 0xc0(%rsp), %rsi
cmpq $0x0, 0x10(%rsi)
je 0x213fb
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
leaq 0x78(%rsp), %rdx
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 %rsi, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x211bd
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x211c5
leaq 0xe8(%rsp), %rcx
leaq 0x17f6f(%rip), %rdx     # 0x39102
cmpb (%rdx), %al
je 0x211aa
leaq 0xc8(%rsp), %rcx
leaq 0x17f5d(%rip), %rdx     # 0x39103
cmpb (%rdx), %al
jne 0x2121b
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
movq 0x28(%rsp), %rdi
callq 0x50c0
jmp 0x2122c
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 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x28(%rsp), %rdi
callq 0x50c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x21205
callq 0x52e0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x2122c
callq 0x52e0
jmp 0x2122c
movq 0x28(%rsp), %rdi
leaq 0x15fd3(%rip), %rsi     # 0x371fa
callq 0x56e0
incl %r13d
addl $0x100, %ebx            # imm = 0x100
cmpl %r13d, %r14d
jne 0x21022
cmpb %r12b, 0x8(%r15)
jne 0x21287
decb %r14b
cmpb %r14b, 0x9(%r15)
jne 0x21287
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0xa916
movq %r13, %rdi
leaq 0x15740(%rip), %rsi     # 0x369bb
callq 0x56e0
leaq 0x30(%rsp), %r14
jmp 0x212b1
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %r13
movq %r13, %rdi
leaq 0x16772(%rip), %rsi     # 0x37a12
leaq 0x1676c(%rip), %rdx     # 0x37a13
callq 0xb23a
leaq 0x30(%rsp), %r14
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x28(%rsp), %rdi
callq 0x50c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x212d9
callq 0x52e0
movsbl 0x2(%r15), %eax
cmpl %eax, %r12d
jge 0x2134d
movb 0x1(%r15), %bl
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xa916
addb %bl, %r12b
addb $0x41, %r12b
movq 0x10(%rsp), %rsi
movsbl %r12b, %r8d
movl $0x1, %ecx
movq %r13, %rdi
xorl %edx, %edx
callq 0x56c0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rbx
callq 0x50c0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2134d
callq 0x52e0
movq 0x28(%rsp), %rdi
movl $0xa, %esi
callq 0x5290
movl 0x74(%rsp), %eax
movl %eax, %r12d
jmp 0x20ed9
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq 0x28(%rsp), %rdi
callq 0x50c0
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2139c
callq 0x52e0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x213b0
callq 0x52e0
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x213ca
callq 0x52e0
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x213e4
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 0x21408
jmp 0x21408
jmp 0x21431
jmp 0x21408
movq %rax, %r14
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
jne 0x2142a
jmp 0x21434
jmp 0x21431
jmp 0x2141d
jmp 0x21431
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0x21434
callq 0x52e0
jmp 0x21434
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
jne 0x21527
jmp 0x2152c
movq %rax, %r14
jmp 0x2152c
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
jne 0x21510
jmp 0x21515
jmp 0x214f9
movq %rax, %r14
jmp 0x21546
movq %rax, %r14
jmp 0x2155a
movq %rax, %r14
jmp 0x21574
jmp 0x214f9
jmp 0x214f9
jmp 0x214fe
jmp 0x214f9
jmp 0x214f9
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
jne 0x21510
jmp 0x21515
jmp 0x214fe
jmp 0x214f9
jmp 0x214ea
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
jne 0x214df
jmp 0x214ed
jmp 0x214fe
jmp 0x214f9
jmp 0x214f9
jmp 0x214fe
jmp 0x214cd
jmp 0x214ea
jmp 0x214f9
jmp 0x214f9
jmp 0x214fe
jmp 0x214f9
jmp 0x214f9
jmp 0x214fe
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x214ed
callq 0x52e0
jmp 0x214ed
jmp 0x214f9
jmp 0x214f9
movq %rax, %r14
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
jmp 0x2150b
movq %rax, %r14
jmp 0x21515
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x21515
callq 0x52e0
movq 0x28(%rsp), %rax
movq (%rax), %rdi
cmpq 0xb8(%rsp), %rdi
je 0x2152c
callq 0x52e0
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x21546
callq 0x52e0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x2155a
callq 0x52e0
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x21574
callq 0x52e0
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x2158e
callq 0x52e0
movq %r14, %rdi
callq 0x5670