// File: /workspace/github_cpp_makefile_star2_O1/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 0x5459(%rip), %r12      # 0x7fd0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
leaq 0x2490(%rip), %rsi      # 0x5060
movl $0x42, %edx
movq %r12, %rdi
callq 0x2150
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
decl %r15d
cmpl $0x4, %r15d
jae 0x2c8a
movl %r15d, %eax
leaq 0x2467(%rip), %rdx      # 0x50e8
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
jmp 0x2c91
leaq 0x241e(%rip), %rcx      # 0x50af
leaq 0x70(%rsp), %rdi
movl $0x2, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x21a0
cmpl $0x0, (%rbx)
leaq 0x18(%rsp), %r15
jle 0x307b
leaq 0x38(%rsp), %r12
movl %r14d, %eax
movq %rax, 0xb8(%rsp)
movl %ebp, %eax
movq %rax, 0xb0(%rsp)
movq $0x0, 0x48(%rsp)
leaq 0x25d4(%rip), %r13      # 0x52b1
leaq 0x28(%rsp), %rbp
leaq 0x50(%rsp), %r14
movq %r15, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
leaq 0x23c8(%rip), %rsi      # 0x50c0
leaq 0x23c2(%rip), %rdx      # 0x50c1
callq 0x37cc
movq %r12, 0x28(%rsp)
movq %rbp, %rdi
movq %r13, %rsi
movq %r13, %rdx
callq 0x37cc
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movq %r13, %rdx
callq 0x37cc
cmpl $0x0, 0x4(%rbx)
jle 0x2f10
movq 0x48(%rsp), %r12
leaq (%r12,%r12,2), %r15
xorq 0xb0(%rsp), %r12
movq %r12, 0xc0(%rsp)
xorl %r13d, %r13d
movq 0x10(%rbx), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r13,8), %rdi
callq 0x26f4
movq %rax, %rdi
callq 0x2404
leaq 0x233d(%rip), %rsi      # 0x50b2
testb %al, %al
jne 0x2d80
leaq 0x233a(%rip), %rsi      # 0x50ba
leaq 0x8(%rsp), %rdi
callq 0x2200
movq 0x10(%rbx), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r13,8), %rdi
callq 0x26f0
movq %rax, %rdi
callq 0x2404
testb %al, %al
je 0x2dc3
movq %rbp, %rdi
leaq 0x2311(%rip), %rbp      # 0x50c2
movq %rbp, %rsi
callq 0x2200
movq %rbp, %rsi
leaq 0x28(%rsp), %rbp
jmp 0x2dd8
movq %rbp, %rdi
leaq 0x22fc(%rip), %r12      # 0x50c9
movq %r12, %rsi
callq 0x2200
movq %r12, %rsi
movq %r14, %rdi
callq 0x2200
movq %r14, %rdi
leaq 0x22de(%rip), %rsi      # 0x50c8
callq 0x2200
movq 0x10(%rbx), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r13,8), %rsi
leaq 0x90(%rsp), %rdi
callq 0x2742
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq %r14, %rdi
callq 0x2050
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x2e45
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2140
movq %r14, %rdi
leaq 0x2279(%rip), %rsi      # 0x50c8
callq 0x2200
movq 0xb8(%rsp), %rax
xorq %r13, %rax
orq 0xc0(%rsp), %rax
leaq 0x2256(%rip), %rsi      # 0x50c4
jne 0x2e98
movq %rbp, %rdi
leaq 0x224e(%rip), %rsi      # 0x50c8
callq 0x2200
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq %rbp, %rdi
callq 0x2050
leaq 0x2230(%rip), %rsi      # 0x50c8
movq %rbp, %rdi
callq 0x2200
movl 0x4(%rbx), %eax
decl %eax
cmpq %rax, %r13
jne 0x2f00
movq 0x10(%rbx), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r13,8), %rdi
callq 0x26fa
movq %rax, %rdi
callq 0x2404
testb %al, %al
je 0x2ee3
movq %rbp, %rdi
leaq 0x21f1(%rip), %rbp      # 0x50c2
movq %rbp, %rsi
callq 0x2200
movq %rbp, %rsi
leaq 0x28(%rsp), %rbp
jmp 0x2ef8
movq %rbp, %rdi
leaq 0x21dc(%rip), %r12      # 0x50c9
movq %r12, %rsi
callq 0x2200
movq %r12, %rsi
movq %r14, %rdi
callq 0x2200
incq %r13
movslq 0x4(%rbx), %rax
cmpq %rax, %r13
jl 0x2d55
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x50af(%rip), %r12      # 0x7fd0
movq %r12, %rdi
callq 0x2150
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %r12, %rdi
callq 0x2150
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %r12, %rdi
callq 0x2150
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %r12, %rdi
callq 0x2150
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
leaq 0x18(%rsp), %r15
leaq 0x38(%rsp), %r12
je 0x302d
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
leaq 0x2275(%rip), %r13      # 0x52b1
je 0x304b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3062
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x48(%rsp), %rdx
incq %rdx
movslq (%rbx), %rax
movq %rdx, 0x48(%rsp)
cmpq %rax, %rdx
jl 0x2ce7
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x2036(%rip), %rsi      # 0x50c0
leaq 0x2030(%rip), %rdx      # 0x50c1
callq 0x37cc
cmpl $0x0, 0x4(%rbx)
jle 0x30f1
xorl %r15d, %r15d
leaq 0x200c(%rip), %r12      # 0x50b2
leaq 0x200d(%rip), %r13      # 0x50ba
leaq 0x8(%rsp), %r14
movslq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq (%rax,%rax,2), %rax
movq -0x18(%rcx,%rax,8), %rax
movq (%rax,%r15,8), %rdi
callq 0x2700
movq %rax, %rdi
callq 0x2404
movq %r12, %rsi
testb %al, %al
jne 0x30dd
movq %r13, %rsi
movq %r14, %rdi
callq 0x2200
incq %r15
movslq 0x4(%rbx), %rax
cmpq %rax, %r15
jl 0x30b2
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x4ece(%rip), %rdi      # 0x7fd0
callq 0x2150
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x314d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x316f
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2140
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3187
jmp 0x3187
jmp 0x31a6
movq %rax, %rbx
jmp 0x3250
movq %rax, %rbx
jmp 0x3239
movq %rax, %rbx
leaq 0x18(%rsp), %r15
leaq 0x38(%rsp), %r14
jmp 0x3222
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
jne 0x3243
jmp 0x3250
jmp 0x31f9
movq %rax, %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
leaq 0x18(%rsp), %r15
leaq 0x38(%rsp), %r14
je 0x3206
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2140
jmp 0x3206
jmp 0x31f9
movq %rax, %rbx
leaq 0x18(%rsp), %r15
leaq 0x38(%rsp), %r14
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x3222
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x3239
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3250
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x3272
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21d0