// File: /workspace/github_cpp_makefile_star2_O1/moloch--[P]cli-Blackjack/./Blackjack/Player.cpp
// Function: Player::hit(Card)
void Player::hit(Card card)
{
	if (card.getRank() == "A" && (hand.getScore() + 11) > 21)
	{
		card.setValue(1);
	}
	else if (card.getRank() == "A")
	{
		card.setValue(11);
	}
	hand.putInHand(card);
	if(isBust()) // Look for aces if player went bust from new card
	{
		for (unsigned int index = 0; index < hand.getSize(); ++index)
		{
			if (hand.getCardRank(index) == "A" && hand.getCardValue(index) == 11)
			{
				hand.setCardValue(index, 1); // Change ace's value to 1
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x464a
leaq 0x18a1(%rip), %rsi      # 0x72f1
movq %r15, %rdi
callq 0x2060
testl %eax, %eax
je 0x5a79
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5aa9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
jmp 0x5aa9
leaq 0x60(%rbx), %rdi
callq 0x47e8
movl %eax, %ebp
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5a9f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
movl $0x1, %esi
cmpl $0xa, %ebp
jg 0x5aed
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x464a
leaq 0x1831(%rip), %rsi      # 0x72f1
movq %r15, %rdi
callq 0x2060
movl %eax, %ebp
movq (%r15), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x5ae4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
testl %ebp, %ebp
jne 0x5af5
movl $0xb, %esi
movq %r14, %rdi
callq 0x43ec
leaq 0x51b4(%rip), %rax      # 0xacb0
addq $0x10, %rax
leaq 0x38(%rsp), %rdi
movq %rax, -0x10(%rdi)
movl 0x8(%r14), %eax
movl %eax, -0x8(%rdi)
movb 0xc(%r14), %al
movb %al, -0x4(%rdi)
leaq 0x48(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
addq %rsi, %rdx
callq 0x33f8
leaq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x30(%r14), %rsi
movq 0x38(%r14), %rdx
addq %rsi, %rdx
callq 0x33f8
addq $0x60, %rbx
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x48c4
leaq 0x28(%rsp), %rdi
callq 0x4544
movq %rbx, %rdi
callq 0x47e8
cmpl $0x16, %eax
jl 0x5c19
movq %rbx, %rdi
callq 0x4862
testl %eax, %eax
je 0x5c19
leaq 0x18(%rsp), %r13
xorl %ebp, %ebp
leaq 0x8(%rsp), %r14
leaq 0x1754(%rip), %r15      # 0x72f1
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x48a4
movq %r14, %rdi
movq %r15, %rsi
callq 0x2060
testl %eax, %eax
je 0x5bd2
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x5c0b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
jmp 0x5c0b
movq %rbx, %rdi
movl %ebp, %esi
callq 0x4876
movl %eax, %r12d
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x5bf6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
cmpl $0xb, %r12d
jne 0x5c0b
movq %rbx, %rdi
movl %ebp, %esi
movl $0x1, %edx
callq 0x488c
incl %ebp
movq %rbx, %rdi
callq 0x4862
cmpl %eax, %ebp
jb 0x5b9d
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x5c6b
jmp 0x5c78
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4544
jmp 0x5c78
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r15, %rdi
je 0x5c78
movq 0x48(%rsp), %rsi
jmp 0x5c70
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x5c78
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
movq %rbx, %rdi
callq 0x2230