// File: /workspace/github_cpp_makefile_star2_O2/smallHW89[P]gobang/test_main.cpp
// Function: main
int main()
{
    int x, y ;
    char side;
    ChessBoard board;
    printf("please select the AI's side(w/b)\n");
    scanf("%c", &side);
    printf("AI's side is %c \n", side);

    board.SetAISide(side);
    StPos humPos(0,0,'w');
    StPos aiPos(0,0,'b');

    if( side == 'w')
    {
        while(1)
        {
            printf("human please  input your black chess:\n");
            scanf("%u %u",  &x, &y);
            printf("Human Put white  Chess %u %u\n",x , y);
            humPos.x = x; humPos.y = y;
            board.PutHumenChessGetAI( humPos , aiPos);
            board.ShowChessBoard();
            printf("AI put black chess: %u %u\n", aiPos.x, aiPos.y );
            board.PutChess(aiPos.x, aiPos.y, Chess_White);
            board.ShowChessBoard();
        }
    }

    if(side == 'b')
    {
        while(1)
        {
            board.PutHumenChessGetAI(humPos, aiPos);
            board.ShowChessBoard();
            printf("Ai Put black chess  %u %u \n",  aiPos.x, aiPos.y);        
            board.PutChess(aiPos.x, aiPos.y, Chess_Black);
            board.ShowChessBoard();
            printf("human please input your white chess\n"); 
            scanf("%u %u",  &x, &y);
            printf("Human Put white  Chess %u %u\n",x , y);
            humPos.x = x; humPos.y = y; 
        }
    }

    return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
leaq -0x2c0(%rbp), %rbx
pushq $0xf
popq %rsi
movq %rbx, %rdi
callq 0x120c
leaq 0x62d(%rip), %rdi       # 0x410a
callq 0x10e0
leaq 0x5b1(%rip), %rdi       # 0x409a
leaq -0x31(%rbp), %r14
movq %r14, %rsi
xorl %eax, %eax
callq 0x10d0
movsbl (%r14), %esi
leaq 0x59b(%rip), %rdi       # 0x409d
xorl %eax, %eax
callq 0x1030
movzbl (%r14), %edx
leaq 0x511(%rip), %rax       # 0x4025
movzbl (%rax), %eax
cmpb %dl, %al
leaq 0x506(%rip), %rcx       # 0x4026
movzbl (%rcx), %ecx
movl %eax, %esi
cmovel %ecx, %esi
movb %dl, 0x198(%rbx)
movb %sil, 0x199(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, -0x68(%rbp)
movb $0x77, -0x58(%rbp)
movups %xmm0, -0x50(%rbp)
movb $0x62, -0x40(%rbp)
cmpb $0x77, %dl
je 0x3b73
cmpl $0x62, %edx
je 0x3c0c
leaq -0x80(%rbp), %rdi
callq 0x32ec
xorl %eax, %eax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x68(%rbp), %r14
leaq -0x50(%rbp), %r15
leaq 0x551(%rip), %r12       # 0x40d3
movsbl %cl, %r13d
leaq 0x5c2(%rip), %rdi       # 0x414f
callq 0x10e0
leaq 0x516(%rip), %rdi       # 0x40af
leaq -0x30(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
xorl %eax, %eax
callq 0x10d0
movl -0x30(%rbp), %esi
movl -0x2c(%rbp), %edx
leaq 0x500(%rip), %rdi       # 0x40b5
xorl %eax, %eax
callq 0x1030
movl -0x30(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x64(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x31a0
movq %rbx, %rdi
callq 0x12f8
movl -0x50(%rbp), %esi
movl -0x4c(%rbp), %edx
movq %r12, %rdi
xorl %eax, %eax
callq 0x1030
movl -0x50(%rbp), %esi
movl -0x4c(%rbp), %edx
movq %rbx, %rdi
movl %r13d, %ecx
callq 0x128c
movq %rbx, %rdi
callq 0x12f8
jmp 0x3b86
movsbl %al, %r13d
leaq -0x30(%rbp), %r12
leaq -0x2c(%rbp), %r14
leaq 0x496(%rip), %r15       # 0x40b5
movq %rbx, %rdi
leaq -0x68(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x31a0
movq %rbx, %rdi
callq 0x12f8
movl -0x50(%rbp), %esi
movl -0x4c(%rbp), %edx
leaq 0x4aa(%rip), %rdi       # 0x40ee
xorl %eax, %eax
callq 0x1030
movl -0x50(%rbp), %esi
movl -0x4c(%rbp), %edx
movq %rbx, %rdi
movl %r13d, %ecx
callq 0x128c
movq %rbx, %rdi
callq 0x12f8
leaq 0x4c0(%rip), %rdi       # 0x412b
callq 0x10e0
leaq 0x438(%rip), %rdi       # 0x40af
movq %r12, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x10d0
movl -0x30(%rbp), %esi
movl -0x2c(%rbp), %edx
movq %r15, %rdi
xorl %eax, %eax
callq 0x1030
movl -0x30(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x64(%rbp)
jmp 0x3c1f
jmp 0x3ca7
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x32ec
movq %rbx, %rdi
callq 0x1100