// File: /workspace/github_cpp_makefile_star2_O3/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 0x4662
leaq 0x1865(%rip), %rsi      # 0x72f1
movq %r15, %rdi
callq 0x2060
testl %eax, %eax
je 0x5ab5
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5ae5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
jmp 0x5ae5
leaq 0x60(%rbx), %rdi
callq 0x4800
movl %eax, %ebp
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5adb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
movl $0x1, %esi
cmpl $0xa, %ebp
jg 0x5b29
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x4662
leaq 0x17f5(%rip), %rsi      # 0x72f1
movq %r15, %rdi
callq 0x2060
movl %eax, %ebp
movq (%r15), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x5b20
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
testl %ebp, %ebp
jne 0x5b31
movl $0xb, %esi
movq %r14, %rdi
callq 0x4404
leaq 0x5178(%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 0x33fa
leaq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x30(%r14), %rsi
movq 0x38(%r14), %rdx
addq %rsi, %rdx
callq 0x33fa
addq $0x60, %rbx
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x48e0
leaq 0x28(%rsp), %rdi
callq 0x455c
movq %rbx, %rdi
callq 0x4800
cmpl $0x16, %eax
jl 0x5c55
movq %rbx, %rdi
callq 0x487e
testl %eax, %eax
je 0x5c55
xorl %ebp, %ebp
leaq 0x18(%rsp), %r13
leaq 0x8(%rsp), %r14
leaq 0x1718(%rip), %r15      # 0x72f1
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x48c0
movq %r14, %rdi
movq %r15, %rsi
callq 0x2060
testl %eax, %eax
je 0x5c0e
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x5c47
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
jmp 0x5c47
movq %rbx, %rdi
movl %ebp, %esi
callq 0x4892
movl %eax, %r12d
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x5c32
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
cmpl $0xb, %r12d
jne 0x5c47
movq %rbx, %rdi
movl %ebp, %esi
movl $0x1, %edx
callq 0x48a8
incl %ebp
movq %rbx, %rdi
callq 0x487e
cmpl %eax, %ebp
jb 0x5bd9
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 0x5ca7
jmp 0x5cb4
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x455c
jmp 0x5cb4
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r15, %rdi
je 0x5cb4
movq 0x48(%rsp), %rsi
jmp 0x5cac
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x5cb4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
movq %rbx, %rdi
callq 0x2230