// File: whitefusion[P]Jaipur_cardgame-/Game.cpp
// Function: Game::play_a_turn(Player&)
void Game::play_a_turn(Player &p){
    int act;
    int take;
    vector<vector<int> > trade;
    vector<int> sell;

    act = p.setAction(market);

    // verify the input and carry out action
    switch (act){
        // take
        case 1:
        {
            take = takeInputVerify(market);
            p.Take(take, market, deck);
            break;
        }
        // trade
        case 2:
        {
            trade = tradeInputVerify(p,market);
            p.Trade(trade.at(0), trade.at(1), market);
            break;
        }
        //sell
        case 3:
        {
            sell = sellInputVerify(p);
            p.Sell(sell, tokens, bonus);
            break;
        }
        //take camels
        case 4:
        {
            p.TakeCamel(market, deck); 
            break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x1bc70
leaq -0x48(%rbp), %rdi
callq 0x15ff0
movq -0xe0(%rbp), %rax
movq -0x10(%rbp), %rdi
movq 0x8(%rax), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movl %eax, -0xd4(%rbp)
jmp 0x1a1df
movl -0xd4(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0xe8(%rbp)
subl $0x3, %eax
ja 0x1a457
movq -0xe8(%rbp), %rax
leaq 0x476b(%rip), %rcx      # 0x1e978
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1a472
movq -0xe0(%rbp), %rdi
movq 0x8(%rdi), %rsi
callq 0x1a5c0
movl %eax, -0xec(%rbp)
jmp 0x1a23f
movq -0xe0(%rbp), %rax
movl -0xec(%rbp), %ecx
movl %ecx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
movq (%rax), %rcx
movq 0x8(%rax), %rdx
callq 0x14e10
jmp 0x1a264
jmp 0x1a457
movq -0xe0(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq 0x8(%rsi), %rcx
leaq -0x70(%rbp), %rdi
callq 0x1a7b0
jmp 0x1a283
leaq -0x30(%rbp), %rdi
movq %rdi, -0x108(%rbp)
leaq -0x70(%rbp), %rsi
movq %rsi, -0x110(%rbp)
callq 0x1bc90
movq -0x110(%rbp), %rdi
callq 0x9980
movq -0x108(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x100(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x9b00
movq %rax, -0xf8(%rbp)
jmp 0x1a2ce
movq -0xf8(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0xc0e0
jmp 0x1a2e3
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x9b00
movq %rax, -0x118(%rbp)
jmp 0x1a2fa
movq -0x118(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0xc0e0
jmp 0x1a30f
movq -0x100(%rbp), %rdi
movq -0xe0(%rbp), %rax
movq 0x8(%rax), %rcx
leaq -0x88(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x14ed0
jmp 0x1a336
leaq -0xa0(%rbp), %rdi
callq 0x9900
leaq -0x88(%rbp), %rdi
callq 0x9900
jmp 0x1a457
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1a379
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x9900
leaq -0x88(%rbp), %rdi
callq 0x9900
jmp 0x1a472
movq -0xe0(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0xb8(%rbp), %rdi
callq 0x1ada0
jmp 0x1a3a3
leaq -0x48(%rbp), %rdi
movq %rdi, -0x128(%rbp)
leaq -0xb8(%rbp), %rsi
movq %rsi, -0x130(%rbp)
callq 0x1bcc0
movq -0x130(%rbp), %rdi
callq 0x9900
movq -0x128(%rbp), %rsi
movq -0x10(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0xc0e0
jmp 0x1a3ed
movq -0x120(%rbp), %rdi
movq -0xe0(%rbp), %rcx
movq %rcx, %rdx
addq $0x20, %rdx
addq $0x58, %rcx
leaq -0xd0(%rbp), %rsi
callq 0x14a60
jmp 0x1a414
leaq -0xd0(%rbp), %rdi
callq 0x9900
jmp 0x1a457
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x9900
jmp 0x1a472
movq -0xe0(%rbp), %rax
movq -0x10(%rbp), %rdi
movq (%rax), %rdx
movq 0x8(%rax), %rsi
callq 0x15260
jmp 0x1a455
jmp 0x1a457
leaq -0x48(%rbp), %rdi
callq 0x9900
leaq -0x30(%rbp), %rdi
callq 0x9980
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x9900
leaq -0x30(%rbp), %rdi
callq 0x9980
movq -0x50(%rbp), %rdi
callq 0x2360
nopl (%rax)