// File: moloch--[P]cli-Blackjack/./Blackjack/Deck.cpp
// Function: Deck::initialize()
void Deck::initialize()
{
	reset();
    deckCounter = 0; // Location in deck
    // Iterate through each suit, creating cards on the way
    for(unsigned int suitIndex = 0;suitIndex < suits.size();++suitIndex)
    {
        // Create number cards for the current suit
        for(int numberIndex = 2;numberIndex <= 10;++numberIndex)
        {
            Card card(suits[suitIndex], numberIndex, numberIndex);
            deckOfCards.push_back(card);
        }
        // Create face cards for the current suit
        for(unsigned int faceIndex = 0;faceIndex < faceCards.size();++faceIndex)
        {
            Card card(suits[suitIndex], 10, faceCards[faceIndex]);
            deckOfCards.push_back(card);
        }
    }
}

// Assembly:
subq $0x148, %rsp            # imm = 0x148
movq %rdi, 0x140(%rsp)
movq 0x140(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x9430
movq 0x20(%rsp), %rax
movl $0x0, 0x8(%rax)
movl $0x0, 0x13c(%rsp)
movq 0x20(%rsp), %rdi
movl 0x13c(%rsp), %eax
movq %rax, 0x18(%rsp)
addq $0x28, %rdi
callq 0x44d0
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jae 0x9725
movl $0x2, 0x138(%rsp)
cmpl $0xa, 0x138(%rsp)
jg 0x95c9
movq 0x20(%rsp), %rdi
addq $0x28, %rdi
movl 0x13c(%rsp), %eax
movl %eax, %esi
callq 0x53b0
movq %rax, %rsi
leaq 0xc8(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x20c0
movq 0x10(%rsp), %rsi
movl 0x138(%rsp), %ecx
leaq 0xe8(%rsp), %rdi
movl %ecx, %edx
callq 0x6380
jmp 0x9535
leaq 0xc8(%rsp), %rdi
callq 0x2110
movq 0x20(%rsp), %rdi
addq $0x40, %rdi
leaq 0xe8(%rsp), %rsi
callq 0x7700
jmp 0x955a
leaq 0xe8(%rsp), %rdi
callq 0x64c0
movl 0x138(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x138(%rsp)
jmp 0x94de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x2110
jmp 0x972d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x64c0
jmp 0x972d
movl $0x0, 0xb8(%rsp)
movq 0x20(%rsp), %rdi
movl 0xb8(%rsp), %eax
movq %rax, 0x8(%rsp)
addq $0x10, %rdi
callq 0x44d0
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x970d
movq 0x20(%rsp), %rdi
addq $0x28, %rdi
movl 0x13c(%rsp), %eax
movl %eax, %esi
callq 0x53b0
movq %rax, %rsi
leaq 0x48(%rsp), %rdi
callq 0x20c0
movq 0x20(%rsp), %rdi
addq $0x10, %rdi
movl 0xb8(%rsp), %eax
movl %eax, %esi
callq 0x53b0
movq %rax, %rsi
leaq 0x28(%rsp), %rdi
callq 0x20c0
jmp 0x9649
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movl $0xa, %edx
leaq 0x28(%rsp), %rcx
callq 0x61c0
jmp 0x9664
leaq 0x28(%rsp), %rdi
callq 0x2110
leaq 0x48(%rsp), %rdi
callq 0x2110
movq 0x20(%rsp), %rdi
addq $0x40, %rdi
leaq 0x68(%rsp), %rsi
callq 0x7700
jmp 0x968d
leaq 0x68(%rsp), %rdi
callq 0x64c0
movl 0xb8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb8(%rsp)
jmp 0x95d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x96e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x2110
leaq 0x48(%rsp), %rdi
callq 0x2110
jmp 0x972d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x64c0
jmp 0x972d
jmp 0x970f
movl 0x13c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x13c(%rsp)
jmp 0x94a8
addq $0x148, %rsp            # imm = 0x148
retq
movq 0xc0(%rsp), %rdi
callq 0x22f0
nopw (%rax,%rax)