// File: /workspace/github_cpp_makefile_star2_O1/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 0x50e3(%rip), %r13      # 0x81e0
xorl %r12d, %r12d
movq 0x4ec9(%rip), %rbx      # 0x7fd0
leaq 0x1f73(%rip), %r15      # 0x5081
xorl %r14d, %r14d
movzbl 0x1(%r13,%r14), %eax
cmpb $0x1, 0xa(%r13,%r14)
jne 0x3138
movl $0xc, %edx
movq %rbx, %rdi
cmpl $0x2d, %eax
jne 0x3164
leaq 0x1f41(%rip), %rsi      # 0x5074
jmp 0x3215
cmpl $0x62, %eax
jle 0x316c
cmpl $0x63, %eax
je 0x318a
cmpl $0x78, %eax
je 0x319b
cmpl $0x7c, %eax
jne 0x31d9
movl $0xc, %edx
movq %rbx, %rdi
leaq 0x1f49(%rip), %rsi      # 0x50a8
jmp 0x3215
movq %r15, %rsi
jmp 0x3215
cmpl $0x2d, %eax
je 0x31c8
cmpl $0x5e, %eax
jne 0x31d9
movl $0xc, %edx
movq %rbx, %rdi
leaq 0x1f16(%rip), %rsi      # 0x509b
jmp 0x3215
movl $0x9, %edx
movq %rbx, %rdi
leaq 0x1f1c(%rip), %rsi      # 0x50b5
jmp 0x3215
movl 0x4(%r13,%r14), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x4(%r13,%r14)
cmpl $0x63, %eax
jl 0x31b7
movb (%r13,%r14), %al
movb %al, 0x1(%r13,%r14)
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x1ef9(%rip), %rsi      # 0x50bf
jmp 0x3215
movl $0xc, %edx
movq %rbx, %rdi
leaq 0x1eb7(%rip), %rsi      # 0x508e
jmp 0x3215
movl $0x4, %edx
movq %rbx, %rdi
leaq 0x1ed9(%rip), %rsi      # 0x50c1
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 0x1e81(%rip), %rsi      # 0x5096
callq 0x21c0
addq $0xf0, %r14
cmpq $0x4b00, %r14           # imm = 0x4B00
jne 0x3111
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x1de4(%rip), %rsi      # 0x5021
callq 0x21c0
incq %r12
addq $0xc, %r13
cmpq $0x14, %r12
jne 0x310e
movq 0x4d76(%rip), %rbx      # 0x7fd0
leaq 0x1e65(%rip), %rsi      # 0x50c6
movl $0x6, %edx
movq %rbx, %rdi
callq 0x21c0
leaq 0x9f23(%rip), %rax      # 0xd198
movl (%rax), %esi
movq %rbx, %rdi
callq 0x2280
movq %rax, %rbx
leaq 0x1e44(%rip), %rsi      # 0x50cd
movl $0xa, %edx
movq %rax, %rdi
callq 0x21c0
leaq 0x9ef7(%rip), %rax      # 0xd194
movl (%rax), %esi
movq %rbx, %rdi
callq 0x2280
movq %rax, %rbx
leaq 0x1e27(%rip), %rsi      # 0x50d8
movl $0xa, %edx
movq %rax, %rdi
callq 0x21c0
leaq 0x9ed7(%rip), %rax      # 0xd19c
movl (%rax), %esi
movq %rbx, %rdi
callq 0x2280
movq %rax, %rbx
leaq 0x1e0a(%rip), %rsi      # 0x50e3
movl $0xb, %edx
movq %rax, %rdi
callq 0x21c0
leaq 0x9eb3(%rip), %rax      # 0xd1a0
movl (%rax), %esi
movq %rbx, %rdi
callq 0x2280
leaq 0x1d23(%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