// File: /workspace/github_cpp_makefile_star2_O3/kobanium[P]Ray/src/gtp/Gtp.cpp
// Function: ParseAnalysisTag(int&, int&)
static void
ParseAnalysisTag( int &color, int &centi_second )
{
  char *command;
  int token_cnt = 0;

  while (true) {
    command = STRTOK(NULL, DELIM, &next_token);
    token_cnt += 1;
    if (command != NULL && token_cnt <= 2) {
      CHOMP(command);

      // Parse the color.
      char c = static_cast<char>(tolower(static_cast<int>(command[0])));
      if (c == 'w') {
        color = S_WHITE;
        continue;
      } else if (c == 'b') {
        color = S_BLACK;
        continue;
      }

      // Parse the unused interval tag.
      if (strcmp(command, "minmoves") == 0 ||
          strcmp(command, "maxmoves") == 0) {
        STRTOK(NULL, DELIM, &next_token); // eat move numbers
        continue;
      }

      if (strcmp(command, "avoid") == 0 ||
          strcmp(command, "allow") == 0) {
        STRTOK(NULL, DELIM, &next_token); // eat color
        STRTOK(NULL, DELIM, &next_token); // eat vertices moves
        STRTOK(NULL, DELIM, &next_token); // eat until moves
        continue;
      }

      // Parse the interval tag.
      if (strcmp(command, "interval") == 0) {
        command = STRTOK(NULL, DELIM, &next_token);
        CHOMP(command);
      }

      bool is_digit = true;
      for (int i = 0; i < static_cast<int>(strlen(command)); ++i) {
        is_digit &= isdigit(command[i]);
      }

      if (is_digit) {
        centi_second = std::atoi(command);
      }
    } else {
      break;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movq %rdi, %r14
leaq 0x3b899(%rip), %rsi     # 0x5d402
xorl %edi, %edi
callq 0x6640
testq %rax, %rax
je 0x21cda
movq %rax, %rbx
movl $0x1, %ebp
leaq 0x3b87a(%rip), %r15     # 0x5d402
leaq 0x3c19e(%rip), %r12     # 0x5dd2d
leaq 0x3c1a0(%rip), %r13     # 0x5dd36
movq %rbx, %rdi
callq 0x6160
cmpb $0xa, -0x1(%rbx,%rax)
jne 0x21baa
movb $0x0, -0x1(%rbx,%rax)
movsbl (%rbx), %edi
callq 0x65c0
cmpb $0x62, %al
je 0x21bca
movzbl %al, %eax
cmpl $0x77, %eax
jne 0x21bd6
movl $0x2, (%r14)
jmp 0x21cba
movl $0x1, (%r14)
jmp 0x21cba
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6580
testl %eax, %eax
je 0x21cb0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x6580
testl %eax, %eax
je 0x21cb0
movq %rbx, %rdi
leaq 0x3c139(%rip), %rsi     # 0x5dd3f
callq 0x6580
testl %eax, %eax
je 0x21c9c
movq %rbx, %rdi
leaq 0x3c128(%rip), %rsi     # 0x5dd45
callq 0x6580
testl %eax, %eax
je 0x21c9c
movq %rbx, %rdi
leaq 0x3c11b(%rip), %rsi     # 0x5dd4b
callq 0x6580
testl %eax, %eax
jne 0x21c5a
xorl %edi, %edi
movq %r15, %rsi
callq 0x6640
movq %rax, %rbx
movq %rax, %rdi
callq 0x6160
cmpb $0xa, -0x1(%rbx,%rax)
jne 0x21c5a
movb $0x0, -0x1(%rbx,%rax)
movq %rbx, %rdi
callq 0x6160
testl %eax, %eax
jle 0x21c8c
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movb $0x1, %cl
xorl %edx, %edx
movsbl (%rbx,%rdx), %esi
addl $-0x30, %esi
cmpl $0xa, %esi
setb %sil
andb %sil, %cl
incq %rdx
cmpq %rdx, %rax
jne 0x21c6f
testb %cl, %cl
je 0x21cba
movq %rbx, %rdi
callq 0x6630
movq (%rsp), %rcx
movl %eax, (%rcx)
jmp 0x21cba
xorl %edi, %edi
movq %r15, %rsi
callq 0x6640
xorl %edi, %edi
movq %r15, %rsi
callq 0x6640
xorl %edi, %edi
movq %r15, %rsi
callq 0x6640
xorl %edi, %edi
movq %r15, %rsi
callq 0x6640
testq %rax, %rax
je 0x21cda
movq %rax, %rbx
leal 0x1(%rbp), %eax
cmpl $0x2, %ebp
movl %eax, %ebp
jb 0x21b96
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop