// File: tyhsu[P]Ewn/play.cpp
// Function: Play::two_AIs_mode()
void Play::two_AIs_mode()
{
    cout << "==========The first AI (A)==========" << endl;
    EwnAI ewnAI1;
    cout << "==========The second AI (B)==========" << endl;
    EwnAI ewnAI2;
    this->game.print_board();
    while (1) {
        int dice = this->game.roll_dice();
        cout << "dice: " << dice+1 << endl;

        int game_status;
        if (!this->game.get_is_switch())	// the first AI (A)
            game_status = this->game.update_game_status(ewnAI1.AI_move(this->game, dice));
        else					// the second AI (B)
            game_status = this->game.update_game_status(ewnAI2.AI_move(this->game, dice));
        this->game.print_board();

        //update: 0(game continues), 1(A wins), 2(B wins)
        if (game_status!=0) {
            cout << "====================================" << endl;
            if (game_status==1) cout << "A is the winner!!!" << endl;
            else cout << "B is the winner!!!" << endl;
            cout << "====================================" << endl;
            return;
        }
        this->game.switch_player();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x7d0, %rsp            # imm = 0x7D0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x758(%rbp)
movq 0xedc7(%rip), %rdi      # 0x11fc8
movq %rdi, -0x750(%rbp)
leaq 0x9f43(%rip), %rsi      # 0xd152
callq 0x2150
movq %rax, %rdi
movq 0xed9a(%rip), %rsi      # 0x11fb8
callq 0x2190
leaq -0x2a8(%rbp), %rdi
callq 0x51e0
movq -0x750(%rbp), %rdi
leaq 0x9f3a(%rip), %rsi      # 0xd177
callq 0x2150
movq %rax, -0x748(%rbp)
jmp 0x324b
movq -0x748(%rbp), %rdi
movq 0xed5f(%rip), %rsi      # 0x11fb8
callq 0x2190
jmp 0x3260
leaq -0x558(%rbp), %rdi
callq 0x51e0
jmp 0x326e
movq -0x758(%rbp), %rdi
callq 0xab80
jmp 0x327c
jmp 0x327e
jmp 0x3280
movq -0x758(%rbp), %rdi
callq 0xad70
movl %eax, -0x75c(%rbp)
jmp 0x3294
movl -0x75c(%rbp), %eax
movl %eax, -0x55c(%rbp)
movq 0xed21(%rip), %rdi      # 0x11fc8
leaq 0x9e77(%rip), %rsi      # 0xd125
callq 0x2150
movq %rax, -0x768(%rbp)
jmp 0x32bc
movq -0x768(%rbp), %rdi
movl -0x55c(%rbp), %esi
incl %esi
callq 0x2200
movq %rax, -0x770(%rbp)
jmp 0x32d9
movq -0x770(%rbp), %rdi
movq 0xecd1(%rip), %rsi      # 0x11fb8
callq 0x2190
jmp 0x32ee
movq -0x758(%rbp), %rdi
callq 0xb910
movb %al, -0x771(%rbp)
jmp 0x3302
movb -0x771(%rbp), %al
testb $0x1, %al
jne 0x33c7
jmp 0x3312
movq -0x758(%rbp), %rsi
movq %rsi, %rax
movq %rax, -0x780(%rbp)
leaq -0x650(%rbp), %rdi
callq 0xa520
jmp 0x3331
movl -0x55c(%rbp), %edx
leaq -0x2a8(%rbp), %rdi
leaq -0x650(%rbp), %rsi
callq 0x5650
movq %rax, -0x788(%rbp)
jmp 0x3353
movq -0x780(%rbp), %rdi
movq -0x788(%rbp), %rax
movq %rax, -0x568(%rbp)
leaq -0x568(%rbp), %rsi
callq 0xb120
movl %eax, -0x78c(%rbp)
jmp 0x337c
movl -0x78c(%rbp), %eax
movl %eax, -0x560(%rbp)
jmp 0x343d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2b0(%rbp)
movl %eax, -0x2b4(%rbp)
jmp 0x355d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2b0(%rbp)
movl %eax, -0x2b4(%rbp)
leaq -0x558(%rbp), %rdi
callq 0x4c80
jmp 0x355d
movq -0x758(%rbp), %rsi
movq %rsi, %rax
movq %rax, -0x798(%rbp)
leaq -0x740(%rbp), %rdi
callq 0xa520
jmp 0x33e6
movl -0x55c(%rbp), %edx
leaq -0x558(%rbp), %rdi
leaq -0x740(%rbp), %rsi
callq 0x5650
movq %rax, -0x7a0(%rbp)
jmp 0x3408
movq -0x798(%rbp), %rdi
movq -0x7a0(%rbp), %rax
movq %rax, -0x658(%rbp)
leaq -0x658(%rbp), %rsi
callq 0xb120
movl %eax, -0x7a4(%rbp)
jmp 0x3431
movl -0x7a4(%rbp), %eax
movl %eax, -0x560(%rbp)
movq -0x758(%rbp), %rdi
callq 0xab80
jmp 0x344b
cmpl $0x0, -0x560(%rbp)
je 0x354a
movq 0xeb69(%rip), %rdi      # 0x11fc8
leaq 0xa0b9(%rip), %rsi      # 0xd51f
callq 0x2150
movq %rax, -0x7b0(%rbp)
jmp 0x3474
movq -0x7b0(%rbp), %rdi
movq 0xeb36(%rip), %rsi      # 0x11fb8
callq 0x2190
jmp 0x3489
cmpl $0x1, -0x560(%rbp)
jne 0x34c5
movq 0xeb2f(%rip), %rdi      # 0x11fc8
leaq 0x9c8c(%rip), %rsi      # 0xd12c
callq 0x2150
movq %rax, -0x7b8(%rbp)
jmp 0x34ae
movq -0x7b8(%rbp), %rdi
movq 0xeafc(%rip), %rsi      # 0x11fb8
callq 0x2190
jmp 0x34c3
jmp 0x34f8
movq 0xeafc(%rip), %rdi      # 0x11fc8
leaq 0x9c6c(%rip), %rsi      # 0xd13f
callq 0x2150
movq %rax, -0x7c0(%rbp)
jmp 0x34e1
movq -0x7c0(%rbp), %rdi
movq 0xeac9(%rip), %rsi      # 0x11fb8
callq 0x2190
jmp 0x34f6
jmp 0x34f8
movq 0xeac9(%rip), %rdi      # 0x11fc8
leaq 0xa019(%rip), %rsi      # 0xd51f
callq 0x2150
movq %rax, -0x7c8(%rbp)
jmp 0x3514
movq -0x7c8(%rbp), %rdi
movq 0xea96(%rip), %rsi      # 0x11fb8
callq 0x2190
jmp 0x3529
leaq -0x558(%rbp), %rdi
callq 0x4c80
leaq -0x2a8(%rbp), %rdi
callq 0x4c80
addq $0x7d0, %rsp            # imm = 0x7D0
popq %rbp
retq
movq -0x758(%rbp), %rdi
callq 0xb440
jmp 0x3558
jmp 0x327e
leaq -0x2a8(%rbp), %rdi
callq 0x4c80
movq -0x2b0(%rbp), %rdi
callq 0x2210
nopw %cs:(%rax,%rax)