// File: /workspace/github_cpp_makefile_star2_O2/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 0x320ab(%rip), %r15     # 0x44bd2
leaq 0x3204d(%rip), %r12     # 0x44b7b
leaq 0x3204f(%rip), %r13     # 0x44b84
xorl %ebp, %ebp
xorl %edi, %edi
movq %r15, %rsi
callq 0x6610
testq %rax, %rax
je 0x12c82
cmpl $0x1, %ebp
ja 0x12c82
movq %rax, %rbx
movq %rax, %rdi
callq 0x6150
cmpb $0xa, -0x1(%rbx,%rax)
jne 0x12b6a
movb $0x0, -0x1(%rbx,%rax)
incl %ebp
movsbl (%rbx), %edi
callq 0x65a0
cmpb $0x62, %al
je 0x12b89
movzbl %al, %eax
cmpl $0x77, %eax
jne 0x12b92
movl $0x2, (%r14)
jmp 0x12b37
movl $0x1, (%r14)
jmp 0x12b37
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6570
testl %eax, %eax
je 0x12c57
movq %rbx, %rdi
movq %r13, %rsi
callq 0x6570
testl %eax, %eax
je 0x12c57
movq %rbx, %rdi
leaq 0x31fcb(%rip), %rsi     # 0x44b8d
callq 0x6570
testl %eax, %eax
je 0x12c43
movq %rbx, %rdi
leaq 0x31fbe(%rip), %rsi     # 0x44b93
callq 0x6570
testl %eax, %eax
je 0x12c43
movq %rbx, %rdi
leaq 0x31fb1(%rip), %rsi     # 0x44b99
callq 0x6570
testl %eax, %eax
jne 0x12c12
xorl %edi, %edi
movq %r15, %rsi
callq 0x6610
movq %rax, %rbx
movq %rax, %rdi
callq 0x6150
cmpb $0xa, -0x1(%rbx,%rax)
jne 0x12c12
movb $0x0, -0x1(%rbx,%rax)
movq %rbx, %rdi
callq 0x6150
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
movb $0x1, %cl
xorl %edx, %edx
cmpq %rdx, %rax
je 0x12c66
movsbl (%rbx,%rdx), %esi
addl $-0x30, %esi
cmpl $0xa, %esi
setb %sil
andb %sil, %cl
incq %rdx
jmp 0x12c28
xorl %edi, %edi
movq %r15, %rsi
callq 0x6610
xorl %edi, %edi
movq %r15, %rsi
callq 0x6610
xorl %edi, %edi
movq %r15, %rsi
callq 0x6610
jmp 0x12b37
testb $0x1, %cl
je 0x12b37
movq %rbx, %rdi
callq 0x6600
movq (%rsp), %rcx
movl %eax, (%rcx)
jmp 0x12b37
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop