// File: /workspace/github_cpp_makefile_star2_O2/whitefusion[P]Jaipur_cardgame-/Game.cpp
// Function: Game::play_a_round()
void Game::play_a_round(){
    int curr = getCurrPlayer();
    int next;
    if (curr == 1)
        next = 2;
    else 
        next = 1;

    while(!RoundTermination()){
        display(getPlayer(curr));
        play_a_turn(getPlayer(curr));
        int temp = curr;
        curr = next;
        next = temp;
        if(curr == 1){
            int currTurn = getTurn();
            setTurn(++currTurn);
        }
    }

    cout << endl;
    cout << "Points before assiging CAMEL token: " << "player " << getPlayer(1).getName() << "---" <<  p1.getPoints(2);
    cout << "; " << "player " << getPlayer(2).getName() << "---" << p2.getPoints(2) << endl;

    cout << "CAMEL numbers: " << "player " << getPlayer(1).getName() << "---" << p1.getSize(1);
    cout << "; " << "player " << getPlayer(2).getName() << "---" << p2.getSize(1) << endl;



    //winning  camel token
    if (p1.getSize(1) > p2.getSize(1)){
        p1.addPoint(0,5);
        p1.addPoint(2,5);
    }
    else{
        p2.addPoint(0,5);
        p2.addPoint(2,5);
    }

    cout << "Points after assiging CAMEL token: " << "player " << getPlayer(1).getName() << "---" <<  p1.getPoints(2);
    cout << "; " << "player " << getPlayer(2).getName() << "---" << p2.getPoints(2) << endl;

    cout << "Bonus token #: " << "player " << getPlayer(1).getName() << "---" <<  p1.getBToken();
    cout << "; " << "player " << getPlayer(2).getName() << "---" << p2.getBToken() << endl;

    cout << "Goods token #: " << "player " << getPlayer(1).getName() << "---" <<  p1.getGToken();
    cout << "; " << "player " << getPlayer(2).getName() << "---" << p2.getGToken() << endl;

    //cout << "Winner is: " << getPlayer(roundWinner()).getName() << endl; 

    // winning seal
    if (roundWinner() == 1)
        p1.addPoint(3,1);
    else 
        p2.addPoint(3,1);

    setCurrPlayer(roundWinner());

    int currRound = getRound();
    setRound(++currRound);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl 0x88(%rdi), %ebp
xorl %eax, %eax
cmpl $0x1, %ebp
sete %al
incl %eax
movl %ebp, %r14d
movl %eax, %ebp
movq %rbx, %rdi
callq 0xadb4
testb %al, %al
jne 0xa876
xorl %r15d, %r15d
cmpl $0x1, %r14d
setne %r15b
movq 0x10(%rbx,%r15,8), %rsi
movq %rbx, %rdi
callq 0xae42
movq 0x10(%rbx,%r15,8), %rsi
movq %rbx, %rdi
callq 0xaed8
movl %r14d, %eax
cmpl $0x1, %ebp
jne 0xa82d
incl 0x84(%rbx)
movl %r14d, %eax
jmp 0xa82d
movq 0xa753(%rip), %r14      # 0x14fd0
movq %r14, %rdi
callq 0x20f0
leaq 0x310c(%rip), %rsi      # 0xd998
movq %r14, %rdi
callq 0x21b0
leaq 0x3122(%rip), %rsi      # 0xd9bd
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq 0x10(%rbx), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x8b0e
movq %r14, %rdi
movq %r15, %rsi
callq 0x2180
leaq 0x30fc(%rip), %rsi      # 0xd9c5
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
leaq 0x10(%rbx), %r12
movq (%r12), %rdi
pushq $0x2
popq %rsi
callq 0x8c9c
movq %r14, %rdi
movl %eax, %esi
callq 0x2290
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq 0xa6d1(%rip), %rdi      # 0x14fd0
leaq 0x30c3(%rip), %rsi      # 0xd9c9
callq 0x21b0
leaq 0x30ab(%rip), %rsi      # 0xd9bd
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq 0x18(%rbx), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x8b0e
movq %r14, %rdi
movq %r15, %rsi
callq 0x2180
leaq 0x3085(%rip), %rsi      # 0xd9c5
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
leaq 0x18(%rbx), %r13
movq (%r13), %rdi
pushq $0x2
popq %rsi
callq 0x8c9c
movq %r14, %rdi
movl %eax, %esi
callq 0x2290
movq %rax, %rdi
callq 0x20f0
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq 0xa652(%rip), %rdi      # 0x14fd0
leaq 0x3047(%rip), %rsi      # 0xd9cc
callq 0x21b0
leaq 0x302c(%rip), %rsi      # 0xd9bd
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq (%r12), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x8b0e
movq %r14, %rdi
movq %r15, %rsi
callq 0x2180
leaq 0x3006(%rip), %rsi      # 0xd9c5
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq (%r12), %rdi
pushq $0x1
popq %rsi
callq 0x8b20
movq %r14, %rdi
movl %eax, %esi
callq 0x2290
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq 0xa5df(%rip), %rdi      # 0x14fd0
leaq 0x2fd1(%rip), %rsi      # 0xd9c9
callq 0x21b0
leaq 0x2fb9(%rip), %rsi      # 0xd9bd
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq (%r13), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x8b0e
movq %r14, %rdi
movq %r15, %rsi
callq 0x2180
leaq 0x2f93(%rip), %rsi      # 0xd9c5
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq (%r13), %rdi
pushq $0x1
popq %rsi
callq 0x8b20
movq %r14, %rdi
movl %eax, %esi
callq 0x2290
movq %rax, %rdi
callq 0x20f0
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq (%r12), %rdi
pushq $0x1
popq %rbp
movl %ebp, %esi
callq 0x8b20
movl %eax, %r14d
movq (%r13), %rdi
movl %ebp, %esi
callq 0x8b20
cmpl %eax, %r14d
movq %r13, %r14
cmovgq %r12, %r14
movq (%r14), %rdi
pushq $0x5
popq %rbp
xorl %esi, %esi
movl %ebp, %edx
callq 0x8afc
movq (%r14), %rdi
pushq $0x2
popq %rsi
movl %ebp, %edx
callq 0x8afc
movq 0xa522(%rip), %rdi      # 0x14fd0
leaq 0x2f27(%rip), %rsi      # 0xd9dc
callq 0x21b0
leaq 0x2efc(%rip), %rsi      # 0xd9bd
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq (%r12), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x8b0e
movq %r14, %rdi
movq %r15, %rsi
callq 0x2180
leaq 0x2ed6(%rip), %rsi      # 0xd9c5
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq (%r12), %rdi
pushq $0x2
popq %rsi
callq 0x8c9c
movq %r14, %rdi
movl %eax, %esi
callq 0x2290
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq 0xa4af(%rip), %rdi      # 0x14fd0
leaq 0x2ea1(%rip), %rsi      # 0xd9c9
callq 0x21b0
leaq 0x2e89(%rip), %rsi      # 0xd9bd
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq (%r13), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x8b0e
movq %r14, %rdi
movq %r15, %rsi
callq 0x2180
leaq 0x2e63(%rip), %rsi      # 0xd9c5
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq (%r13), %rdi
pushq $0x2
popq %rsi
callq 0x8c9c
movq %r14, %rdi
movl %eax, %esi
callq 0x2290
movq %rax, %rdi
callq 0x20f0
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq 0xa434(%rip), %rdi      # 0x14fd0
leaq 0x2e5d(%rip), %rsi      # 0xda00
callq 0x21b0
leaq 0x2e0e(%rip), %rsi      # 0xd9bd
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq (%r12), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x8b0e
movq %r14, %rdi
movq %r15, %rsi
callq 0x2180
leaq 0x2de8(%rip), %rsi      # 0xd9c5
movq %rax, %rdi
callq 0x21b0
movq (%r12), %rcx
movl 0x5c(%rcx), %esi
movq %rax, %rdi
callq 0x2290
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq 0xa3cb(%rip), %rdi      # 0x14fd0
leaq 0x2dbd(%rip), %rsi      # 0xd9c9
callq 0x21b0
leaq 0x2da5(%rip), %rsi      # 0xd9bd
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq (%r13), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x8b0e
movq %r14, %rdi
movq %r15, %rsi
callq 0x2180
leaq 0x2d7f(%rip), %rsi      # 0xd9c5
movq %rax, %rdi
callq 0x21b0
movq (%r13), %rcx
movl 0x5c(%rcx), %esi
movq %rax, %rdi
callq 0x2290
movq %rax, %rdi
callq 0x20f0
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq 0xa35a(%rip), %rdi      # 0x14fd0
leaq 0x2d93(%rip), %rsi      # 0xda10
callq 0x21b0
leaq 0x2d34(%rip), %rsi      # 0xd9bd
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq (%r12), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x8b0e
movq %r14, %rdi
movq %r15, %rsi
callq 0x2180
leaq 0x2d0e(%rip), %rsi      # 0xd9c5
movq %rax, %rdi
callq 0x21b0
movq (%r12), %rcx
movl 0x58(%rcx), %esi
movq %rax, %rdi
callq 0x2290
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq 0xa2f1(%rip), %rdi      # 0x14fd0
leaq 0x2ce3(%rip), %rsi      # 0xd9c9
callq 0x21b0
leaq 0x2ccb(%rip), %rsi      # 0xd9bd
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq (%r13), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x8b0e
movq %r14, %rdi
movq %r15, %rsi
callq 0x2180
leaq 0x2ca5(%rip), %rsi      # 0xd9c5
movq %rax, %rdi
callq 0x21b0
movq (%r13), %rcx
movl 0x58(%rcx), %esi
movq %rax, %rdi
callq 0x2290
movq %rax, %rdi
callq 0x20f0
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0xb0b2
xorl %ecx, %ecx
cmpl $0x1, %eax
setne %cl
movq 0x10(%rbx,%rcx,8), %rdi
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
callq 0x8afc
movq %rbx, %rdi
callq 0xb0b2
movl %eax, 0x88(%rbx)
incl 0x80(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xad9e
jmp 0xad9e
jmp 0xad9e
jmp 0xad9e
jmp 0xad9e
jmp 0xad9e
jmp 0xad9e
jmp 0xad9e
jmp 0xad9e
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x22a0
nop