// File: 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
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x128(%rbp)
movq 0x7fa6(%rip), %rdi      # 0xafd0
movq %rdi, -0x120(%rbp)
movq 0x7f88(%rip), %rsi      # 0xafc0
movq %rsi, -0x118(%rbp)
callq 0x2180
movq -0x118(%rbp), %rsi
movq %rax, %rdi
callq 0x2180
movq -0x120(%rbp), %rdi
leaq 0x3fd3(%rip), %rsi      # 0x7034
callq 0x2150
movq -0x118(%rbp), %rsi
movq %rax, %rdi
callq 0x2180
movq -0x120(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x2180
movq -0x118(%rbp), %rsi
movq %rax, %rdi
callq 0x2180
leaq -0x38(%rbp), %rdi
callq 0x2200
movl -0x14(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x110(%rbp)
subl $0x3, %eax
ja 0x312b
movq -0x110(%rbp), %rax
leaq 0x3f63(%rip), %rcx      # 0x7024
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x3fa6(%rip), %rsi      # 0x7077
leaq -0x38(%rbp), %rdi
callq 0x21f0
jmp 0x30dc
jmp 0x313f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3825
leaq 0x3f84(%rip), %rsi      # 0x707a
leaq -0x38(%rbp), %rdi
callq 0x21f0
jmp 0x3101
jmp 0x313f
leaq 0x3f73(%rip), %rsi      # 0x707d
leaq -0x38(%rbp), %rdi
callq 0x21f0
jmp 0x3115
jmp 0x313f
leaq 0x3f62(%rip), %rsi      # 0x7080
leaq -0x38(%rbp), %rdi
callq 0x21f0
jmp 0x3129
jmp 0x313f
leaq 0x3f51(%rip), %rsi      # 0x7083
leaq -0x38(%rbp), %rdi
callq 0x21f0
jmp 0x313d
jmp 0x313f
movl $0x0, -0x48(%rbp)
movq -0x128(%rbp), %rcx
movl -0x48(%rbp), %eax
cmpl (%rcx), %eax
jge 0x36a6
leaq -0x69(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x2270
movq -0x130(%rbp), %rdx
leaq 0x3f1e(%rip), %rsi      # 0x7094
leaq -0x68(%rbp), %rdi
callq 0x3bb0
jmp 0x3181
leaq -0x69(%rbp), %rdi
callq 0x21a0
leaq -0x91(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x2270
movq -0x138(%rbp), %rdx
leaq 0x40ea(%rip), %rsi      # 0x7295
leaq -0x90(%rbp), %rdi
callq 0x3bb0
jmp 0x31b9
leaq -0x91(%rbp), %rdi
callq 0x21a0
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x2270
movq -0x140(%rbp), %rdx
leaq 0x40af(%rip), %rsi      # 0x7295
leaq -0xb8(%rbp), %rdi
callq 0x3bb0
jmp 0x31f4
leaq -0xb9(%rbp), %rdi
callq 0x21a0
movl $0x0, -0xc0(%rbp)
movq -0x128(%rbp), %rcx
movl -0xc0(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x3590
movq -0x128(%rbp), %rdi
addq $0x10, %rdi
movslq -0x48(%rbp), %rsi
callq 0x38a0
movq %rax, %rdi
movslq -0xc0(%rbp), %rsi
callq 0x3880
movq (%rax), %rdi
callq 0x2880
movq %rax, -0x148(%rbp)
jmp 0x3254
movq -0x148(%rbp), %rdi
callq 0x2560
movb %al, -0x149(%rbp)
jmp 0x3268
movb -0x149(%rbp), %al
testb $0x1, %al
jne 0x3274
jmp 0x32ed
leaq 0x3e0b(%rip), %rsi      # 0x7086
leaq -0x68(%rbp), %rdi
callq 0x22a0
jmp 0x3286
jmp 0x3301
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x21a0
jmp 0x3825
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x21a0
jmp 0x3698
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb9(%rbp), %rdi
callq 0x21a0
jmp 0x368c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3680
leaq 0x3d9a(%rip), %rsi      # 0x708e
leaq -0x68(%rbp), %rdi
callq 0x22a0
jmp 0x32ff
jmp 0x3301
movq -0x128(%rbp), %rdi
addq $0x10, %rdi
movslq -0x48(%rbp), %rsi
callq 0x38a0
movq %rax, %rdi
movslq -0xc0(%rbp), %rsi
callq 0x3880
movq (%rax), %rdi
callq 0x2860
movq %rax, -0x158(%rbp)
jmp 0x3335
movq -0x158(%rbp), %rdi
callq 0x2560
movb %al, -0x159(%rbp)
jmp 0x3349
movb -0x159(%rbp), %al
testb $0x1, %al
jne 0x3355
jmp 0x3381
leaq 0x3d3a(%rip), %rsi      # 0x7096
leaq -0x90(%rbp), %rdi
callq 0x22a0
jmp 0x336a
leaq 0x3d25(%rip), %rsi      # 0x7096
leaq -0xb8(%rbp), %rdi
callq 0x22a0
jmp 0x337f
jmp 0x33ad
leaq 0x3d15(%rip), %rsi      # 0x709d
leaq -0x90(%rbp), %rdi
callq 0x22a0
jmp 0x3396
leaq 0x3d00(%rip), %rsi      # 0x709d
leaq -0xb8(%rbp), %rdi
callq 0x22a0
jmp 0x33ab
jmp 0x33ad
leaq 0x3ce8(%rip), %rsi      # 0x709c
leaq -0xb8(%rbp), %rdi
callq 0x22a0
jmp 0x33c2
movq -0x128(%rbp), %rdi
addq $0x10, %rdi
movslq -0x48(%rbp), %rsi
callq 0x38a0
movq %rax, %rdi
movslq -0xc0(%rbp), %rsi
callq 0x3880
movq (%rax), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x2990
jmp 0x33f6
leaq -0xb8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x22b0
jmp 0x340b
leaq -0xe0(%rbp), %rdi
callq 0x20c0
leaq 0x3c7e(%rip), %rsi      # 0x709c
leaq -0xb8(%rbp), %rdi
callq 0x22a0
jmp 0x342c
movl -0xc0(%rbp), %eax
cmpl -0x10(%rbp), %eax
jne 0x349a
movl -0x48(%rbp), %eax
cmpl -0xc(%rbp), %eax
jne 0x349a
leaq 0x3c56(%rip), %rsi      # 0x709c
leaq -0x90(%rbp), %rdi
callq 0x22a0
jmp 0x3454
leaq -0x90(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x22b0
jmp 0x3466
leaq 0x3c2f(%rip), %rsi      # 0x709c
leaq -0x90(%rbp), %rdi
callq 0x22a0
jmp 0x347b
jmp 0x34b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x20c0
jmp 0x3680
leaq 0x3bf7(%rip), %rsi      # 0x7098
leaq -0x90(%rbp), %rdi
callq 0x22a0
jmp 0x34af
jmp 0x34b1
movq -0x128(%rbp), %rcx
movl -0xc0(%rbp), %eax
movl 0x4(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x357a
movq -0x128(%rbp), %rdi
addq $0x10, %rdi
movslq -0x48(%rbp), %rsi
callq 0x38a0
movq %rax, %rdi
movslq -0xc0(%rbp), %rsi
callq 0x3880
movq (%rax), %rdi
callq 0x28a0
movq %rax, -0x168(%rbp)
jmp 0x3500
movq -0x168(%rbp), %rdi
callq 0x2560
movb %al, -0x169(%rbp)
jmp 0x3514
movb -0x169(%rbp), %al
testb $0x1, %al
jne 0x3520
jmp 0x354c
leaq 0x3b6f(%rip), %rsi      # 0x7096
leaq -0x90(%rbp), %rdi
callq 0x22a0
jmp 0x3535
leaq 0x3b5a(%rip), %rsi      # 0x7096
leaq -0xb8(%rbp), %rdi
callq 0x22a0
jmp 0x354a
jmp 0x3578
leaq 0x3b4a(%rip), %rsi      # 0x709d
leaq -0x90(%rbp), %rdi
callq 0x22a0
jmp 0x3561
leaq 0x3b35(%rip), %rsi      # 0x709d
leaq -0xb8(%rbp), %rdi
callq 0x22a0
jmp 0x3576
jmp 0x3578
jmp 0x357a
jmp 0x357c
movl -0xc0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc0(%rbp)
jmp 0x320a
movq 0x7a39(%rip), %rdi      # 0xafd0
leaq -0x68(%rbp), %rsi
callq 0x2140
movq %rax, -0x178(%rbp)
jmp 0x35a9
movq -0x178(%rbp), %rdi
movq 0x7a09(%rip), %rsi      # 0xafc0
callq 0x2180
jmp 0x35be
movq 0x7a0b(%rip), %rdi      # 0xafd0
leaq -0x90(%rbp), %rsi
callq 0x2140
movq %rax, -0x180(%rbp)
jmp 0x35da
movq -0x180(%rbp), %rdi
movq 0x79d8(%rip), %rsi      # 0xafc0
callq 0x2180
jmp 0x35ef
movq 0x79da(%rip), %rdi      # 0xafd0
leaq -0xb8(%rbp), %rsi
callq 0x2140
movq %rax, -0x188(%rbp)
jmp 0x360b
movq -0x188(%rbp), %rdi
movq 0x79a7(%rip), %rsi      # 0xafc0
callq 0x2180
jmp 0x3620
movq 0x79a9(%rip), %rdi      # 0xafd0
leaq -0x90(%rbp), %rsi
callq 0x2140
movq %rax, -0x190(%rbp)
jmp 0x363c
movq -0x190(%rbp), %rdi
movq 0x7976(%rip), %rsi      # 0xafc0
callq 0x2180
jmp 0x3651
leaq -0xb8(%rbp), %rdi
callq 0x20c0
leaq -0x90(%rbp), %rdi
callq 0x20c0
leaq -0x68(%rbp), %rdi
callq 0x20c0
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x3146
leaq -0xb8(%rbp), %rdi
callq 0x20c0
leaq -0x90(%rbp), %rdi
callq 0x20c0
leaq -0x68(%rbp), %rdi
callq 0x20c0
jmp 0x3825
leaq -0x101(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0x2270
movq -0x198(%rbp), %rdx
leaq 0x39cd(%rip), %rsi      # 0x7094
leaq -0x100(%rbp), %rdi
callq 0x3bb0
jmp 0x36d5
leaq -0x101(%rbp), %rdi
callq 0x21a0
movl $0x0, -0x108(%rbp)
movq -0x128(%rbp), %rcx
movl -0x108(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x37d6
movq -0x128(%rbp), %rax
movq %rax, %rdi
addq $0x10, %rdi
movl (%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0x38a0
movq %rax, %rdi
movslq -0x108(%rbp), %rsi
callq 0x3880
movq (%rax), %rdi
callq 0x28c0
movq %rax, -0x1a0(%rbp)
jmp 0x373b
movq -0x1a0(%rbp), %rdi
callq 0x2560
movb %al, -0x1a1(%rbp)
jmp 0x374f
movb -0x1a1(%rbp), %al
testb $0x1, %al
jne 0x375b
jmp 0x37a9
leaq 0x3924(%rip), %rsi      # 0x7086
leaq -0x100(%rbp), %rdi
callq 0x22a0
jmp 0x3770
jmp 0x37c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x101(%rbp), %rdi
callq 0x21a0
jmp 0x3825
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x20c0
jmp 0x3825
leaq 0x38de(%rip), %rsi      # 0x708e
leaq -0x100(%rbp), %rdi
callq 0x22a0
jmp 0x37be
jmp 0x37c0
jmp 0x37c2
movl -0x108(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x108(%rbp)
jmp 0x36eb
movq 0x77f3(%rip), %rdi      # 0xafd0
leaq -0x100(%rbp), %rsi
callq 0x2140
movq %rax, -0x1b0(%rbp)
jmp 0x37f2
movq -0x1b0(%rbp), %rdi
movq 0x77c0(%rip), %rsi      # 0xafc0
callq 0x2180
jmp 0x3807
leaq -0x100(%rbp), %rdi
callq 0x20c0
leaq -0x38(%rbp), %rdi
callq 0x20c0
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x20c0
movq -0x40(%rbp), %rdi
callq 0x2260
nopw (%rax,%rax)