// File: /workspace/github_cpp_makefile_star2_O1/cb92[P]Battleship/Game.cpp
// Function: Game::initializeBoard(Board&)
void Game::initializeBoard(Board &b)
{
	int xEntry, yEntry, horizEntry, attemptCount;
	std::string entryTemp;
	for (int i=0; i<NUM_SHIPS; i++)
	{
		attemptCount=0;
		do // check for valid placement of each ship
		{
			b.printPublicBoard();
			if (attemptCount>0) 
				std::cout<<"INVALID ENTRY for that ship! Please try again. \n";

			std::cout<<"Please enter location [Letter][Number] for the "<<
						"top/left of your "<<SHIP_NAMES[i]<<" which is length "
						<<SHIP_LENGTHS[i]<<": \n";
			entryTemp=getSquare();		
			xEntry=static_cast<int>(entryTemp[0]);
			yEntry=static_cast<int>(entryTemp[1]);

			std::cout<<"Please enter 0 if the ship is oriented vertically, "
						<<"1 if it is oriented horizontally:\n";
			horizEntry=getInt(0,1);

			attemptCount++;
		} while (!b.placeShip(i, xEntry-LETTER_CHAR_OFFSET, 
						yEntry-NUMBER_CHAR_OFFSET, horizEntry));

	}

	std::cout<<"Your starting board: \n";
	b.printPublicBoard();

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, -0x30(%rbp)
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %r14d, %r14d
movq 0x547a(%rip), %r15      # 0x8fd0
movq %r14, -0x38(%rbp)
shlq $0x5, %r14
leaq 0x568b(%rip), %rax      # 0x91f0
addq %rax, %r14
xorl %ebx, %ebx
movq -0x30(%rbp), %rdi
callq 0x4132
subl $0x1, %ebx
jb 0x3b8c
movl $0x30, %edx
movq %r15, %rdi
leaq 0x2614(%rip), %rsi      # 0x619b
callq 0x2150
movl $0x2f, %edx
movq %r15, %rdi
leaq 0x2631(%rip), %rsi      # 0x61cc
callq 0x2150
movl $0x11, %edx
movq %r15, %rdi
leaq 0x264d(%rip), %rsi      # 0x61fc
callq 0x2150
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x2150
movq %rax, %r12
movl $0x11, %edx
movq %rax, %rdi
leaq 0x2639(%rip), %rsi      # 0x620e
callq 0x2150
movq -0x38(%rbp), %rax
leaq 0x27cb(%rip), %rcx      # 0x63b0
movl (%rcx,%rax,4), %esi
movq %r12, %rdi
callq 0x21e0
movl $0x3, %edx
movq %rax, %rdi
leaq 0x257f(%rip), %rsi      # 0x617e
callq 0x2150
leaq -0x78(%rbp), %r12
movq %r12, %rdi
callq 0x3d24
leaq -0x58(%rbp), %rdi
movq %r12, %rsi
callq 0x2180
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x3c35
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x58(%rbp), %rax
movsbl (%rax), %r13d
movsbl 0x1(%rax), %r12d
movl $0x33, %edx
movq %r15, %rdi
leaq 0x25cf(%rip), %rsi      # 0x6220
callq 0x2150
movl $0x22, %edx
movq %r15, %rdi
leaq 0x25ef(%rip), %rsi      # 0x6254
callq 0x2150
xorl %edi, %edi
movl $0x1, %esi
callq 0x53dd
addl $-0x41, %r13d
addl $-0x30, %r12d
xorl %r8d, %r8d
testl %eax, %eax
setne %r8b
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl %r13d, %edx
movl %r12d, %ecx
callq 0x4386
testb %al, %al
je 0x3b6a
movq -0x38(%rbp), %r14
incq %r14
cmpq $0x5, %r14
jne 0x3b56
movq 0x5316(%rip), %rdi      # 0x8fd0
leaq 0x25b6(%rip), %rsi      # 0x6277
movl $0x16, %edx
callq 0x2150
movq -0x30(%rbp), %rdi
callq 0x4132
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x3ced
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x2140
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3d00
jmp 0x3d00
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x3d1c
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21f0