// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0xc0, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movq %rax, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movq 0x8(%rdi), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
decl %eax
cmpl $0x3, %eax
ja 0xd5fe
leaq 0x3524(%rip), %rcx      # 0x10980
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%r14), %rsi
movq %r14, %rdi
callq 0xd74c
movq (%r14), %rcx
movq 0x8(%r14), %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0xac1c
jmp 0xd5fe
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xdfc4
movaps 0x80(%rsp), %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
movq 0x90(%rsp), %rax
movq %rax, 0x10(%rsi)
leaq 0x38(%rsp), %rdi
callq 0x65f6
leaq 0x20(%r14), %rdx
addq $0x58, %r14
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rcx
callq 0xa924
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xd5fe
leaq 0x48(%rsp), %rax
jmp 0xd5f3
movq (%r14), %rdx
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0xb056
jmp 0xd5fe
movq 0x8(%r14), %rcx
leaq 0xa0(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd9a6
movq 0x10(%rsp), %rax
leaq 0xa0(%rsp), %r15
movaps (%r15), %xmm0
movq 0x10(%r15), %rcx
movq %rcx, 0x10(%rsp)
movaps (%rsp), %xmm1
movaps %xmm0, (%rsp)
leaq 0x80(%rsp), %rdi
movaps %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
movq $0x0, 0x10(%r15)
callq 0x5f9c
movq %r15, %rdi
callq 0x5f9c
movq (%rsp), %rsi
cmpq %rsi, 0x8(%rsp)
je 0xd62a
leaq 0x68(%rsp), %rdi
callq 0x65f6
movq (%rsp), %rsi
movq 0x8(%rsp), %rax
subq %rsi, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rdx
cmpq $0x1, %rdx
jbe 0xd63c
addq $0x18, %rsi
leaq 0x50(%rsp), %rdi
callq 0x65f6
movq 0x8(%r14), %rcx
leaq 0x68(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movq %rbx, %rdi
callq 0xace0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xd5e4
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0xd5fe
leaq 0x78(%rsp), %rax
movq (%rax), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xd615
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %rsp, %rdi
callq 0x5f9c
addq $0xc0, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2d27(%rip), %rdi      # 0x10358
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x21f0
leaq 0x2d15(%rip), %rdi      # 0x10358
movl $0x1, %esi
xorl %eax, %eax
callq 0x21f0
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xd686
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0xd686
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xd6a2
movq 0x48(%rsp), %rsi
jmp 0xd695
jmp 0xd69f
jmp 0xd69f
movq %rax, %rbx
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0xd6a2
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0xd6a2
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xd6b9
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %rsp, %rdi
callq 0x5f9c
movq %rbx, %rdi
callq 0x2280
nop