// File: /workspace/github_cpp_makefile_star2_O1/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 0x3b684(%rip), %rsi     # 0x5d402
xorl %edi, %edi
callq 0x6650
testq %rax, %rax
je 0x21eef
movq %rax, %rbx
movl $0x1, %ebp
leaq 0x3b665(%rip), %r15     # 0x5d402
leaq 0x3bf89(%rip), %r12     # 0x5dd2d
leaq 0x3bf8b(%rip), %r13     # 0x5dd36
movq %rbx, %rdi
callq 0x6160
cmpb $0xa, -0x1(%rbx,%rax)
jne 0x21dbf
movb $0x0, -0x1(%rbx,%rax)
movsbl (%rbx), %edi
callq 0x65d0
cmpb $0x62, %al
je 0x21ddf
movzbl %al, %eax
cmpl $0x77, %eax
jne 0x21deb
movl $0x2, (%r14)
jmp 0x21ecf
movl $0x1, (%r14)
jmp 0x21ecf
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6590
testl %eax, %eax
je 0x21ec5
movq %rbx, %rdi
movq %r13, %rsi
callq 0x6590
testl %eax, %eax
je 0x21ec5
movq %rbx, %rdi
leaq 0x3bf24(%rip), %rsi     # 0x5dd3f
callq 0x6590
testl %eax, %eax
je 0x21eb1
movq %rbx, %rdi
leaq 0x3bf13(%rip), %rsi     # 0x5dd45
callq 0x6590
testl %eax, %eax
je 0x21eb1
movq %rbx, %rdi
leaq 0x3bf06(%rip), %rsi     # 0x5dd4b
callq 0x6590
testl %eax, %eax
jne 0x21e6f
xorl %edi, %edi
movq %r15, %rsi
callq 0x6650
movq %rax, %rbx
movq %rax, %rdi
callq 0x6160
cmpb $0xa, -0x1(%rbx,%rax)
jne 0x21e6f
movb $0x0, -0x1(%rbx,%rax)
movq %rbx, %rdi
callq 0x6160
testl %eax, %eax
jle 0x21ea1
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 0x21e84
testb %cl, %cl
je 0x21ecf
movq %rbx, %rdi
callq 0x6640
movq (%rsp), %rcx
movl %eax, (%rcx)
jmp 0x21ecf
xorl %edi, %edi
movq %r15, %rsi
callq 0x6650
xorl %edi, %edi
movq %r15, %rsi
callq 0x6650
xorl %edi, %edi
movq %r15, %rsi
callq 0x6650
xorl %edi, %edi
movq %r15, %rsi
callq 0x6650
testq %rax, %rax
je 0x21eef
movq %rax, %rbx
leal 0x1(%rbp), %eax
cmpl $0x2, %ebp
movl %eax, %ebp
jb 0x21dab
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq