// File: Doug0855[P]TigerZone/Game.cpp
// Function: Game::structurePoints(Structure)
int Game::structurePoints(Structure structure)
{
	int points = 0;
	const int SIZE_POINTS = 1;
	const int JUNGLE_POINTS = 1;
	const int LAKE_POINTS = 3;
	const int TRAIL_POINTS = 2;
	const int PREY_POINTS = 1;
	const int CROC_POINTS = -2;
	/*
	This entire thing is just checking the type of the structure and anything 
	it has and adding points to a specific location to find the "best one"
	*/
	for (size_t i = 0; i < structure.structureBlocks.size(); i++)
	{
		points += SIZE_POINTS;
	}
	if (structure.type == "jungle")
	{
		points += JUNGLE_POINTS;
	}
	if (structure.type == "lake")
	{
		points += LAKE_POINTS;
	}
	if (structure.type == "trail")
	{
		points += TRAIL_POINTS;
	}
	for (int i = 0; i < structure.boarCount; i++)
	{
		points += PREY_POINTS;
	}
	for (int i = 0; i < structure.deerCount; i++)
	{
		points += PREY_POINTS;
	}
	for (int i = 0; i < structure.buffaloCount; i++)
	{
		points += PREY_POINTS;
	}
	for (int i = 0; i < structure.crocodileCount; i++)
	{
		points += CROC_POINTS;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rsi, -0x50(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x1, -0x18(%rbp)
movl $0x1, -0x1c(%rbp)
movl $0x3, -0x20(%rbp)
movl $0x2, -0x24(%rbp)
movl $0x1, -0x28(%rbp)
movl $0xfffffffe, -0x2c(%rbp) # imm = 0xFFFFFFFE
movq $0x0, -0x38(%rbp)
movq -0x50(%rbp), %rdi
movq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
addq $0x28, %rdi
callq 0x96e0
movq %rax, %rcx
movq -0x58(%rbp), %rax
cmpq %rcx, %rax
jae 0x14ff5
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x14fbd
movq -0x50(%rbp), %rdi
leaq 0x146a7(%rip), %rsi     # 0x296a7
callq 0x85b0
testb $0x1, %al
jne 0x1500b
jmp 0x15014
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x50(%rbp), %rdi
leaq 0x1468f(%rip), %rsi     # 0x296ae
callq 0x85b0
testb $0x1, %al
jne 0x1502a
jmp 0x15033
movl -0x14(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x14(%rbp)
movq -0x50(%rbp), %rdi
leaq 0x14675(%rip), %rsi     # 0x296b3
callq 0x85b0
testb $0x1, %al
jne 0x15049
jmp 0x15052
movl -0x14(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x50(%rbp), %rcx
movl -0x3c(%rbp), %eax
cmpl 0x40(%rcx), %eax
jge 0x15079
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x15059
movl $0x0, -0x40(%rbp)
movq -0x50(%rbp), %rcx
movl -0x40(%rbp), %eax
cmpl 0x44(%rcx), %eax
jge 0x150a0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x15080
movl $0x0, -0x44(%rbp)
movq -0x50(%rbp), %rcx
movl -0x44(%rbp), %eax
cmpl 0x48(%rcx), %eax
jge 0x150c7
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x150a7
movl $0x0, -0x48(%rbp)
movq -0x50(%rbp), %rcx
movl -0x48(%rbp), %eax
cmpl 0x4c(%rcx), %eax
jge 0x150ee
movl -0x14(%rbp), %eax
addl $-0x2, %eax
movl %eax, -0x14(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x150ce
ud2