// File: /workspace/github_cpp_makefile_star2_O3/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
movq %rbx, %rdi
movl $0xf, %esi
callq 0x120c
leaq 0x10ab(%rip), %rdi      # 0x510a
callq 0x10c0
leaq 0x102f(%rip), %rdi      # 0x509a
leaq -0x31(%rbp), %r14
movq %r14, %rsi
xorl %eax, %eax
callq 0x10b0
movsbl (%r14), %esi
leaq 0x1019(%rip), %rdi      # 0x509d
xorl %eax, %eax
callq 0x1030
movzbl (%r14), %edx
leaq 0xf8f(%rip), %rax       # 0x5025
movzbl (%rax), %eax
cmpb %dl, %al
leaq 0xf84(%rip), %rcx       # 0x5026
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 0x4101
cmpl $0x62, %edx
je 0x419a
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x40ed
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x10a0
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 0xfc3(%rip), %r12       # 0x50d3
movsbl %cl, %r13d
leaq 0x1034(%rip), %rdi      # 0x514f
callq 0x10c0
leaq 0xf88(%rip), %rdi       # 0x50af
leaq -0x30(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
xorl %eax, %eax
callq 0x10b0
movl -0x30(%rbp), %esi
movl -0x2c(%rbp), %edx
leaq 0xf72(%rip), %rdi       # 0x50b5
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 0x3858
movq %rbx, %rdi
callq 0x132a
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 0x128e
movq %rbx, %rdi
callq 0x132a
jmp 0x4114
movsbl %al, %r13d
leaq -0x30(%rbp), %r12
leaq -0x2c(%rbp), %r14
leaq 0xf08(%rip), %r15       # 0x50b5
movq %rbx, %rdi
leaq -0x68(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x3858
movq %rbx, %rdi
callq 0x132a
movl -0x50(%rbp), %esi
movl -0x4c(%rbp), %edx
leaq 0xf1c(%rip), %rdi       # 0x50ee
xorl %eax, %eax
callq 0x1030
movl -0x50(%rbp), %esi
movl -0x4c(%rbp), %edx
movq %rbx, %rdi
movl %r13d, %ecx
callq 0x128e
movq %rbx, %rdi
callq 0x132a
leaq 0xf32(%rip), %rdi       # 0x512b
callq 0x10c0
leaq 0xeaa(%rip), %rdi       # 0x50af
movq %r12, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x10b0
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 0x41ad
jmp 0x4235
movq %rax, %rbx
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x424d
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x10a0
movq %rbx, %rdi
callq 0x10e0