// File: /workspace/github_cpp_makefile_star2_O1/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 0xd33e
testb %al, %al
jne 0xcba4
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 0xd3e4
movq 0x10(%rbx,%r15,8), %rsi
movq %rbx, %rdi
callq 0xd4b0
cmpl $0x1, %ebp
jne 0xcb92
incl 0x84(%rbx)
movq %rbx, %rdi
callq 0xd33e
movl %ebp, %r15d
movl %r14d, %ebp
testb %al, %al
je 0xcb5f
movq 0x9425(%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 0x3da7(%rip), %rsi      # 0x10980
movl $0x24, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3db8(%rip), %rsi      # 0x109a5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq 0x10(%rbx), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5fa
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x3d89(%rip), %rsi      # 0x109ad
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
leaq 0x10(%rbx), %r13
movq (%r13), %rdi
movl $0x2, %esi
callq 0xa912
movq %r14, %rdi
movl %eax, %esi
callq 0x2270
leaq 0x18(%rsp), %rbp
movq -0x10(%rbp), %rdi
cmpq %rbp, %rdi
je 0xcc68
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x9361(%rip), %r14      # 0x15fd0
leaq 0x3d3b(%rip), %rsi      # 0x109b1
movl $0x2, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3d1b(%rip), %rsi      # 0x109a5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq 0x18(%rbx), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5fa
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x3cec(%rip), %rsi      # 0x109ad
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
leaq 0x18(%rbx), %r12
movq (%r12), %rdi
movl $0x2, %esi
callq 0xa912
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 0xcd2b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x929e(%rip), %r14      # 0x15fd0
leaq 0x3c7b(%rip), %rsi      # 0x109b4
movl $0xf, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3c58(%rip), %rsi      # 0x109a5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r13), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5fa
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x3c29(%rip), %rsi      # 0x109ad
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r13), %rdi
movl $0x1, %esi
callq 0xa61e
movq %r14, %rdi
movl %eax, %esi
callq 0x2270
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xcdc0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x9209(%rip), %r14      # 0x15fd0
leaq 0x3be3(%rip), %rsi      # 0x109b1
movl $0x2, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3bc3(%rip), %rsi      # 0x109a5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r12), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5fa
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x3b94(%rip), %rsi      # 0x109ad
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r12), %rdi
movl $0x1, %esi
callq 0xa61e
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 0xce7f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq (%r13), %rdi
movl $0x1, %esi
callq 0xa61e
movl %eax, %ebp
movq (%r12), %rdi
movl $0x1, %esi
callq 0xa61e
cmpl %eax, %ebp
movq %r12, %r14
cmovgq %r13, %r14
movq (%r14), %rdi
xorl %esi, %esi
movl $0x5, %edx
callq 0xa5e8
movq (%r14), %rdi
movl $0x2, %esi
movl $0x5, %edx
callq 0xa5e8
movq 0x9102(%rip), %r14      # 0x15fd0
leaq 0x3aef(%rip), %rsi      # 0x109c4
movl $0x23, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3abc(%rip), %rsi      # 0x109a5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r13), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5fa
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x3a8d(%rip), %rsi      # 0x109ad
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r13), %rdi
movl $0x2, %esi
callq 0xa912
movq %r14, %rdi
movl %eax, %esi
callq 0x2270
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rbp
cmpq %rbp, %rdi
je 0xcf61
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x9068(%rip), %r14      # 0x15fd0
leaq 0x3a42(%rip), %rsi      # 0x109b1
movl $0x2, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3a22(%rip), %rsi      # 0x109a5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r12), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5fa
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x39f3(%rip), %rsi      # 0x109ad
movl $0x3, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r12), %rdi
movl $0x2, %esi
callq 0xa912
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 0xd020
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x8fa9(%rip), %r14      # 0x15fd0
leaq 0x39ba(%rip), %rsi      # 0x109e8
movl $0xf, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3963(%rip), %rsi      # 0x109a5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r13), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5fa
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x3934(%rip), %rsi      # 0x109ad
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 0xd0ac
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x8f1d(%rip), %r14      # 0x15fd0
leaq 0x38f7(%rip), %rsi      # 0x109b1
movl $0x2, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x38d7(%rip), %rsi      # 0x109a5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r12), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5fa
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x38a8(%rip), %rsi      # 0x109ad
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 0xd162
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x8e67(%rip), %r14      # 0x15fd0
leaq 0x3888(%rip), %rsi      # 0x109f8
movl $0xf, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3821(%rip), %rsi      # 0x109a5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r13), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5fa
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x37f2(%rip), %rsi      # 0x109ad
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 0xd1ee
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq 0x8ddb(%rip), %r14      # 0x15fd0
leaq 0x37b5(%rip), %rsi      # 0x109b1
movl $0x2, %edx
movq %r14, %rdi
callq 0x21d0
leaq 0x3795(%rip), %rsi      # 0x109a5
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r12), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5fa
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x3766(%rip), %rsi      # 0x109ad
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 0xd2a4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0xd7cc
xorl %ecx, %ecx
cmpl $0x1, %eax
setne %cl
movq 0x10(%rbx,%rcx,8), %rdi
movl $0x3, %esi
movl $0x1, %edx
callq 0xa5e8
movq %rbx, %rdi
callq 0xd7cc
movl %eax, 0x88(%rbx)
incl 0x80(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd31b
jmp 0xd31b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
jmp 0xd30c
jmp 0xd31b
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0xd328
jmp 0xd335
jmp 0xd31b
jmp 0xd31b
jmp 0xd31b
jmp 0xd31b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xd335
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
nop