// File: /workspace/github_cpp_makefile_star2_O3/arisKoutsou[P]oopproj/./src/grid/Grid.cpp
// Function: Grid::displayMap() const
void Grid :: displayMap() const {

  int columns = tiles[0].size();	// Get the size of the vector of tiles.
  int rows = tiles.size();		// Get the size of lines of the vector.

  cout << endl;
  // Draw the first line which is a wall...
  for (int i = 0; i < columns; i++) {
    cout << "+---";
  }
  cout << "+" << endl;

  for (int i = rows - 1; i >= 0 ; i--) {
    // Draw | H |   | ....
    for (int j = 0; j < columns; j++) {
      cout << "|";

      if (tiles[i][j].hasLiving()) {
	cout << " H ";
      } else if (tiles[i][j].hasMarket()) {
	cout << " M ";
      } else if (tiles[i][j].isNonAccessible()) {
	cout << "###";
      } else if (tiles[i][j].isCommon()) {
	cout << " C ";
      } else {
	cout << "   ";
      }

    }
    cout << "|" << endl;

    // Draw wall...
    for (int i = 0; i < columns; i++) {
      cout << "+---";
    }
    cout << "+" << endl;
  }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x8(%rax), %rcx
subq (%rax), %rcx
movq 0x10(%rdi), %rdx
sarq $0x3, %rcx
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
imulq %rcx, %r13
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rax
movq %rax, 0x8(%rsp)
movq 0x1e5f5(%rip), %r14     # 0x24fc0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
testl %r13d, %r13d
jle 0x6a1c
movq 0x1e5c2(%rip), %r15     # 0x24fc0
leaq 0x149f2(%rip), %r12     # 0x1b3f7
movl %r13d, %ebp
movl $0x4, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x42f0
decl %ebp
jne 0x6a08
leaq 0x14876(%rip), %rsi     # 0x1b299
movl $0x1, %edx
movq %r14, %rdi
callq 0x42f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq 0x8(%rsp), %r12
testl %r12d, %r12d
jle 0x6c02
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andq %rax, %r12
movq %r13, %rcx
andq %rax, %rcx
movq %rcx, 0x18(%rsp)
leaq 0x14780(%rip), %r15     # 0x1b1ff
movq %r13, 0x10(%rsp)
movq %r12, 0x20(%rsp)
decq %r12
testl %r13d, %r13d
jle 0x6b7f
movq %r12, 0x8(%rsp)
leaq (%r12,%r12,2), %r13
movq 0x18(%rsp), %r12
xorl %ebp, %ebp
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x42f0
movq 0x8(%rbx), %rax
movq (%rax,%r13,8), %rax
leaq (%rax,%rbp), %rcx
addq $0x8, %rcx
leaq 0x14930(%rip), %rsi     # 0x1b3fc
cmpq (%rcx), %rcx
jne 0x6b05
cmpq $0x0, 0x20(%rax,%rbp)
leaq 0x14922(%rip), %rsi     # 0x1b400
jne 0x6b05
leaq (%rax,%rbp), %rcx
cmpb $0x0, (%rcx)
leaq 0x14916(%rip), %rsi     # 0x1b404
jne 0x6b05
cmpb $0x0, 0x1(%rax,%rbp)
leaq 0x1490c(%rip), %rsi     # 0x1b408
jne 0x6b05
leaq 0x14907(%rip), %rsi     # 0x1b40c
movl $0x3, %edx
movq %r14, %rdi
callq 0x42f0
addq $0x28, %rbp
decq %r12
jne 0x6aa5
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x42f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq 0x10(%rsp), %rax
movl %eax, %ebp
testl %eax, %eax
movq 0x8(%rsp), %r12
leaq 0x14890(%rip), %r13     # 0x1b3f7
jle 0x6bb6
movl $0x4, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x42f0
decl %ebp
jne 0x6b69
jmp 0x6bb6
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x42f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movl $0x1, %edx
movq %r14, %rdi
leaq 0x146d4(%rip), %rsi     # 0x1b299
callq 0x42f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
cmpq $0x1, 0x20(%rsp)
movq 0x10(%rsp), %r13
jg 0x6a84
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop