// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movq %r8, %r15
movl %ecx, %ebx
movl %edx, %r12d
movq %rsi, %r13
movslq %ecx, %rax
movb (%rsi,%rax), %cl
cmpb $0x65, %cl
je 0x2643
cmpl %r12d, %ebx
setg %dl
testl %ebx, %ebx
sets %sil
orb %dl, %sil
jne 0x2643
leaq (%rax,%r13), %rsi
decq %rsi
xorl %edx, %edx
movq %rdx, %rdi
decq %rdx
cmpb %cl, (%rsi,%rdi)
je 0x25fb
movl %ebx, %edi
leal -0x1(%rbx), %esi
leaq (%rdi,%r13), %r8
incq %r8
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
subl %edx, %edi
incl %esi
incl %edi
leaq 0x1(%r8), %r9
cmpb %cl, (%r8)
movq %r9, %r8
je 0x2619
cmpl $0x5, %edi
jl 0x2643
incl %ebx
addq %rdx, %rbx
movl %ebx, (%r15)
movl %esi, (%r14)
movl $0xa, %eax
jmp 0x279a
movb (%r13,%rax), %cl
cmpb $0x65, %cl
je 0x2697
cmpl %r12d, %ebx
setg %dl
testl %ebx, %ebx
sets %sil
orb %dl, %sil
jne 0x2697
leaq (%rax,%r13), %rdx
decq %rdx
xorl %eax, %eax
movq %rax, %rsi
decq %rax
cmpb %cl, (%rdx,%rsi)
je 0x2667
movl %ebx, %esi
leal -0x1(%rbx), %edx
addq %r13, %rsi
incq %rsi
leal 0x6(%rax), %edi
incl %edx
decl %edi
leaq 0x1(%rsi), %r8
cmpb %cl, (%rsi)
movq %r8, %rsi
je 0x2680
testl %edi, %edi
je 0x278a
movq %r13, %rsi
movl %r12d, %edx
movl %ebx, %ecx
movq %r15, %r8
movq %r14, %r9
callq 0x1530
movl %eax, %ecx
movl $0x2, %eax
testb %cl, %cl
jne 0x279a
movq %r13, %rsi
movl %r12d, %edx
movl %ebx, %ecx
movq %r15, %r8
movq %r14, %r9
callq 0x15ee
movl %eax, %ecx
movl $0x3, %eax
testb %cl, %cl
jne 0x279a
movq %r13, %rsi
movl %r12d, %edx
movl %ebx, %ecx
movq %r15, %r8
movq %r14, %r9
callq 0x18fc
movl %eax, %ecx
movl $0x4, %eax
testb %cl, %cl
jne 0x279a
movq %r13, %rsi
movl %r12d, %edx
movl %ebx, %ecx
movq %r15, %r8
movq %r14, %r9
callq 0x1b5a
movl %eax, %ecx
movl $0x5, %eax
testb %cl, %cl
jne 0x279a
movq %r13, %rsi
movl %r12d, %edx
movl %ebx, %ecx
movq %r15, %r8
movq %r14, %r9
callq 0x1db8
movl %eax, %ecx
movl $0x6, %eax
testb %cl, %cl
jne 0x279a
movq %r13, %rsi
movl %r12d, %edx
movl %ebx, %ecx
movq %r15, %r8
movq %r14, %r9
callq 0x2016
movl %eax, %ecx
movl $0x7, %eax
testb %cl, %cl
jne 0x279a
movq %r13, %rsi
movl %r12d, %edx
movl %ebx, %ecx
movq %r15, %r8
movq %r14, %r9
callq 0x2274
movl %eax, %ecx
movl $0x8, %eax
testb %cl, %cl
jne 0x279a
movq %r13, %rsi
movl %r12d, %edx
movl %ebx, %ecx
callq 0x24d2
movzbl %al, %eax
leal (%rax,%rax,8), %eax
jmp 0x279a
incl %ebx
addq %rax, %rbx
movl %ebx, (%r15)
movl %edx, (%r14)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop