// File: /workspace/github_cpp_makefile_star2_O3/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 0x5250
leaq 0xa8(%rbx), %r14
movq %r14, %rdi
movl $0x2, %esi
callq 0x5250
movq 0x6001(%rip), %rdi      # 0x8fd0
leaq 0x30cc(%rip), %rsi      # 0x60a2
movl $0x26, %edx
callq 0x2150
leaq -0xe8(%rbp), %rdi
movl $0x20, %esi
callq 0x55b1
leaq -0xe8(%rbp), %rsi
movq %rbx, %rdi
callq 0x523c
leaq -0xd8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x301f
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x5faa(%rip), %rdi      # 0x8fd0
leaq 0x309c(%rip), %rsi      # 0x60c9
movl $0x9, %edx
callq 0x2150
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
callq 0x51fc
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x5f7e(%rip), %rdi      # 0x8fd0
callq 0x2150
movq %rax, %r15
leaq 0x3010(%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 0x30ae
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x5f1b(%rip), %rdi      # 0x8fd0
leaq 0x3017(%rip), %rsi      # 0x60d3
movl $0x26, %edx
callq 0x2150
leaq -0xc8(%rbp), %rdi
movl $0x20, %esi
callq 0x55b1
leaq -0xc8(%rbp), %rsi
movq %r14, %rdi
callq 0x523c
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3105
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x5ec4(%rip), %rdi      # 0x8fd0
leaq 0x2fb6(%rip), %rsi      # 0x60c9
movl $0x9, %edx
callq 0x2150
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x51fc
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x5e98(%rip), %rdi      # 0x8fd0
callq 0x2150
movq %rax, %r15
leaq 0x2f2a(%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 0x3190
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x5e39(%rip), %rdi      # 0x8fd0
leaq 0x2f5c(%rip), %rsi      # 0x60fa
movl $0x17, %edx
callq 0x2150
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
callq 0x51fc
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x5e0d(%rip), %rdi      # 0x8fd0
callq 0x2150
leaq 0x2f43(%rip), %rsi      # 0x6112
movl $0x25, %edx
movq %rax, %rdi
callq 0x2150
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x31f1
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
xorl %edi, %edi
movl $0x1, %esi
callq 0x53cd
xorl %esi, %esi
testl %eax, %eax
setne %sil
movq %rbx, %rdi
callq 0x5246
movq 0x5dbc(%rip), %rdi      # 0x8fd0
leaq 0x2edf(%rip), %rsi      # 0x60fa
movl $0x17, %edx
callq 0x2150
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x51fc
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x5d90(%rip), %rdi      # 0x8fd0
callq 0x2150
leaq 0x2ec6(%rip), %rsi      # 0x6112
movl $0x25, %edx
movq %rax, %rdi
callq 0x2150
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x326e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
xorl %edi, %edi
movl $0x1, %esi
callq 0x53cd
xorl %esi, %esi
testl %eax, %eax
setne %sil
movq %r14, %rdi
callq 0x5246
movq %rbx, %rdi
callq 0x5228
movl %eax, %r15d
testb %al, %al
je 0x329f
leaq 0x28(%rbx), %rsi
jmp 0x3317
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
callq 0x51fc
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x5d16(%rip), %rdi      # 0x8fd0
callq 0x2150
movq %rax, %r12
leaq 0x2e6f(%rip), %rsi      # 0x6138
movl $0x2a, %edx
movq %rax, %rdi
callq 0x2150
leaq 0x2e36(%rip), %rsi      # 0x6113
movl $0x24, %edx
movq %r12, %rdi
callq 0x2150
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x32ff
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
xorl %edi, %edi
movl $0x1, %esi
callq 0x53cd
leaq 0x28(%rbx), %rsi
testl %eax, %eax
je 0x34c7
xorb $0x1, %r15b
movzbl %r15b, %edx
callq 0x3a4a
movq %r14, %rdi
callq 0x5228
testb %al, %al
jne 0x33a5
movq %rbx, %rdi
callq 0x5228
testb %al, %al
jne 0x33a5
leaq -0xa8(%rbp), %rdi
movq %rbx, %rsi
callq 0x51fc
leaq -0x88(%rbp), %rdi
movq %r14, %rsi
callq 0x51fc
leaq -0xa8(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x3908
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3386
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x33a5
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2140
movq %r14, %rdi
callq 0x5228
movl %eax, %r15d
testb %al, %al
je 0x33bd
leaq 0xd0(%rbx), %rsi
jmp 0x3438
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x51fc
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x5bf8(%rip), %rdi      # 0x8fd0
callq 0x2150
movq %rax, %r12
leaq 0x2d51(%rip), %rsi      # 0x6138
movl $0x2a, %edx
movq %rax, %rdi
callq 0x2150
leaq 0x2d18(%rip), %rsi      # 0x6113
movl $0x24, %edx
movq %r12, %rdi
callq 0x2150
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x341d
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
xorl %edi, %edi
movl $0x1, %esi
callq 0x53cd
leaq 0xd0(%rbx), %rsi
testl %eax, %eax
je 0x34d4
xorb $0x1, %r15b
movzbl %r15b, %edx
callq 0x3a4a
movq %r14, %rdi
callq 0x5228
testb %al, %al
jne 0x349c
movq %rbx, %rdi
callq 0x5228
testb %al, %al
jne 0x349c
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
movl $0x64, %esi
movl $0xa, %edx
callq 0x2160
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x5b4e(%rip), %rdi      # 0x8fd0
callq 0x2150
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x349c
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x34b5
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 0x3b14
jmp 0x3324
movq %rbx, %rdi
callq 0x3b14
jmp 0x3445
jmp 0x3575
jmp 0x35a1
movq %rax, %rbx
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x350c
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
jmp 0x350c
movq %rax, %rbx
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35a4
movq -0x98(%rbp), %rsi
jmp 0x3597
jmp 0x35a1
jmp 0x35a1
jmp 0x35a1
jmp 0x35a1
jmp 0x35a1
movq %rax, %rbx
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35a4
movq -0xb8(%rbp), %rsi
jmp 0x3597
jmp 0x35a1
movq %rax, %rbx
leaq -0xd8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35a4
movq -0xd8(%rbp), %rsi
jmp 0x3597
jmp 0x3575
jmp 0x3575
jmp 0x3575
jmp 0x3575
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
jne 0x3593
jmp 0x35a4
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35a4
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
jmp 0x35a4
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x35bd
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21f0
nop