// File: tyhsu[P]Ewn/play.cpp
// Function: Play::player_AI_mode()
void Play::player_AI_mode()
{
    EwnAI ewnAI;
    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() == true) {
            game_status = this->game.update_game_status(player_move(dice));
        }
        else
            game_status = this->game.update_game_status(ewnAI.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 << "AI 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 $0x430, %rsp            # imm = 0x430
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x3c0(%rbp)
leaq -0x2a8(%rbp), %rdi
callq 0x51e0
movq -0x3c0(%rbp), %rdi
callq 0xab80
jmp 0x2f24
jmp 0x2f26
jmp 0x2f28
movq -0x3c0(%rbp), %rdi
callq 0xad70
movl %eax, -0x3c4(%rbp)
jmp 0x2f3c
movl -0x3c4(%rbp), %eax
movl %eax, -0x2b8(%rbp)
movq 0xf079(%rip), %rdi      # 0x11fc8
leaq 0xa1cf(%rip), %rsi      # 0xd125
callq 0x2150
movq %rax, -0x3d0(%rbp)
jmp 0x2f64
movq -0x3d0(%rbp), %rdi
movl -0x2b8(%rbp), %esi
incl %esi
callq 0x2200
movq %rax, -0x3d8(%rbp)
jmp 0x2f81
movq -0x3d8(%rbp), %rdi
movq 0xf029(%rip), %rsi      # 0x11fb8
callq 0x2190
jmp 0x2f96
movq -0x3c0(%rbp), %rdi
callq 0xb910
movb %al, -0x3d9(%rbp)
jmp 0x2faa
movb -0x3d9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x3041
movq -0x3c0(%rbp), %rdi
movq %rdi, %rax
movq %rax, -0x3f0(%rbp)
leaq -0x2b8(%rbp), %rsi
callq 0x2b70
movq %rax, -0x3e8(%rbp)
jmp 0x2fe4
movq -0x3f0(%rbp), %rdi
movq -0x3e8(%rbp), %rax
movq %rax, -0x2c4(%rbp)
leaq -0x2c4(%rbp), %rsi
callq 0xb120
movl %eax, -0x3f4(%rbp)
jmp 0x300d
movl -0x3f4(%rbp), %eax
movl %eax, -0x2bc(%rbp)
jmp 0x30b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2b0(%rbp)
movl %eax, -0x2b4(%rbp)
leaq -0x2a8(%rbp), %rdi
callq 0x4c80
jmp 0x31cb
movq -0x3c0(%rbp), %rsi
movq %rsi, %rax
movq %rax, -0x400(%rbp)
leaq -0x3b8(%rbp), %rdi
callq 0xa520
jmp 0x3060
movl -0x2b8(%rbp), %edx
leaq -0x2a8(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
callq 0x5650
movq %rax, -0x408(%rbp)
jmp 0x3082
movq -0x400(%rbp), %rdi
movq -0x408(%rbp), %rax
movq %rax, -0x2cc(%rbp)
leaq -0x2cc(%rbp), %rsi
callq 0xb120
movl %eax, -0x40c(%rbp)
jmp 0x30ab
movl -0x40c(%rbp), %eax
movl %eax, -0x2bc(%rbp)
movq -0x3c0(%rbp), %rdi
callq 0xab80
jmp 0x30c5
cmpl $0x0, -0x2bc(%rbp)
je 0x31b8
movq 0xeeef(%rip), %rdi      # 0x11fc8
leaq 0xa43f(%rip), %rsi      # 0xd51f
callq 0x2150
movq %rax, -0x418(%rbp)
jmp 0x30ee
movq -0x418(%rbp), %rdi
movq 0xeebc(%rip), %rsi      # 0x11fb8
callq 0x2190
jmp 0x3103
cmpl $0x1, -0x2bc(%rbp)
jne 0x313f
movq 0xeeb5(%rip), %rdi      # 0x11fc8
leaq 0xa1f6(%rip), %rsi      # 0xd310
callq 0x2150
movq %rax, -0x420(%rbp)
jmp 0x3128
movq -0x420(%rbp), %rdi
movq 0xee82(%rip), %rsi      # 0x11fb8
callq 0x2190
jmp 0x313d
jmp 0x3172
movq 0xee82(%rip), %rdi      # 0x11fc8
leaq 0x9ff2(%rip), %rsi      # 0xd13f
callq 0x2150
movq %rax, -0x428(%rbp)
jmp 0x315b
movq -0x428(%rbp), %rdi
movq 0xee4f(%rip), %rsi      # 0x11fb8
callq 0x2190
jmp 0x3170
jmp 0x3172
movq 0xee4f(%rip), %rdi      # 0x11fc8
leaq 0xa39f(%rip), %rsi      # 0xd51f
callq 0x2150
movq %rax, -0x430(%rbp)
jmp 0x318e
movq -0x430(%rbp), %rdi
movq 0xee1c(%rip), %rsi      # 0x11fb8
callq 0x2190
jmp 0x31a3
leaq -0x2a8(%rbp), %rdi
callq 0x4c80
addq $0x430, %rsp            # imm = 0x430
popq %rbp
retq
movq -0x3c0(%rbp), %rdi
callq 0xb440
jmp 0x31c6
jmp 0x2f26
movq -0x2b0(%rbp), %rdi
callq 0x2210
nopw (%rax,%rax)