// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl $0x1, %esi
callq 0x5260
leaq 0xa8(%rbx), %r14
movq %r14, %rdi
movl $0x2, %esi
callq 0x5260
movq 0x6007(%rip), %rdi      # 0x8fd0
leaq 0x30d2(%rip), %rsi      # 0x60a2
movl $0x26, %edx
callq 0x2150
leaq -0xe8(%rbp), %rdi
movl $0x20, %esi
callq 0x55de
leaq -0xe8(%rbp), %rsi
movq %rbx, %rdi
callq 0x524c
leaq -0xd8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3019
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x5fb0(%rip), %rdi      # 0x8fd0
leaq 0x30a2(%rip), %rsi      # 0x60c9
movl $0x9, %edx
callq 0x2150
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
callq 0x520c
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x5f84(%rip), %rdi      # 0x8fd0
callq 0x2150
movq %rax, %r15
leaq 0x3016(%rip), %rsi      # 0x6071
movl $0x1, %edx
movq %rax, %rdi
callq 0x2150
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20b0
leaq -0x38(%rbp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x30a8
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x5f21(%rip), %rdi      # 0x8fd0
leaq 0x301d(%rip), %rsi      # 0x60d3
movl $0x26, %edx
callq 0x2150
leaq -0xc8(%rbp), %rdi
movl $0x20, %esi
callq 0x55de
leaq -0xc8(%rbp), %rsi
movq %r14, %rdi
callq 0x524c
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x30ff
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x5eca(%rip), %rdi      # 0x8fd0
leaq 0x2fbc(%rip), %rsi      # 0x60c9
movl $0x9, %edx
callq 0x2150
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x520c
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x5e9e(%rip), %rdi      # 0x8fd0
callq 0x2150
movq %rax, %r15
leaq 0x2f30(%rip), %rsi      # 0x6071
movl $0x1, %edx
movq %rax, %rdi
callq 0x2150
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20b0
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x318a
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x5e3f(%rip), %rdi      # 0x8fd0
leaq 0x2f62(%rip), %rsi      # 0x60fa
movl $0x17, %edx
callq 0x2150
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
callq 0x520c
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x5e13(%rip), %rdi      # 0x8fd0
callq 0x2150
leaq 0x2f49(%rip), %rsi      # 0x6112
movl $0x25, %edx
movq %rax, %rdi
callq 0x2150
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x31eb
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
xorl %edi, %edi
movl $0x1, %esi
callq 0x53dd
xorl %esi, %esi
testl %eax, %eax
setne %sil
movq %rbx, %rdi
callq 0x5256
movq 0x5dc2(%rip), %rdi      # 0x8fd0
leaq 0x2ee5(%rip), %rsi      # 0x60fa
movl $0x17, %edx
callq 0x2150
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x520c
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x5d96(%rip), %rdi      # 0x8fd0
callq 0x2150
leaq 0x2ecc(%rip), %rsi      # 0x6112
movl $0x25, %edx
movq %rax, %rdi
callq 0x2150
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x3268
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
xorl %edi, %edi
movl $0x1, %esi
callq 0x53dd
xorl %esi, %esi
testl %eax, %eax
setne %sil
movq %r14, %rdi
callq 0x5256
movq %rbx, %rdi
callq 0x5238
movl %eax, %r15d
testb %al, %al
je 0x3299
leaq 0x28(%rbx), %rsi
jmp 0x3311
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
callq 0x520c
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x5d1c(%rip), %rdi      # 0x8fd0
callq 0x2150
movq %rax, %r12
leaq 0x2e75(%rip), %rsi      # 0x6138
movl $0x2a, %edx
movq %rax, %rdi
callq 0x2150
leaq 0x2e3c(%rip), %rsi      # 0x6113
movl $0x24, %edx
movq %r12, %rdi
callq 0x2150
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x32f9
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
xorl %edi, %edi
movl $0x1, %esi
callq 0x53dd
leaq 0x28(%rbx), %rsi
testl %eax, %eax
je 0x34c1
xorb $0x1, %r15b
movzbl %r15b, %edx
callq 0x3a5a
movq %r14, %rdi
callq 0x5238
testb %al, %al
jne 0x339f
movq %rbx, %rdi
callq 0x5238
testb %al, %al
jne 0x339f
leaq -0xa8(%rbp), %rdi
movq %rbx, %rsi
callq 0x520c
leaq -0x88(%rbp), %rdi
movq %r14, %rsi
callq 0x520c
leaq -0xa8(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x3918
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3380
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x339f
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2140
movq %r14, %rdi
callq 0x5238
movl %eax, %r15d
testb %al, %al
je 0x33b7
leaq 0xd0(%rbx), %rsi
jmp 0x3432
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x520c
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x5bfe(%rip), %rdi      # 0x8fd0
callq 0x2150
movq %rax, %r12
leaq 0x2d57(%rip), %rsi      # 0x6138
movl $0x2a, %edx
movq %rax, %rdi
callq 0x2150
leaq 0x2d1e(%rip), %rsi      # 0x6113
movl $0x24, %edx
movq %r12, %rdi
callq 0x2150
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x3417
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
xorl %edi, %edi
movl $0x1, %esi
callq 0x53dd
leaq 0xd0(%rbx), %rsi
testl %eax, %eax
je 0x34ce
xorb $0x1, %r15b
movzbl %r15b, %edx
callq 0x3a5a
movq %r14, %rdi
callq 0x5238
testb %al, %al
jne 0x3496
movq %rbx, %rdi
callq 0x5238
testb %al, %al
jne 0x3496
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
movl $0x64, %esi
movl $0xa, %edx
callq 0x2160
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x5b54(%rip), %rdi      # 0x8fd0
callq 0x2150
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x3496
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x34af
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x3b24
jmp 0x331e
movq %rbx, %rdi
callq 0x3b24
jmp 0x343f
jmp 0x356f
jmp 0x359b
movq %rax, %rbx
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3506
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
jmp 0x3506
movq %rax, %rbx
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x359e
movq -0x98(%rbp), %rsi
jmp 0x3591
jmp 0x359b
jmp 0x359b
jmp 0x359b
jmp 0x359b
jmp 0x359b
movq %rax, %rbx
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x359e
movq -0xb8(%rbp), %rsi
jmp 0x3591
jmp 0x359b
movq %rax, %rbx
leaq -0xd8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x359e
movq -0xd8(%rbp), %rsi
jmp 0x3591
jmp 0x356f
jmp 0x356f
jmp 0x356f
jmp 0x356f
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
jne 0x358d
jmp 0x359e
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x359e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
jmp 0x359e
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x35b7
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21f0
nop