// File: /workspace/github_cpp_makefile_star2_O3/gabryatfendor[P]SocietySimulator/src/map.cpp
// Function: printMap()
void printMap()
{
	for(int j=0;j<HEIGHT;j++)
	{
		for(int i=0;i<WIDTH;i++)
		{
			if (map[i][j].villagerHere)
			{
				if(map[i][j].kind == '-')//on a boat!!
				{
					cout << "\033[1;35mB\033[0m";
				}
				else
				{
					cout << "\033[1;35m@\033[0m";
				}
			}
			else
			{
				if(map[i][j].kind=='-')
				{
					cout << "\033[1;36m-\033[0m";
				}
				else if (map[i][j].kind=='^')
				{
					cout << "\033[1;31m^\033[0m";
				}
				else if (map[i][j].kind=='|')
				{
					cout << "\033[1;32m|\033[0m";
				}
				else if (map[i][j].kind=='c')
				{
					cout << "\033[1m@\033[0m";
				}
				else if (map[i][j].kind=='x')
				{
					map[i][j].usable++;
					if(map[i][j].usable>=100)
					{
						map[i][j].kind=map[i][j].origin;
					}
					cout << "x";
				}
				else
				{
					cout << "\033[1m"<<map[i][j].kind<<"\033[0m";
				}

			}
		}
		cout << "\n";
	}
	cout << "Fish: " << fish << "    Wood: " << wood << "    Food: " << food << "    Stone: " << stone << "\n";

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x40eb(%rip), %r13      # 0x71e0
xorl %r12d, %r12d
movq 0x3ed1(%rip), %rbx      # 0x6fd0
leaq 0x1f8d(%rip), %r15      # 0x5093
xorl %r14d, %r14d
movzbl 0x1(%r13,%r14), %eax
cmpb $0x1, 0xa(%r13,%r14)
jne 0x3130
movl $0xc, %edx
movq %rbx, %rdi
cmpl $0x2d, %eax
jne 0x315c
leaq 0x1f5b(%rip), %rsi      # 0x5086
jmp 0x320d
cmpl $0x62, %eax
jle 0x3164
cmpl $0x63, %eax
je 0x3182
cmpl $0x78, %eax
je 0x3193
cmpl $0x7c, %eax
jne 0x31d1
movl $0xc, %edx
movq %rbx, %rdi
leaq 0x1f63(%rip), %rsi      # 0x50ba
jmp 0x320d
movq %r15, %rsi
jmp 0x320d
cmpl $0x2d, %eax
je 0x31c0
cmpl $0x5e, %eax
jne 0x31d1
movl $0xc, %edx
movq %rbx, %rdi
leaq 0x1f30(%rip), %rsi      # 0x50ad
jmp 0x320d
movl $0x9, %edx
movq %rbx, %rdi
leaq 0x1f36(%rip), %rsi      # 0x50c7
jmp 0x320d
movl 0x4(%r13,%r14), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x4(%r13,%r14)
cmpl $0x63, %eax
jl 0x31af
movb (%r13,%r14), %al
movb %al, 0x1(%r13,%r14)
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x1f13(%rip), %rsi      # 0x50d1
jmp 0x320d
movl $0xc, %edx
movq %rbx, %rdi
leaq 0x1ed1(%rip), %rsi      # 0x50a0
jmp 0x320d
movl $0x4, %edx
movq %rbx, %rdi
leaq 0x1ef3(%rip), %rsi      # 0x50d3
callq 0x21c0
movb 0x1(%r13,%r14), %al
movb %al, -0x29(%rbp)
movl $0x1, %edx
movq %rbx, %rdi
leaq -0x29(%rbp), %rsi
callq 0x21c0
movl $0x4, %edx
movq %rax, %rdi
leaq 0x1e9b(%rip), %rsi      # 0x50a8
callq 0x21c0
addq $0xf0, %r14
cmpq $0x4b00, %r14           # imm = 0x4B00
jne 0x3109
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x1dec(%rip), %rsi      # 0x5021
callq 0x21c0
incq %r12
addq $0xc, %r13
cmpq $0x14, %r12
jne 0x3106
movq 0x3d7e(%rip), %rbx      # 0x6fd0
leaq 0x1e7f(%rip), %rsi      # 0x50d8
movl $0x6, %edx
movq %rbx, %rdi
callq 0x21c0
leaq 0x8f2b(%rip), %rax      # 0xc198
movl (%rax), %esi
movq %rbx, %rdi
callq 0x2280
movq %rax, %rbx
leaq 0x1e5e(%rip), %rsi      # 0x50df
movl $0xa, %edx
movq %rax, %rdi
callq 0x21c0
leaq 0x8eff(%rip), %rax      # 0xc194
movl (%rax), %esi
movq %rbx, %rdi
callq 0x2280
movq %rax, %rbx
leaq 0x1e41(%rip), %rsi      # 0x50ea
movl $0xa, %edx
movq %rax, %rdi
callq 0x21c0
leaq 0x8edf(%rip), %rax      # 0xc19c
movl (%rax), %esi
movq %rbx, %rdi
callq 0x2280
movq %rax, %rbx
leaq 0x1e24(%rip), %rsi      # 0x50f5
movl $0xb, %edx
movq %rax, %rdi
callq 0x21c0
leaq 0x8ebb(%rip), %rax      # 0xc1a0
movl (%rax), %esi
movq %rbx, %rdi
callq 0x2280
leaq 0x1d2b(%rip), %rsi      # 0x5021
movl $0x1, %edx
movq %rax, %rdi
callq 0x21c0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq