// File: smallHW89[P]gobang/GoBang_ChessBoard.cpp
// Function: ChessBoard::CalculateLine(char*, int, int, int&, int&)
BoardType  ChessBoard::CalculateLine(char  oneLine[],  int len , int pos, int &resL , int &resR)
{
    if(IsLong(oneLine, len , pos, resL , resR ) )
        return Board_LONG;
    if(Is5(oneLine, len , pos , resL , resR))
        return Board_FIVE;
    if(IsOpen4(oneLine, len , pos ,resL , resR))
        return Board_FOUR;
    if(IsSide4(oneLine, len , pos, resL , resR)   )
        return Board_SFOUR;
    if(IsOpen3(oneLine , len , pos, resL, resR) )
        return Board_THREE;
    if(IsSide3(oneLine, len , pos , resL , resR) )
        return Board_STHREE;
    if(IsOpen2(oneLine, len , pos, resL , resR ))
        return Board_TWO;
    if(IsSide2(oneLine, len , pos, resL , resR) ) 
        return Board_STWO;
    if(IsOpen1(oneLine, len, pos, resL, resR) )
        return Board_ONE;
    if(IsSide1(oneLine, len , pos, resL, resR))
        return Board_SONE;
    
    return Board_NOVALUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x38(%rbp)
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x1630
testb $0x1, %al
jne 0x3103
jmp 0x310f
movl $0xa, -0x4(%rbp)
jmp 0x32a2
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x17e0
testb $0x1, %al
jne 0x3130
jmp 0x313c
movl $0x1, -0x4(%rbp)
jmp 0x32a2
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x1990
testb $0x1, %al
jne 0x315d
jmp 0x3169
movl $0x2, -0x4(%rbp)
jmp 0x32a2
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x1b60
testb $0x1, %al
jne 0x318a
jmp 0x3196
movl $0x3, -0x4(%rbp)
jmp 0x32a2
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x1f00
testb $0x1, %al
jne 0x31b7
jmp 0x31c3
movl $0x4, -0x4(%rbp)
jmp 0x32a2
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x2230
testb $0x1, %al
jne 0x31e4
jmp 0x31f0
movl $0x5, -0x4(%rbp)
jmp 0x32a2
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x2560
testb $0x1, %al
jne 0x3211
jmp 0x321d
movl $0x6, -0x4(%rbp)
jmp 0x32a2
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x2890
testb $0x1, %al
jne 0x323e
jmp 0x3247
movl $0x7, -0x4(%rbp)
jmp 0x32a2
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x2bc0
testb $0x1, %al
jne 0x3268
jmp 0x3271
movl $0x8, -0x4(%rbp)
jmp 0x32a2
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x2ef0
testb $0x1, %al
jne 0x3292
jmp 0x329b
movl $0x9, -0x4(%rbp)
jmp 0x32a2
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)