// File: /workspace/github_cpp_makefile_star2_O1/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 0x61cc
movq %r12, %rdi
callq 0x6530
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x38e4
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x59a6
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq 0x72b4(%rip), %rdi      # 0xafd0
callq 0x2190
movq %rax, %r13
leaq 0x351c(%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 0x3d7b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
movq %rbx, %rdi
callq 0x59d4
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x59a6
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq 0x722e(%rip), %rdi      # 0xafd0
callq 0x2190
movq %rax, %r13
leaq 0x3496(%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 0x3dfd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
movq %r14, %rdi
callq 0x59d4
movq %r14, %rdi
callq 0x5d88
movl %eax, 0x10(%r15)
movq %r14, %rdi
movq %r12, %rsi
callq 0x5c80
movq %rbx, %rdi
callq 0x59fc
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x39d0
movq 0x7197(%rip), %r12      # 0xafd0
leaq 0x3414(%rip), %rsi      # 0x7254
movl $0x7, %edx
movq %r12, %rdi
callq 0x2190
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x59a6
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %r12, %rdi
callq 0x2190
movq %rax, %r12
leaq 0x33e5(%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 0x3ea7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
movq 0x7122(%rip), %r12      # 0xafd0
leaq 0x33af(%rip), %rsi      # 0x7264
movl $0x3, %edx
movq %r12, %rdi
callq 0x2190
movq %r14, %rdi
callq 0x5ebe
movq %r12, %rdi
movl %eax, %esi
callq 0x2220
movq %rax, %r13
leaq 0x32de(%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 0x333a(%rip), %rsi      # 0x7254
movl $0x7, %edx
movq %r12, %rdi
callq 0x2190
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x59a6
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %r12, %rdi
callq 0x2190
movq %rax, %r13
leaq 0x330b(%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 0x3fab
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
leaq 0x32b6(%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 0x5a08
movq %rbx, %rdi
callq 0x5a08
movq 0x6fe2(%rip), %rdi      # 0xafe0
callq 0x21a0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4029
jmp 0x4029
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x4036
jmp 0x4043
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x4043
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
movq %rbx, %rdi
callq 0x2230
nop