// File: /workspace/github_cpp_makefile_star2_O2/juancalaca[P]dotsboxes/DotsBoard.cc
// Function: DotsBoard::PrintSelectEdge(int, int, int)
void DotsBoard::PrintSelectEdge(int selected_row, int selected_column, int edge)
{
	//print out a line to separate the board from previous prints
	cout << endl << endl;
	cout << "==================================================================" << endl;
	cout << endl << endl;

	//determine which selection indicator to use
	string symbol;
	switch (edge)
	{
		case 1:
			symbol = "<<";
			break;
		case 2:
			symbol = "/\\";
			break;
		case 3:
			symbol = ">>";
			break;
		case 4:
			symbol = "\\/";
			break;
		default:
			symbol = "##";
			break;
	}
	
	//create the string-representation of the board and print it
	for (int r = 0; r < this->rows; r++)
	{
		string top_string = "*";
		string other_lines = "";
		string names_line = "";
		
		for (int c = 0; c < this->columns; c++)
		{
			if (this->boxes[r][c]->GetTop()->IsClaimed())
			{
				top_string.append("------*");
			}
			else 
			{
				top_string.append("      *");
			}
			
			if (this->boxes[r][c]->GetLeft()->IsClaimed())
			{
				other_lines.append("|");
				names_line.append("|");
			}
			else
			{
				other_lines.append(" ");
				names_line.append(" ");
			}
			
			names_line.append("  ");
			//this will always be two chars!
			names_line.append(boxes[r][c]->GetName());
			
			names_line.append("  ");			

			if (c == selected_column && r == selected_row)
			{
				other_lines.append("  ");
				other_lines.append(symbol);
				other_lines.append("  ");
			}
			else 
			{
				other_lines.append("      ");
			}		
			
			if ( c == (columns - 1))
			{
				if (this->boxes[r][c]->GetRight()->IsClaimed())
				{
					other_lines.append("|");
					names_line.append("|");
				}
				else
				{
					other_lines.append(" ");
					names_line.append(" ");
				}
			}
		}
		
		cout << top_string << endl;
		cout << other_lines << endl;
		cout << names_line << endl;
		cout << other_lines << endl;
	}
	
	string bottom_string = "*";
	
	for (int c = 0; c < this->columns; c++)
	{
		if (this->boxes[rows-1][c]->GetBottom()->IsClaimed())
		{
			bottom_string.append("------*");
		}
		else 
		{
			bottom_string.append("      *");
		}
	}
	
	cout << bottom_string << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %ecx, %r15d
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
movq 0x467f(%rip), %r12      # 0x6fd0
movq %r12, %rdi
callq 0x2080
movq %rax, %rdi
callq 0x2080
leaq 0x16d8(%rip), %rsi      # 0x4040
movq %r12, %rdi
callq 0x2120
movq %rax, %rdi
callq 0x2080
movq %r12, %rdi
callq 0x2080
movq %rax, %rdi
callq 0x2080
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
decl %r15d
cmpl $0x4, %r15d
jae 0x29b5
movl %r15d, %eax
leaq 0x1744(%rip), %rcx      # 0x40f0
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x29bc
leaq 0x16d3(%rip), %rsi      # 0x408f
leaq 0x48(%rsp), %rdi
callq 0x2200
movl %r14d, %eax
movq %rax, 0x38(%rsp)
movl %ebp, %eax
movq %rax, 0x28(%rsp)
xorl %r15d, %r15d
leaq 0x88(%rsp), %r12
leaq 0x18d2(%rip), %r14      # 0x42b9
leaq 0xa8(%rsp), %rbp
leaq 0x68(%rsp), %r13
movslq (%rbx), %rax
cmpq %rax, %r15
jge 0x2c44
leaq 0x8(%rsp), %rdi
leaq 0x1694(%rip), %rsi      # 0x40a0
movq %r12, %rdx
callq 0x2dd2
movq %r12, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x2dd2
movq %rbp, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x2dd2
imulq $0x18, %r15, %r13
movq %r15, 0x30(%rsp)
xorq 0x28(%rsp), %r15
movq %r15, 0x40(%rsp)
xorl %r14d, %r14d
movslq 0x4(%rbx), %rax
cmpq %rax, %r14
jge 0x2bc1
movq 0x10(%rbx), %rax
movq (%rax,%r13), %rax
movq (%rax,%r14,8), %rdi
callq 0x2562
movq %rax, %rdi
callq 0x23e4
leaq 0x161f(%rip), %rsi      # 0x4092
testb %al, %al
jne 0x2a7e
leaq 0x161c(%rip), %rsi      # 0x409a
leaq 0x8(%rsp), %rdi
callq 0x21f0
movq 0x10(%rbx), %rax
movq (%rax,%r13), %rax
movq (%rax,%r14,8), %rdi
callq 0x255e
movq %rax, %rdi
callq 0x23e4
testb %al, %al
je 0x2ab9
movq %r12, %rdi
leaq 0x15f3(%rip), %r15      # 0x40a2
movq %r15, %rsi
callq 0x21f0
jmp 0x2acb
movq %r12, %rdi
leaq 0x15e6(%rip), %r15      # 0x40a9
movq %r15, %rsi
callq 0x21f0
movq %rbp, %rdi
movq %r15, %rsi
callq 0x21f0
movq %rbp, %rdi
leaq 0x15c8(%rip), %rsi      # 0x40a8
callq 0x21f0
movq 0x10(%rbx), %rax
movq (%rax,%r13), %rax
movq (%rax,%r14,8), %rsi
leaq 0x68(%rsp), %r15
movq %r15, %rdi
callq 0x25b0
movq %rbp, %rdi
movq %r15, %rsi
callq 0x2210
movq %r15, %rdi
callq 0x2070
movq %rbp, %rdi
leaq 0x158d(%rip), %rsi      # 0x40a8
callq 0x21f0
movq 0x38(%rsp), %rax
xorq %r14, %rax
orq 0x40(%rsp), %rax
leaq 0x1570(%rip), %rsi      # 0x40a4
jne 0x2b59
movq %r12, %rdi
leaq 0x1568(%rip), %rsi      # 0x40a8
callq 0x21f0
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
callq 0x2210
leaq 0x154f(%rip), %rsi      # 0x40a8
movq %r12, %rdi
callq 0x21f0
movl 0x4(%rbx), %eax
decl %eax
cmpq %rax, %r14
jne 0x2bb9
movq 0x10(%rbx), %rax
movq (%rax,%r13), %rax
movq (%rax,%r14,8), %rdi
callq 0x2568
movq %rax, %rdi
callq 0x23e4
testb %al, %al
je 0x2b9c
movq %r12, %rdi
leaq 0x1510(%rip), %r15      # 0x40a2
movq %r15, %rsi
callq 0x21f0
jmp 0x2bae
movq %r12, %rdi
leaq 0x1503(%rip), %r15      # 0x40a9
movq %r15, %rsi
callq 0x21f0
movq %rbp, %rdi
movq %r15, %rsi
callq 0x21f0
incq %r14
jmp 0x2a46
movq 0x4408(%rip), %r14      # 0x6fd0
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x2110
movq %rax, %rdi
callq 0x2080
movq %r14, %rdi
movq %r12, %rsi
callq 0x2110
movq %rax, %rdi
callq 0x2080
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2110
movq %rax, %rdi
callq 0x2080
movq %r14, %rdi
movq %r12, %rsi
callq 0x2110
movq %rax, %rdi
callq 0x2080
movq %rbp, %rdi
callq 0x2070
movq %r12, %rdi
callq 0x2070
leaq 0x8(%rsp), %rdi
callq 0x2070
movq 0x30(%rsp), %r15
incq %r15
leaq 0x167a(%rip), %r14      # 0x42b9
jmp 0x29ef
leaq 0x1455(%rip), %rsi      # 0x40a0
leaq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x2dd2
xorl %r15d, %r15d
leaq 0x142b(%rip), %r12      # 0x4092
leaq 0x142c(%rip), %r13      # 0x409a
leaq 0x8(%rsp), %r14
movslq 0x4(%rbx), %rax
cmpq %rax, %r15
jge 0x2cb4
movslq (%rbx), %rax
movq 0x10(%rbx), %rcx
imulq $0x18, %rax, %rax
movq -0x18(%rcx,%rax), %rax
movq (%rax,%r15,8), %rdi
callq 0x256e
movq %rax, %rdi
callq 0x23e4
movq %r12, %rsi
testb %al, %al
jne 0x2ca7
movq %r13, %rsi
movq %r14, %rdi
callq 0x21f0
incq %r15
jmp 0x2c73
movq 0x4315(%rip), %rdi      # 0x6fd0
leaq 0x8(%rsp), %rsi
callq 0x2110
movq %rax, %rdi
callq 0x2080
leaq 0x8(%rsp), %rdi
callq 0x2070
leaq 0x48(%rsp), %rdi
callq 0x2070
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2d00
jmp 0x2d00
jmp 0x2d05
jmp 0x2d05
movq %rax, %rbx
jmp 0x2d2d
movq %rax, %rbx
jmp 0x2d44
movq %rax, %rbx
jmp 0x2d3a
jmp 0x2d1d
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x2070
jmp 0x2d20
jmp 0x2d1d
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x2070
leaq 0x88(%rsp), %rdi
callq 0x2070
leaq 0x8(%rsp), %rdi
callq 0x2070
leaq 0x48(%rsp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x21c0