// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/board.cpp
// Function: Morat::Hex::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 = " ";
	for(int i = 0; i < size_; i++)
		s += " " + coord + char('A' + i);
	s += "\n";

	for(int y = 0; y < size_; y++){
		s += string(y + ((y + 1) < 10), ' ');
		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 + "]" : " ");
		s += black + reset;
		s += '\n';
	}
	s += string(size_ + 2, ' ');
	for(int i = 0; i < size_; i++)
		s += white + " ";
	s += "\n";

	s += reset;
	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, (%rsp)
leaq 0xe30e(%rip), %rsi      # 0x2614f
leaq 0xf8(%rsp), %rdi
leaq 0xd8(%rsp), %rdx
movq %rcx, 0xa8(%rsp)
callq 0x5110
leaq 0xd69d(%rip), %rsi      # 0x25502
leaq 0xd8(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x5110
leaq 0xaa5f(%rip), %rsi      # 0x228dd
leaq 0x60(%rsp), %rdi
leaq 0xb8(%rsp), %rdx
callq 0x5110
leaq 0xaa46(%rip), %rsi      # 0x228dd
leaq 0xb8(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x5110
testb %bpl, %bpl
je 0x17fed
leaq 0xd64b(%rip), %rsi      # 0x25504
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x5110
leaq 0xd637(%rip), %rdx      # 0x25506
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x10e4d
leaq 0x30(%rsp), %r15
leaq 0xb8(%rsp), %rdi
movq %r15, %rsi
callq 0x5440
movq %r15, %rdi
callq 0x5150
leaq 0xd608(%rip), %rdx      # 0x2550a
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x10e4d
leaq 0x30(%rsp), %r15
leaq 0x60(%rsp), %rdi
movq %r15, %rsi
callq 0x5440
movq %r15, %rdi
callq 0x5150
leaq 0xd5df(%rip), %rdx      # 0x25511
leaq 0x80(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x10e4d
leaq 0xd5b7(%rip), %rdx      # 0x25502
leaq 0x30(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x8051
leaq 0x30(%rsp), %r15
leaq 0xf8(%rsp), %rdi
movq %r15, %rsi
callq 0x5440
movq %r15, %rdi
callq 0x5150
leaq 0x80(%rsp), %rdi
callq 0x5150
leaq 0xd58a(%rip), %rdx      # 0x25518
leaq 0x80(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x10e4d
leaq 0xd55b(%rip), %rdx      # 0x25502
leaq 0x30(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x8051
leaq 0x30(%rsp), %r15
leaq 0xd8(%rsp), %rdi
movq %r15, %rsi
callq 0x5440
movq %r15, %rdi
callq 0x5150
leaq 0x80(%rsp), %rdi
callq 0x5150
leaq 0x10(%rsp), %rdi
callq 0x5150
movq (%rsp), %rdi
leaq 0xe94b(%rip), %rsi      # 0x26943
leaq 0x10(%rsp), %rdx
callq 0x5110
leaq 0xe93a(%rip), %r15      # 0x26943
leaq 0x30(%rsp), %r12
leaq 0x60(%rsp), %r13
leaq 0x10(%rsp), %rbp
xorl %ebx, %ebx
movsbl (%r14), %eax
cmpl %eax, %ebx
jge 0x18061
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x8070
leal 0x41(%rbx), %eax
movsbl %al, %edx
movq %rbp, %rdi
movq %r12, %rsi
callq 0xa3e7
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0x5700
movq %rbp, %rdi
callq 0x5150
movq %r12, %rdi
callq 0x5150
incl %ebx
jmp 0x1801a
movq (%rsp), %rdi
leaq 0xa870(%rip), %rsi      # 0x228dc
callq 0x56b0
leaq 0x10(%rsp), %rbp
leaq 0x30(%rsp), %rbx
xorl %r12d, %r12d
movsbl (%r14), %eax
cmpl %eax, %r12d
jge 0x1831b
leaq 0x20(%rsp), %rax
cmpl $0x9, %r12d
movl %r12d, %esi
adcl $0x0, %esi
movq %rax, 0x10(%rsp)
movq %rbp, %rdi
pushq $0x20
popq %rdx
callq 0x53b0
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0x5700
movq %rbp, %rdi
leal 0x1(%r12), %r15d
callq 0x5150
movq %rbx, %rdi
movl %r15d, %esi
movl %r15d, 0x54(%rsp)
callq 0xd1be
leaq 0x60(%rsp), %rsi
movq %rbp, %rdi
movq %rbx, %rdx
callq 0x18666
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0x5700
movq %rbp, %rdi
callq 0x5150
movq %rbx, %rdi
callq 0x5150
movl (%r14), %eax
movl $0x0, %ecx
movl %r12d, %r15d
movq %r12, 0x58(%rsp)
testb %al, %al
movq %rax, 0xa0(%rsp)
cmovlel %ecx, %eax
movslq %r12d, %rcx
xorl %r12d, %r12d
movzbl %al, %r13d
movq %rcx, 0xb0(%rsp)
cmpl %r12d, %r13d
je 0x18273
movb 0x6(%r14), %al
movb 0x7(%r14), %cl
movl %r12d, %edx
xorb 0x58(%rsp), %al
xorb %cl, %dl
orb %al, %dl
jne 0x18162
leaq 0x60(%rsp), %rsi
leaq 0xebcb(%rip), %rdx      # 0x26d23
movq %rbp, %rdi
callq 0x10e4d
jmp 0x18181
leal -0x1(%r12), %edx
xorb %cl, %dl
orb %dl, %al
jne 0x18185
leaq 0x60(%rsp), %rsi
leaq 0xce1e(%rip), %rdx      # 0x24f97
movq %rbp, %rdi
callq 0x10e4d
xorl %ebx, %ebx
jmp 0x1819e
movb $0x1, %bl
leaq 0xe7b5(%rip), %rsi      # 0x26943
leaq 0x80(%rsp), %rdx
movq %rbp, %rdi
callq 0x5110
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0x5700
movq %rbp, %rdi
callq 0x5150
movsbq (%r14), %rax
testb %bl, %bl
movq 0x10(%r14), %rcx
leaq 0xece6(%rip), %rdx      # 0x26ea9
leaq 0x30(%rsp), %rbx
imulq 0xb0(%rsp), %rax
addq %r12, %rax
shlq $0x4, %rax
movb (%rcx,%rax), %al
cmpb (%rdx), %al
jne 0x18223
movq 0xa8(%rsp), %rsi
movq %rbx, %rdi
movl %r15d, %edx
callq 0x1868a
leaq 0xb8(%rsp), %rsi
movq %rbp, %rdi
movq %rbx, %rdx
callq 0x18666
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0x5700
movq %rbp, %rdi
callq 0x5150
movq %rbx, %rdi
callq 0x5150
jmp 0x18264
leaq 0xec80(%rip), %rcx      # 0x26eaa
leaq 0xf8(%rsp), %rsi
cmpb (%rcx), %al
je 0x18249
leaq 0xec6e(%rip), %rcx      # 0x26eab
leaq 0xd8(%rsp), %rsi
cmpb (%rcx), %al
jne 0x18254
movq (%rsp), %rdi
callq 0x5700
jmp 0x18264
movq (%rsp), %rdi
leaq 0xd2c0(%rip), %rsi      # 0x2551f
callq 0x56b0
incq %r12
addl $0x100, %r15d           # imm = 0x100
jmp 0x1812e
movq 0xa0(%rsp), %rax
movb 0x6(%r14), %cl
xorb 0x58(%rsp), %cl
decl %eax
xorb 0x7(%r14), %al
orb %cl, %al
setne %bl
je 0x182a6
leaq 0xe6ac(%rip), %rsi      # 0x26943
leaq 0xf(%rsp), %rdx
movq %rbp, %rdi
callq 0x5110
jmp 0x182ba
leaq 0x60(%rsp), %rsi
leaq 0xcce5(%rip), %rdx      # 0x24f97
movq %rbp, %rdi
callq 0x10e4d
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0x5700
movq %rbp, %rdi
callq 0x5150
testb %bl, %bl
leaq 0xd8(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
movq %rbp, %rdi
callq 0x186b4
movq (%rsp), %rbx
movq %rbp, %rsi
movq %rbx, %rdi
callq 0x5700
movq %rbp, %rdi
callq 0x5150
movq %rbx, %rdi
pushq $0xa
popq %rsi
callq 0x5290
movl 0x54(%rsp), %eax
leaq 0x30(%rsp), %rbx
movl %eax, %r12d
jmp 0x1807e
movslq %eax, %rsi
leaq 0x20(%rsp), %rax
leaq 0x10(%rsp), %rdi
addq $0x2, %rsi
movq %rax, (%rdi)
pushq $0x20
popq %rdx
callq 0x53b0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x5700
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x5150
leaq 0xe5ea(%rip), %r12      # 0x26943
leaq 0xf8(%rsp), %r13
xorl %ebx, %ebx
movsbl (%r14), %eax
cmpl %eax, %ebx
jge 0x18391
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x10e4d
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x5700
movq %r15, %rdi
callq 0x5150
incl %ebx
jmp 0x18363
movq (%rsp), %rbx
leaq 0xa540(%rip), %rsi      # 0x228dc
movq %rbx, %rdi
callq 0x56b0
leaq 0xb8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5700
leaq 0xb8(%rsp), %rdi
callq 0x5150
leaq 0x60(%rsp), %rdi
callq 0x5150
leaq 0xd8(%rsp), %rdi
callq 0x5150
leaq 0xf8(%rsp), %rdi
callq 0x5150
movq %rbx, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x183fe
jmp 0x18414
leaq 0x80(%rsp), %rdi
movq %rax, %r14
callq 0x5150
jmp 0x18417
jmp 0x18414
jmp 0x18414
movq %rax, %r14
leaq 0x10(%rsp), %rdi
jmp 0x184be
jmp 0x18427
jmp 0x1846a
jmp 0x1848d
movq %rax, %r14
jmp 0x184c3
movq %rax, %r14
jmp 0x184d0
movq %rax, %r14
jmp 0x184da
movq %rax, %r14
jmp 0x184e7
jmp 0x1848d
jmp 0x1848d
jmp 0x1848d
jmp 0x1848d
jmp 0x1846a
leaq 0x10(%rsp), %rdi
movq %rax, %r14
callq 0x5150
testb %bl, %bl
jmp 0x184ba
jmp 0x1848d
jmp 0x1846a
jmp 0x1848d
jmp 0x18486
leaq 0x10(%rsp), %rdi
movq %rax, %r14
jmp 0x184a4
jmp 0x1848d
jmp 0x18492
jmp 0x1848d
jmp 0x18492
jmp 0x18486
jmp 0x1848d
jmp 0x1848d
jmp 0x1848d
jmp 0x1848d
movq %rax, %r14
jmp 0x1849f
jmp 0x1848d
movq %rax, %r14
jmp 0x184ba
leaq 0x10(%rsp), %rdi
movq %rax, %r14
callq 0x5150
leaq 0x30(%rsp), %rdi
callq 0x5150
jmp 0x184ba
leaq 0x10(%rsp), %rdi
movq %rax, %r14
callq 0x5150
testb %bl, %bl
movq (%rsp), %rdi
callq 0x5150
leaq 0xb8(%rsp), %rdi
callq 0x5150
leaq 0x60(%rsp), %rdi
callq 0x5150
leaq 0xd8(%rsp), %rdi
callq 0x5150
leaq 0xf8(%rsp), %rdi
callq 0x5150
movq %r14, %rdi
callq 0x5650