// File: Doug0855[P]TigerZone/Board.cpp
// Function: Board::positionPoints(int, int)
int Board::positionPoints(int i, int j)
{
	const int LAKE_POINTS = 6;
	const int JUNGLE_POINTS = 3;
	const int TRAIL_POINTS = 1;

	int points = 0;
	// for the following if statements you'll be checking the positions adjacent tiles and adding points based on 
	// the adjacents tile's face as well as existing animals within that tile.
	if (m_board[i + 1][j] != NULL)
	{
		points += animalPoints(i + 1, j);
		if (m_board[i + 1][j]->getUpFace()->getType() == "lake")
		{
			points += LAKE_POINTS;
		}
		else if (m_board[i + 1][j]->getUpFace()->getType() == "jungle")
		{
			points += JUNGLE_POINTS;
		}
		else if (m_board[i + 1][j]->getUpFace()->getType() == "trail")
		{
			points += TRAIL_POINTS;
		}
	}
	if (m_board[i - 1][j] != NULL)
	{
		points += animalPoints(i - 1, j);
		if (m_board[i - 1][j]->getDownFace()->getType() == "lake")
		{
			points += LAKE_POINTS;
		}
		else if (m_board[i - 1][j]->getDownFace()->getType() == "jungle")
		{
			points += JUNGLE_POINTS;
		}
		else if (m_board[i - 1][j]->getDownFace()->getType() == "trail")
		{
			points += TRAIL_POINTS;
		}
	}
	if (m_board[i][j + 1] != NULL)
	{
		points += animalPoints(i, j + 1);
		if (m_board[i][j + 1]->getLeftFace()->getType() == "lake")
		{
			points += LAKE_POINTS;
		}
		else if (m_board[i][j + 1]->getLeftFace()->getType() == "jungle")
		{
			points += JUNGLE_POINTS;
		}
		else if (m_board[i][j + 1]->getLeftFace()->getType() == "trail")
		{
			points += TRAIL_POINTS;
		}
	}
	if (m_board[i][j - 1] != NULL)
	{
		points += animalPoints(i, j - 1);
		if (m_board[i][j - 1]->getRightFace()->getType() == "lake")
		{
			points += LAKE_POINTS;
		}
		else if (m_board[i][j - 1]->getRightFace()->getType() == "jungle")
		{
			points += JUNGLE_POINTS;
		}
		else if (m_board[i][j - 1]->getRightFace()->getType() == "trail")
		{
			points += TRAIL_POINTS;
		}
	}
	return points;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x1b8(%rbp)
movl $0x6, -0x14(%rbp)
movl $0x3, -0x18(%rbp)
movl $0x1, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x8230
cmpq $0x0, (%rax)
je 0x1ab33
movq -0x1b8(%rbp), %rdi
movl -0xc(%rbp), %esi
incl %esi
movl -0x10(%rbp), %edx
callq 0x1b1b0
movq -0x1b8(%rbp), %rdi
movl %eax, %ecx
movl -0x20(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x20(%rbp)
movl -0xc(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203a0
movq %rax, %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x204b0
movq -0x1c8(%rbp), %rdi
leaq 0xecf7(%rip), %rsi      # 0x296ae
callq 0x85b0
movb %al, -0x1b9(%rbp)
jmp 0x1a9c4
leaq -0x40(%rbp), %rdi
callq 0x3210
movb -0x1b9(%rbp), %al
testb $0x1, %al
jne 0x1a9d9
jmp 0x1aa01
movl -0x20(%rbp), %eax
addl $0x6, %eax
movl %eax, -0x20(%rbp)
jmp 0x1ab31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3210
jmp 0x1b19c
movq -0x1b8(%rbp), %rdi
movl -0xc(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203a0
movq %rax, %rsi
leaq -0x70(%rbp), %rdi
movq %rdi, -0x1d8(%rbp)
callq 0x204b0
movq -0x1d8(%rbp), %rdi
leaq 0xec5d(%rip), %rsi      # 0x296a7
callq 0x85b0
movb %al, -0x1c9(%rbp)
jmp 0x1aa57
leaq -0x70(%rbp), %rdi
callq 0x3210
movb -0x1c9(%rbp), %al
testb $0x1, %al
jne 0x1aa6c
jmp 0x1aa94
movl -0x20(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x20(%rbp)
jmp 0x1ab2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x3210
jmp 0x1b19c
movq -0x1b8(%rbp), %rdi
movl -0xc(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203a0
movq %rax, %rsi
leaq -0x90(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x204b0
movq -0x1e8(%rbp), %rdi
leaq 0xebd3(%rip), %rsi      # 0x296b3
callq 0x85b0
movb %al, -0x1d9(%rbp)
jmp 0x1aaed
leaq -0x90(%rbp), %rdi
callq 0x3210
movb -0x1d9(%rbp), %al
testb $0x1, %al
jne 0x1ab05
jmp 0x1ab2d
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1ab2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3210
jmp 0x1b19c
jmp 0x1ab2f
jmp 0x1ab31
jmp 0x1ab33
movq -0x1b8(%rbp), %rdi
movl -0xc(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x8230
cmpq $0x0, (%rax)
je 0x1ad53
movq -0x1b8(%rbp), %rdi
movl -0xc(%rbp), %esi
decl %esi
movl -0x10(%rbp), %edx
callq 0x1b1b0
movq -0x1b8(%rbp), %rdi
movl %eax, %ecx
movl -0x20(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x20(%rbp)
movl -0xc(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203c0
movq %rax, %rsi
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x204b0
movq -0x1f8(%rbp), %rdi
leaq 0xeae6(%rip), %rsi      # 0x296ae
callq 0x85b0
movb %al, -0x1e9(%rbp)
jmp 0x1abd5
leaq -0xb0(%rbp), %rdi
callq 0x3210
movb -0x1e9(%rbp), %al
testb $0x1, %al
jne 0x1abed
jmp 0x1ac18
movl -0x20(%rbp), %eax
addl $0x6, %eax
movl %eax, -0x20(%rbp)
jmp 0x1ad51
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x3210
jmp 0x1b19c
movq -0x1b8(%rbp), %rdi
movl -0xc(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203c0
movq %rax, %rsi
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x208(%rbp)
callq 0x204b0
movq -0x208(%rbp), %rdi
leaq 0xea43(%rip), %rsi      # 0x296a7
callq 0x85b0
movb %al, -0x1f9(%rbp)
jmp 0x1ac71
leaq -0xd0(%rbp), %rdi
callq 0x3210
movb -0x1f9(%rbp), %al
testb $0x1, %al
jne 0x1ac89
jmp 0x1acb4
movl -0x20(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x20(%rbp)
jmp 0x1ad4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x3210
jmp 0x1b19c
movq -0x1b8(%rbp), %rdi
movl -0xc(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203c0
movq %rax, %rsi
leaq -0xf0(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0x204b0
movq -0x218(%rbp), %rdi
leaq 0xe9b3(%rip), %rsi      # 0x296b3
callq 0x85b0
movb %al, -0x209(%rbp)
jmp 0x1ad0d
leaq -0xf0(%rbp), %rdi
callq 0x3210
movb -0x209(%rbp), %al
testb $0x1, %al
jne 0x1ad25
jmp 0x1ad4d
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1ad4d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x3210
jmp 0x1b19c
jmp 0x1ad4f
jmp 0x1ad51
jmp 0x1ad53
movq -0x1b8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x10(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x8230
cmpq $0x0, (%rax)
je 0x1af73
movq -0x1b8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
incl %edx
callq 0x1b1b0
movq -0x1b8(%rbp), %rdi
movl %eax, %ecx
movl -0x20(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x20(%rbp)
movslq -0xc(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x10(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x20400
movq %rax, %rsi
leaq -0x110(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0x204b0
movq -0x228(%rbp), %rdi
leaq 0xe8c6(%rip), %rsi      # 0x296ae
callq 0x85b0
movb %al, -0x219(%rbp)
jmp 0x1adf5
leaq -0x110(%rbp), %rdi
callq 0x3210
movb -0x219(%rbp), %al
testb $0x1, %al
jne 0x1ae0d
jmp 0x1ae38
movl -0x20(%rbp), %eax
addl $0x6, %eax
movl %eax, -0x20(%rbp)
jmp 0x1af71
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3210
jmp 0x1b19c
movq -0x1b8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x10(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x20400
movq %rax, %rsi
leaq -0x130(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x204b0
movq -0x238(%rbp), %rdi
leaq 0xe823(%rip), %rsi      # 0x296a7
callq 0x85b0
movb %al, -0x229(%rbp)
jmp 0x1ae91
leaq -0x130(%rbp), %rdi
callq 0x3210
movb -0x229(%rbp), %al
testb $0x1, %al
jne 0x1aea9
jmp 0x1aed4
movl -0x20(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x20(%rbp)
jmp 0x1af6f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x3210
jmp 0x1b19c
movq -0x1b8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x10(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x20400
movq %rax, %rsi
leaq -0x150(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x204b0
movq -0x248(%rbp), %rdi
leaq 0xe793(%rip), %rsi      # 0x296b3
callq 0x85b0
movb %al, -0x239(%rbp)
jmp 0x1af2d
leaq -0x150(%rbp), %rdi
callq 0x3210
movb -0x239(%rbp), %al
testb $0x1, %al
jne 0x1af45
jmp 0x1af6d
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1af6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x3210
jmp 0x1b19c
jmp 0x1af6f
jmp 0x1af71
jmp 0x1af73
movq -0x1b8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x10(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8230
cmpq $0x0, (%rax)
je 0x1b190
movq -0x1b8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
decl %edx
callq 0x1b1b0
movq -0x1b8(%rbp), %rdi
movl %eax, %ecx
movl -0x20(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x20(%rbp)
movslq -0xc(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x10(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203e0
movq %rax, %rsi
leaq -0x170(%rbp), %rdi
movq %rdi, -0x258(%rbp)
callq 0x204b0
movq -0x258(%rbp), %rdi
leaq 0xe6a6(%rip), %rsi      # 0x296ae
callq 0x85b0
movb %al, -0x249(%rbp)
jmp 0x1b015
leaq -0x170(%rbp), %rdi
callq 0x3210
movb -0x249(%rbp), %al
testb $0x1, %al
jne 0x1b02d
jmp 0x1b058
movl -0x20(%rbp), %eax
addl $0x6, %eax
movl %eax, -0x20(%rbp)
jmp 0x1b18e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x3210
jmp 0x1b19c
movq -0x1b8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x10(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203e0
movq %rax, %rsi
leaq -0x190(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0x204b0
movq -0x268(%rbp), %rdi
leaq 0xe603(%rip), %rsi      # 0x296a7
callq 0x85b0
movb %al, -0x259(%rbp)
jmp 0x1b0b1
leaq -0x190(%rbp), %rdi
callq 0x3210
movb -0x259(%rbp), %al
testb $0x1, %al
jne 0x1b0c9
jmp 0x1b0f4
movl -0x20(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x20(%rbp)
jmp 0x1b18c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x3210
jmp 0x1b19c
movq -0x1b8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x10(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203e0
movq %rax, %rsi
leaq -0x1b0(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0x204b0
movq -0x278(%rbp), %rdi
leaq 0xe573(%rip), %rsi      # 0x296b3
callq 0x85b0
movb %al, -0x269(%rbp)
jmp 0x1b14d
leaq -0x1b0(%rbp), %rdi
callq 0x3210
movb -0x269(%rbp), %al
testb $0x1, %al
jne 0x1b165
jmp 0x1b18a
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1b18a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x3210
jmp 0x1b19c
jmp 0x1b18c
jmp 0x1b18e
jmp 0x1b190
movl -0x20(%rbp), %eax
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x34f0
nopw %cs:(%rax,%rax)