// File: /workspace/github_cpp_makefile_star2_O2/cb92[P]Battleship/Game.cpp
// Function: Game::startGame()
void Game::startGame()
{
	std::string nameTemp;
	int autoTemp;

	//set player numbers
	p1.setPlayerNum(1);
	p2.setPlayerNum(2);

	//get player names
	std::cout<<"What is player 1's name (<=32 chars)?\n";
	p1.setName(getString(32));
	std::cout<<"Welcome, "<<p1.getName()<<"!"<<std::endl;

	std::cout<<"What is player 2's name (<=32 chars)?\n";
	p2.setName(getString(32));
	std::cout<<"Welcome, "<<p2.getName()<<"!"<<std::endl;

	//get automatic statuses
	std::cout<<"What type of player is "<<p1.getName()
					<<"? (enter 0 for non-auto, 1 for auto)\n";
	p1.setAuto(getInt(0,1));

	std::cout<<"What type of player is "<<p2.getName()
					<<"? (enter 0 for non-auto, 1 for auto)\n";
	p2.setAuto(getInt(0,1));


	//initialize both boards, according to whether the players are automatic
	if (p1.isPlayerAutomatic())
		initializeBoardAuto(p1Board, false);
	else
	{
		std::cout<<p1.getName()<<", how would you like your board to be set?"
						<<" (enter 0 for non-auto, 1 for auto)\n";
		autoTemp=getInt(0,1);
		if (autoTemp)
			initializeBoardAuto(p1Board, true);
		else initializeBoard(p1Board);

	}

	// if both players are non-auto, clear screen appropriately between fills
	if (!p2.isPlayerAutomatic() && !p1.isPlayerAutomatic())
	{
		switchPlayers(p1.getName(), p2.getName());
	}

	if (p2.isPlayerAutomatic())
		initializeBoardAuto(p2Board, false);
	else
	{
		
		std::cout<<p2.getName()<<", how would you like your board to be set?"
						<<" (enter 0 for non-auto, 1 for auto)\n";
		autoTemp=getInt(0,1);
		if (autoTemp)
			initializeBoardAuto(p2Board, true);
		else initializeBoard(p2Board);

	}
	if (!p2.isPlayerAutomatic() && !p1.isPlayerAutomatic())
	{
		std::cout<<std::string(100,'\n');
	}

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
leaq -0xc8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
pushq $0x1
popq %rsi
callq 0x48b4
leaq 0xa8(%rbx), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x48b4
movq 0x52bb(%rip), %rdi      # 0x7fd0
leaq 0x23b0(%rip), %rsi      # 0x50cc
callq 0x2160
leaq -0xb8(%rbp), %rdi
pushq $0x20
popq %rsi
callq 0x4aca
leaq -0xb8(%rbp), %rsi
movq %rbx, %rdi
callq 0x48a0
leaq -0xb8(%rbp), %rdi
callq 0x20a0
movq 0x527e(%rip), %rdi      # 0x7fd0
leaq 0x239a(%rip), %rsi      # 0x50f3
callq 0x2160
movq %rax, %r15
leaq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x4874
leaq -0x38(%rbp), %rsi
movq %r15, %rdi
callq 0x2130
leaq 0x231b(%rip), %rsi      # 0x509b
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
callq 0x20b0
leaq -0x38(%rbp), %rdi
callq 0x20a0
movq 0x5230(%rip), %rdi      # 0x7fd0
leaq 0x2356(%rip), %rsi      # 0x50fd
callq 0x2160
leaq -0x98(%rbp), %rdi
pushq $0x20
popq %rsi
callq 0x4aca
leaq -0x98(%rbp), %rsi
movq %r14, %rdi
callq 0x48a0
leaq -0x98(%rbp), %rdi
callq 0x20a0
movq 0x51f3(%rip), %rdi      # 0x7fd0
leaq 0x230f(%rip), %rsi      # 0x50f3
callq 0x2160
movq %rax, %r15
leaq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x4874
leaq -0x38(%rbp), %rsi
movq %r15, %rdi
callq 0x2130
leaq 0x2290(%rip), %rsi      # 0x509b
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
callq 0x20b0
leaq -0x38(%rbp), %rdi
callq 0x20a0
movq 0x51a5(%rip), %rdi      # 0x7fd0
leaq 0x22f2(%rip), %rsi      # 0x5124
callq 0x2160
movq %rax, %r15
leaq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x4874
leaq -0x38(%rbp), %rsi
movq %r15, %rdi
callq 0x2130
leaq 0x22e3(%rip), %rsi      # 0x513c
movq %rax, %rdi
callq 0x2160
leaq -0x38(%rbp), %rdi
callq 0x20a0
pushq $0x1
popq %rsi
xorl %edi, %edi
callq 0x494d
xorl %esi, %esi
testl %eax, %eax
setne %sil
movq %rbx, %rdi
callq 0x48aa
movq 0x5145(%rip), %rdi      # 0x7fd0
leaq 0x2292(%rip), %rsi      # 0x5124
callq 0x2160
movq %rax, %r15
leaq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x4874
leaq -0x38(%rbp), %rsi
movq %r15, %rdi
callq 0x2130
leaq 0x2283(%rip), %rsi      # 0x513c
movq %rax, %rdi
callq 0x2160
leaq -0x38(%rbp), %rdi
callq 0x20a0
pushq $0x1
popq %rsi
xorl %edi, %edi
callq 0x494d
xorl %esi, %esi
testl %eax, %eax
setne %sil
movq %r14, %rdi
callq 0x48aa
movq %rbx, %rdi
callq 0x488c
movl %eax, %r15d
testb %al, %al
je 0x2ef9
leaq 0x28(%rbx), %rsi
jmp 0x2f52
leaq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x4874
movq 0x50c4(%rip), %rdi      # 0x7fd0
leaq -0x38(%rbp), %rsi
callq 0x2130
leaq 0x2246(%rip), %rsi      # 0x5162
movq %rax, %rdi
callq 0x2160
leaq 0x2212(%rip), %rsi      # 0x513d
movq %rax, %rdi
callq 0x2160
leaq -0x38(%rbp), %rdi
callq 0x20a0
pushq $0x1
popq %rsi
xorl %edi, %edi
callq 0x494d
leaq 0x28(%rbx), %rsi
testl %eax, %eax
je 0x308d
xorb $0x1, %r15b
movzbl %r15b, %edx
callq 0x3486
movq %r14, %rdi
callq 0x488c
testb %al, %al
jne 0x2fae
movq %rbx, %rdi
callq 0x488c
testb %al, %al
jne 0x2fae
leaq -0x78(%rbp), %rdi
movq %rbx, %rsi
callq 0x4874
leaq -0x58(%rbp), %rdi
movq %r14, %rsi
callq 0x4874
leaq -0x78(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x3384
leaq -0x58(%rbp), %rdi
callq 0x20a0
leaq -0x78(%rbp), %rdi
callq 0x20a0
movq %r14, %rdi
callq 0x488c
movl %eax, %r15d
testb %al, %al
je 0x2fc6
leaq 0xd0(%rbx), %rsi
jmp 0x301e
leaq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x4874
movq 0x4ff7(%rip), %rdi      # 0x7fd0
leaq -0x38(%rbp), %rsi
callq 0x2130
leaq 0x2179(%rip), %rsi      # 0x5162
movq %rax, %rdi
callq 0x2160
leaq 0x2145(%rip), %rsi      # 0x513d
movq %rax, %rdi
callq 0x2160
leaq -0x38(%rbp), %rdi
callq 0x20a0
pushq $0x1
popq %rsi
xorl %edi, %edi
callq 0x494d
leaq 0xd0(%rbx), %rsi
testl %eax, %eax
je 0x309a
xorb $0x1, %r15b
movzbl %r15b, %edx
callq 0x3486
movq %r14, %rdi
callq 0x488c
testb %al, %al
jne 0x3073
movq %rbx, %rdi
callq 0x488c
testb %al, %al
jne 0x3073
leaq -0x28(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x38(%rbp), %rdi
pushq $0x64
popq %rsi
pushq $0xa
popq %rdx
callq 0x2190
movq 0x4f6f(%rip), %rdi      # 0x7fd0
leaq -0x38(%rbp), %rsi
callq 0x2130
leaq -0x38(%rbp), %rdi
callq 0x20a0
leaq -0xd8(%rbp), %rdi
callq 0x20a0
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x3522
jmp 0x2f5f
movq %rbx, %rdi
callq 0x3522
jmp 0x302b
jmp 0x30ed
jmp 0x30fb
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x20a0
jmp 0x30b9
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
jmp 0x30f4
jmp 0x30fb
jmp 0x30fb
jmp 0x30fb
jmp 0x30fb
jmp 0x30fb
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
jmp 0x30f4
jmp 0x30fb
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
jmp 0x30f4
jmp 0x30ed
jmp 0x30ed
jmp 0x30ed
jmp 0x30ed
jmp 0x30ed
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x20a0
jmp 0x30fe
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2230