// File: fredericmarchand[P]TexasHoldem/Game.cpp
// Function: Game::setupAIGame(Player*)
void Game::setupAIGame(Player *player)
{
    shuffleDeck(0);
    Card *c1 = getCard(player->getHand()[0]);
    Card *c2 = getCard(player->getHand()[1]);
    if (player == players[0])
    {
        swap(&c1, &deck[0]);
        swap(&c2, &deck[2]);
    }
    else if (player == players[1])
    {
        swap(&c1, &deck[1]);
        swap(&c2, &deck[3]);
    }
    distributeCards();

    if (flop[0] == NULL || flop[1] == NULL || flop[2] == NULL)
    {
        flipFlop(false);
    }
    else
    {
        swap(&flop[0], &deck[5]);
        swap(&flop[1], &deck[6]);
        swap(&flop[2], &deck[7]);
        deckPointer+=4;
    }
    if (turn == NULL)
    {
        flipTurn(false);
    }
    else
    {
        swap(&turn, &deck[9]);
        deckPointer+=2;
    }
    if (river == NULL)
    {
        flipRiver(false);
    }
    else
    {
        swap(&river, &deck[11]);
        deckPointer+=2;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
xorl %esi, %esi
callq 0x5540
movq -0x10(%rbp), %rdi
callq 0x3270
movq -0x28(%rbp), %rdi
movq (%rax), %rsi
callq 0x4a20
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3270
movq -0x28(%rbp), %rdi
movq 0x8(%rax), %rsi
callq 0x4a20
movq -0x28(%rbp), %rcx
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rcx), %rcx
cmpq (%rcx), %rax
jne 0x64e0
movq -0x28(%rbp), %rdi
movq %rdi, %rdx
addq $0x40, %rdx
leaq -0x18(%rbp), %rsi
callq 0x5500
movq -0x28(%rbp), %rdi
movq %rdi, %rdx
addq $0x40, %rdx
addq $0x10, %rdx
leaq -0x20(%rbp), %rsi
callq 0x5500
jmp 0x6523
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rcx), %rcx
cmpq 0x8(%rcx), %rax
jne 0x6521
movq -0x28(%rbp), %rdi
movq %rdi, %rdx
addq $0x40, %rdx
addq $0x8, %rdx
leaq -0x18(%rbp), %rsi
callq 0x5500
movq -0x28(%rbp), %rdi
movq %rdi, %rdx
addq $0x40, %rdx
addq $0x18, %rdx
leaq -0x20(%rbp), %rsi
callq 0x5500
jmp 0x6523
movq -0x28(%rbp), %rdi
callq 0x5480
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x654d
movq -0x28(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x654d
movq -0x28(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x655a
movq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x5060
jmp 0x65c0
movq -0x28(%rbp), %rdi
movq %rdi, %rsi
addq $0x10, %rsi
movq %rdi, %rdx
addq $0x40, %rdx
addq $0x28, %rdx
callq 0x5500
movq -0x28(%rbp), %rdi
movq %rdi, %rsi
addq $0x10, %rsi
addq $0x8, %rsi
movq %rdi, %rdx
addq $0x40, %rdx
addq $0x30, %rdx
callq 0x5500
movq -0x28(%rbp), %rdi
movq %rdi, %rsi
addq $0x10, %rsi
addq $0x10, %rsi
movq %rdi, %rdx
addq $0x40, %rdx
addq $0x38, %rdx
callq 0x5500
movq -0x28(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x4, %ecx
movl %ecx, 0x38(%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x65d8
movq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x53e0
jmp 0x6600
movq -0x28(%rbp), %rdi
movq %rdi, %rsi
addq $0x28, %rsi
movq %rdi, %rdx
addq $0x40, %rdx
addq $0x48, %rdx
callq 0x5500
movq -0x28(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x2, %ecx
movl %ecx, 0x38(%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x6618
movq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x5430
jmp 0x6640
movq -0x28(%rbp), %rdi
movq %rdi, %rsi
addq $0x30, %rsi
movq %rdi, %rdx
addq $0x40, %rdx
addq $0x58, %rdx
callq 0x5500
movq -0x28(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x2, %ecx
movl %ecx, 0x38(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)