// File: /workspace/github_cpp_makefile_star2_O1/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 0xd6e8
leaq 0x3478(%rip), %rcx      # 0x10970
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%r14), %rsi
movq %r14, %rdi
callq 0xd84e
movq (%r14), %rcx
movq 0x8(%r14), %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0xac7e
jmp 0xd6e8
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xe0c6
movq 0x20(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x48(%rsp), %xmm0
movups %xmm0, 0x28(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
testq %rdi, %rdi
je 0xd56f
subq %rdi, %rsi
callq 0x21a0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xd586
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0x60(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x663a
leaq 0x20(%r14), %rdx
addq $0x58, %r14
leaq 0x60(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rcx
callq 0xa97a
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0xd6e8
leaq 0x70(%rsp), %rax
jmp 0xd6dd
movq (%r14), %rdx
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0xb0a4
jmp 0xd6e8
movq 0x8(%r14), %rcx
leaq 0xa8(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xdaa8
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps (%rsp), %xmm0
movq 0x10(%rsp), %rax
leaq 0xa8(%rsp), %r15
movups (%r15), %xmm1
movaps %xmm1, (%rsp)
movq 0x10(%r15), %rcx
movq %rcx, 0x10(%rsp)
movaps (%rdi), %xmm1
movaps %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
movups %xmm1, (%r15)
movq $0x0, 0x10(%r15)
callq 0x5fe6
movq %r15, %rdi
callq 0x5fe6
movq (%rsp), %rsi
movq 0x8(%rsp), %rax
subq %rsi, %rax
je 0xd714
leaq 0x90(%rsp), %rdi
callq 0x663a
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 0xd736
addq $0x18, %rsi
leaq 0x78(%rsp), %rdi
callq 0x663a
movq 0x8(%r14), %rcx
leaq 0x90(%rsp), %rsi
leaq 0x78(%rsp), %rdx
movq %rbx, %rdi
callq 0xad42
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0xd6c8
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xd6e8
leaq 0xa0(%rsp), %rax
movq (%rax), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xd6ff
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %rsp, %rdi
callq 0x5fe6
addq $0xc0, %rsp
popq %rbx
popq %r14
popq %r15
retq
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rdx
leaq 0x2c1b(%rip), %rdi      # 0x10348
xorl %esi, %esi
xorl %eax, %eax
callq 0x21f0
leaq 0x2c0b(%rip), %rdi      # 0x10348
movl $0x1, %esi
xorl %eax, %eax
callq 0x21f0
movq %rax, %rbx
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0xd783
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0xd783
movq %rax, %rbx
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0xd7a5
movq 0x70(%rsp), %rsi
jmp 0xd798
jmp 0xd7a2
jmp 0xd7a2
movq %rax, %rbx
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xd7a5
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0xd7a5
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xd7bc
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %rsp, %rdi
callq 0x5fe6
movq %rbx, %rdi
callq 0x2280