// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/gtp/Gtp.cpp
// Function: GTP_cgos_genmove_analyze()
static void
GTP_cgos_genmove_analyze( void )
{
  std::ostringstream oss;
  std::string analyze_data;
  char pos[10];
  char *command;
  char c;
  int color;
  int point = PASS;

  StopPondering();

  command = STRTOK(input_copy, DELIM, &next_token);
  
  CHOMP(command);

  command = STRTOK(NULL, DELIM, &next_token);
  if (command == NULL){
    GTP_response(err_genmove, true);
    return;
  }
  CHOMP(command);
  c = static_cast<char>(tolower(static_cast<int>(command[0])));
  if (c == 'w') {
    color = S_WHITE;
  } else if (c == 'b') {
    color = S_BLACK;
  } else {
    GTP_response(err_genmove, true);
    return;
  }

  player_color = color;
  
  point = UctSearchGenmove(game, color, -1);
  if (point != RESIGN) {
    PutStone(game, point, color);

  }
  CgosAnalyzeData data(GetRootNode(), color);
  analyze_data = data.GetJsonData();

  IntegerToString(point, pos);

  oss << "\n";
  oss << analyze_data << "\n";
  oss << "play " << pos;
  
  GTP_response(oss.str().c_str(), true);

  UctSearchPondering(game, GetOppositeColor(color), -1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x270, %rsp            # imm = 0x270
leaq 0xf8(%rsp), %rdi
callq 0x6560
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
callq 0x4a61e
leaq 0x55b8e(%rip), %rdi     # 0x76280
leaq 0x3cd09(%rip), %rsi     # 0x5d402
callq 0x6650
movq %rax, %rbx
movq %rax, %rdi
callq 0x6160
cmpb $0xa, -0x1(%rbx,%rax)
jne 0x20715
movb $0x0, -0x1(%rbx,%rax)
leaq 0x3cce6(%rip), %rsi     # 0x5d402
xorl %edi, %edi
callq 0x6650
testq %rax, %rax
je 0x2075a
movq %rax, %rbx
movq %rax, %rdi
callq 0x6160
cmpb $0xa, -0x1(%rbx,%rax)
jne 0x2073f
movb $0x0, -0x1(%rbx,%rax)
movsbl (%rbx), %edi
callq 0x65d0
cmpb $0x77, %al
je 0x20770
movzbl %al, %eax
cmpl $0x62, %eax
jne 0x2075a
movl $0x1, %ebx
jmp 0x20775
leaq 0x3cca3(%rip), %rdi     # 0x5d404
movl $0x1, %esi
callq 0x21c1a
jmp 0x2090f
movl $0x2, %ebx
movl %ebx, 0x54cc5(%rip)     # 0x75440
movq 0x55c0e(%rip), %rdi     # 0x76390
movl %ebx, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4a6af
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x207a5
movq 0x55bf4(%rip), %rdi     # 0x76390
movl %ebp, %esi
movl %ebx, %edx
callq 0x55134
callq 0x4a232
leaq 0x50(%rsp), %rdi
movq %rax, %rsi
movl %ebx, %edx
callq 0x21efe
movq %rsp, %rdi
leaq 0x50(%rsp), %rsi
callq 0x221fa
leaq 0x20(%rsp), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x6500
movq (%r14), %rdi
leaq 0x10(%rsp), %r12
cmpq %r12, %rdi
je 0x207f0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6420
leaq 0x46(%rsp), %rsi
movl %ebp, %edi
callq 0x55a79
leaq 0x3fd42(%rip), %rsi     # 0x60545
leaq 0xf8(%rsp), %rdi
movl $0x1, %edx
callq 0x64a0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0xf8(%rsp), %rdi
callq 0x64a0
leaq 0x3fd12(%rip), %rsi     # 0x60545
movl $0x1, %edx
movq %rax, %rdi
callq 0x64a0
leaq 0x3d35f(%rip), %rsi     # 0x5dba6
leaq 0xf8(%rsp), %rdi
movl $0x5, %edx
callq 0x64a0
leaq 0x46(%rsp), %r14
movq %r14, %rdi
callq 0x6160
leaq 0xf8(%rsp), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x64a0
leaq 0x100(%rsp), %rsi
movq %rsp, %rdi
callq 0x6680
movq (%rsp), %rdi
movl $0x1, %esi
callq 0x21c1a
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x208ad
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6420
movq 0x55adc(%rip), %rdi     # 0x76390
xorl $0x3, %ebx
movl %ebx, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4afec
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x208e4
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x6420
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x20905
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x6420
leaq 0x60(%rsp), %rdi
callq 0x226f6
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x20926
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6420
movq 0x5466b(%rip), %rsi     # 0x74f98
leaq 0xf8(%rsp), %rdi
callq 0x61f0
leaq 0x168(%rsp), %rdi
callq 0x60f0
addq $0x270, %rsp            # imm = 0x270
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x20980
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6420
jmp 0x20980
jmp 0x2097d
jmp 0x2097d
jmp 0x20978
movq %rax, %rbx
jmp 0x2098a
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x224e8
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x209a1
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6420
movq 0x545f0(%rip), %rsi     # 0x74f98
leaq 0xf8(%rsp), %rdi
callq 0x61f0
leaq 0x168(%rsp), %rdi
callq 0x60f0
movq %rbx, %rdi
callq 0x6770