// File: whitefusion[P]Jaipur_cardgame-/Player.cpp
// Function: Player::newPlayer(Deck&)
void Player::newPlayer(Deck &deck){
    for(int i = 0; i < 2; ++i){
        hand.at(i).clear(); 
        size[i] = 0;
    }
    hand.clear();

    GTokenNum = BTokenNum = 0;

    // initialize all points to zero
    for (int i = 0; i < 3; ++i)
        point[i] = 0;

    Card tmpC;
    size[0] = size[1] = 0;

    vector<Card> cards;
    vector<Card> herds;

    // draw five cards from deck, if card == CAMEL put it in herds 
    for (int i = 0; i < 5; ++i){
        tmpC = deck.drawCard();
        if (tmpC.getCard() == "CAMEL"){
            herds.push_back(tmpC);
            size[1]++;
        }
        else{
            cards.push_back(tmpC);
            size[0]++;
        }
    }

    hand.push_back(cards);
    hand.push_back(herds);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x2, -0x14(%rbp)
jge 0x14475
movq -0xc8(%rbp), %rdi
addq $0x8, %rdi
movslq -0x14(%rbp), %rsi
callq 0x15e70
movq %rax, %rdi
callq 0x11740
movq -0xc8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, 0x40(%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x14435
movq -0xc8(%rbp), %rdi
addq $0x8, %rdi
callq 0x15eb0
movq -0xc8(%rbp), %rax
movl $0x0, 0x5c(%rax)
movl $0x0, 0x58(%rax)
movl $0x0, -0x18(%rbp)
cmpl $0x3, -0x18(%rbp)
jge 0x144c5
movq -0xc8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl $0x0, 0x48(%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x144a1
leaq -0x38(%rbp), %rdi
callq 0x12c90
movq -0xc8(%rbp), %rax
movl $0x0, 0x44(%rax)
movl $0x0, 0x40(%rax)
leaq -0x50(%rbp), %rdi
callq 0x11650
leaq -0x68(%rbp), %rdi
callq 0x11650
movl $0x0, -0x6c(%rbp)
cmpl $0x5, -0x6c(%rbp)
jge 0x14625
movq -0x10(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x11580
jmp 0x14518
leaq -0x38(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x11b10
jmp 0x1452a
leaq -0x90(%rbp), %rdi
callq 0x12d40
leaq -0xc0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x12d60
jmp 0x14548
leaq 0x9c34(%rip), %rsi      # 0x1e183
leaq -0xc0(%rbp), %rdi
callq 0x13920
movb %al, -0xc9(%rbp)
jmp 0x14563
leaq -0xc0(%rbp), %rdi
callq 0x2130
movb -0xc9(%rbp), %al
testb $0x1, %al
jne 0x1457b
jmp 0x145f6
leaq -0x68(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x11670
jmp 0x1458a
movq -0xc8(%rbp), %rax
movl 0x44(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x44(%rax)
jmp 0x14615
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x14675
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x12d40
jmp 0x14675
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x2130
jmp 0x14675
leaq -0x50(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x11670
jmp 0x14605
movq -0xc8(%rbp), %rax
movl 0x40(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x40(%rax)
jmp 0x14617
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x144fc
movq -0xc8(%rbp), %rdi
addq $0x8, %rdi
leaq -0x50(%rbp), %rsi
callq 0x15da0
jmp 0x1463b
movq -0xc8(%rbp), %rdi
addq $0x8, %rdi
leaq -0x68(%rbp), %rsi
callq 0x15da0
jmp 0x14651
leaq -0x68(%rbp), %rdi
callq 0x116e0
leaq -0x50(%rbp), %rdi
callq 0x116e0
leaq -0x38(%rbp), %rdi
callq 0x12d40
addq $0xd0, %rsp
popq %rbp
retq
leaq -0x68(%rbp), %rdi
callq 0x116e0
leaq -0x50(%rbp), %rdi
callq 0x116e0
leaq -0x38(%rbp), %rdi
callq 0x12d40
movq -0x98(%rbp), %rdi
callq 0x2360
nopl (%rax)