// File: /workspace/github_cpp_makefile_star2_O3/moloch--[P]cli-Blackjack/./Blackjack/Blackjack.cpp
// Function: Blackjack::startTurn(Player&, Dealer&)
void Blackjack::startTurn(Player & player, Dealer & dealer)
{
	deck.initialize();
    deck.shuffle(); // Shuffle the deck
    initialDeal(player, dealer);
    cout << dealer.getName() << " is showing:" << endl;
    dealer.printCurrentHand();
    cout << player.getName() << " is showing:" << endl;
    player.printCurrentHand();
    wager = player.getWager();
    player.turn(deck);  // Give player a turn
    dealer.revealCard(); // Reveal dealer's card
    findWinner(player, dealer);
    cout << "\tTotal " << player.getName() << " wins: " << playerWins;
    cout << " ($" << player.getMoney() << ")" << endl;
    cout << "\tTotal " << dealer.getName() << " wins: " << dealerWins << endl;
    cout << "\nPress enter to continue." << endl;
    player.resetHand();
    dealer.resetHand();
    cin.get();   // Pause console output until next user input
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x18(%rdi), %r12
movq %r12, %rdi
callq 0x6204
movq %r12, %rdi
callq 0x6568
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x38fc
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x59e2
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq 0x729c(%rip), %rdi      # 0xafd0
callq 0x2190
movq %rax, %r13
leaq 0x3504(%rip), %rsi      # 0x7247
movl $0xc, %edx
movq %rax, %rdi
callq 0x2190
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x18(%rsp), %rbp
movq -0x10(%rbp), %rdi
cmpq %rbp, %rdi
je 0x3d93
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
movq %rbx, %rdi
callq 0x5a10
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x59e2
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq 0x7216(%rip), %rdi      # 0xafd0
callq 0x2190
movq %rax, %r13
leaq 0x347e(%rip), %rsi      # 0x7247
movl $0xc, %edx
movq %rax, %rdi
callq 0x2190
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3e15
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
movq %r14, %rdi
callq 0x5a10
movq %r14, %rdi
callq 0x5dc2
movl %eax, 0x10(%r15)
movq %r14, %rdi
movq %r12, %rsi
callq 0x5cbc
movq %rbx, %rdi
callq 0x5a38
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x39e8
movq 0x717f(%rip), %r12      # 0xafd0
leaq 0x33fc(%rip), %rsi      # 0x7254
movl $0x7, %edx
movq %r12, %rdi
callq 0x2190
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x59e2
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %r12, %rdi
callq 0x2190
movq %rax, %r12
leaq 0x33cd(%rip), %rsi      # 0x725c
movl $0x7, %edx
movq %rax, %rdi
callq 0x2190
movl 0xc(%r15), %esi
movq %r12, %rdi
callq 0x2220
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3ebf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
movq 0x710a(%rip), %r12      # 0xafd0
leaq 0x3397(%rip), %rsi      # 0x7264
movl $0x3, %edx
movq %r12, %rdi
callq 0x2190
movq %r14, %rdi
callq 0x5ef8
movq %r12, %rdi
movl %eax, %esi
callq 0x2220
movq %rax, %r13
leaq 0x32c6(%rip), %rsi      # 0x71bc
movl $0x1, %edx
movq %rax, %rdi
callq 0x2190
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x3322(%rip), %rsi      # 0x7254
movl $0x7, %edx
movq %r12, %rdi
callq 0x2190
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x59e2
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %r12, %rdi
callq 0x2190
movq %rax, %r13
leaq 0x32f3(%rip), %rsi      # 0x725c
movl $0x7, %edx
movq %rax, %rdi
callq 0x2190
movl 0x8(%r15), %esi
movq %r13, %rdi
callq 0x2220
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3fc3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
leaq 0x329e(%rip), %rsi      # 0x7268
movl $0x19, %edx
movq %r12, %rdi
callq 0x2190
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq %r14, %rdi
callq 0x5a44
movq %rbx, %rdi
callq 0x5a44
movq 0x6fca(%rip), %rdi      # 0xafe0
callq 0x21a0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4041
jmp 0x4041
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x404e
jmp 0x405b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x405b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
movq %rbx, %rdi
callq 0x2230
nop