// File: /workspace/github_cpp_makefile_star2_O3/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), %r15d
callq 0xd2a2
testb %al, %al
jne 0xcb08
xorl %ebp, %ebp
cmpl $0x1, %r15d
sete %bpl
incl %ebp
movl %r15d, %r14d
xorl %r15d, %r15d
cmpl $0x1, %r14d
setne %r15b
movq 0x10(%rbx,%r15,8), %rsi
movq %rbx, %rdi
callq 0xd348
movq 0x10(%rbx,%r15,8), %rsi
movq %rbx, %rdi
callq 0xd414
cmpl $0x1, %ebp
jne 0xcaf6
incl 0x84(%rbx)
movq %rbx, %rdi
callq 0xd2a2
movl %ebp, %r15d
movl %r14d, %ebp
testb %al, %al
je 0xcac3
movq 0x94c1(%rip), %r14      # 0x15fd0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x3e53(%rip), %rsi      # 0x10990
movl $0x24, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3e64(%rip), %rsi      # 0x109b5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq 0x10(%rbx), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5d4
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x3e35(%rip), %rsi      # 0x109bd
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
leaq 0x10(%rbx), %r13
movq (%r13), %rdi
movl $0x2, %esi
callq 0xa8bc
movq %r14, %rdi
movl %eax, %esi
callq 0x2270
leaq 0x18(%rsp), %rbp
movq -0x10(%rbp), %rdi
cmpq %rbp, %rdi
je 0xcbcc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x93fd(%rip), %r14      # 0x15fd0
leaq 0x3de7(%rip), %rsi      # 0x109c1
movl $0x2, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3dc7(%rip), %rsi      # 0x109b5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq 0x18(%rbx), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5d4
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x3d98(%rip), %rsi      # 0x109bd
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
leaq 0x18(%rbx), %r12
movq (%r12), %rdi
movl $0x2, %esi
callq 0xa8bc
movq %r14, %rdi
movl %eax, %esi
callq 0x2270
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xcc8f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x933a(%rip), %r14      # 0x15fd0
leaq 0x3d27(%rip), %rsi      # 0x109c4
movl $0xf, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3d04(%rip), %rsi      # 0x109b5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r13), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5d4
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x3cd5(%rip), %rsi      # 0x109bd
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r13), %rdi
movl $0x1, %esi
callq 0xa5f8
movq %r14, %rdi
movl %eax, %esi
callq 0x2270
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xcd24
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x92a5(%rip), %r14      # 0x15fd0
leaq 0x3c8f(%rip), %rsi      # 0x109c1
movl $0x2, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3c6f(%rip), %rsi      # 0x109b5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r12), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5d4
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x3c40(%rip), %rsi      # 0x109bd
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r12), %rdi
movl $0x1, %esi
callq 0xa5f8
movq %r14, %rdi
movl %eax, %esi
callq 0x2270
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xcde3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq (%r13), %rdi
movl $0x1, %esi
callq 0xa5f8
movl %eax, %ebp
movq (%r12), %rdi
movl $0x1, %esi
callq 0xa5f8
cmpl %eax, %ebp
movq %r12, %r14
cmovgq %r13, %r14
movq (%r14), %rdi
xorl %esi, %esi
movl $0x5, %edx
callq 0xa5c2
movq (%r14), %rdi
movl $0x2, %esi
movl $0x5, %edx
callq 0xa5c2
movq 0x919e(%rip), %r14      # 0x15fd0
leaq 0x3b9b(%rip), %rsi      # 0x109d4
movl $0x23, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3b68(%rip), %rsi      # 0x109b5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r13), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5d4
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x3b39(%rip), %rsi      # 0x109bd
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r13), %rdi
movl $0x2, %esi
callq 0xa8bc
movq %r14, %rdi
movl %eax, %esi
callq 0x2270
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rbp
cmpq %rbp, %rdi
je 0xcec5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x9104(%rip), %r14      # 0x15fd0
leaq 0x3aee(%rip), %rsi      # 0x109c1
movl $0x2, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3ace(%rip), %rsi      # 0x109b5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r12), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5d4
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x3a9f(%rip), %rsi      # 0x109bd
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r12), %rdi
movl $0x2, %esi
callq 0xa8bc
movq %r14, %rdi
movl %eax, %esi
callq 0x2270
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xcf84
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x9045(%rip), %r14      # 0x15fd0
leaq 0x3a66(%rip), %rsi      # 0x109f8
movl $0xf, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3a0f(%rip), %rsi      # 0x109b5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r13), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5d4
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x39e0(%rip), %rsi      # 0x109bd
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r13), %rax
movl 0x5c(%rax), %esi
movq %r14, %rdi
callq 0x2270
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xd010
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x8fb9(%rip), %r14      # 0x15fd0
leaq 0x39a3(%rip), %rsi      # 0x109c1
movl $0x2, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3983(%rip), %rsi      # 0x109b5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r12), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5d4
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x3954(%rip), %rsi      # 0x109bd
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r12), %rax
movl 0x5c(%rax), %esi
movq %r14, %rdi
callq 0x2270
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xd0c6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x8f03(%rip), %r14      # 0x15fd0
leaq 0x3934(%rip), %rsi      # 0x10a08
movl $0xf, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x38cd(%rip), %rsi      # 0x109b5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r13), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5d4
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x389e(%rip), %rsi      # 0x109bd
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r13), %rax
movl 0x58(%rax), %esi
movq %r14, %rdi
callq 0x2270
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xd152
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x8e77(%rip), %r14      # 0x15fd0
leaq 0x3861(%rip), %rsi      # 0x109c1
movl $0x2, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3841(%rip), %rsi      # 0x109b5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r12), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5d4
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x3812(%rip), %rsi      # 0x109bd
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r12), %rax
movl 0x58(%rax), %esi
movq %r14, %rdi
callq 0x2270
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xd208
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0xd6ca
xorl %ecx, %ecx
cmpl $0x1, %eax
setne %cl
movq 0x10(%rbx,%rcx,8), %rdi
movl $0x3, %esi
movl $0x1, %edx
callq 0xa5c2
movq %rbx, %rdi
callq 0xd6ca
movl %eax, 0x88(%rbx)
incl 0x80(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd27f
jmp 0xd27f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
jmp 0xd270
jmp 0xd27f
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0xd28c
jmp 0xd299
jmp 0xd27f
jmp 0xd27f
jmp 0xd27f
jmp 0xd27f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xd299
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
nop