// File: /workspace/github_cpp_makefile_star2_O3/kobanium[P]Ray/src/util/Command.cpp
// Function: AnalyzeCommand(int, char**)
void
AnalyzeCommand( int argc, char **argv )
{
  int n, size;
  
  for (int i = 1; i < argc; i++){
    n = COMMAND_MAX + 1;
    for (int j = 0; j < COMMAND_MAX; j++){
      if (!strcmp(argv[i], command[j].c_str())){
        n = j;
      }
    }

    switch (n) {
      case COMMAND_PLAYOUT:
        // プレイアウト数固定の探索の設定
        SetPlayout(atoi(argv[++i]));
        SetSearchSetting(SearchTimeStrategy::ConstantPlayoutMode);
        break;
      case COMMAND_TIME:
        // 持ち時間の設定
        SetTime(atof(argv[++i]));
        SetSearchSetting(SearchTimeStrategy::TimeControlMode);
        break;
      case COMMAND_SIZE:
        // 碁盤の大きさの設定
        size = atoi(argv[++i]);
        if (pure_board_size != size &&
            size > 0 && size <= PURE_BOARD_SIZE) {
          SetBoardSize(size);
          SetParameter();
        }
        break;
      case COMMAND_CONST_TIME:
        // 1手あたりの思考時間を固定した探索の設定
        SetConstThinkingTime(atof(argv[++i]));
        SetSearchSetting(SearchTimeStrategy::ConstantTimeMode);
        break;
      case COMMAND_THREAD:
        // 探索スレッド数の設定
        SetThread(atoi(argv[++i]));
        break;
      case COMMAND_KOMI:
        // コミの設定
        SetKomi(atof(argv[++i]));
        break;
      case COMMAND_HANDICAP:
        // 置き石の個数の設定
        SetConstHandicapNum(atoi(argv[++i]));
        SetHandicapNum(0);
        break;
      case COMMAND_REUSE_SUBTREE:
        // 探索結果の再利用の設定
        SetReuseSubtree(true);
        break;
      case COMMAND_PONDERING :
        // 予測読みの設定
        SetReuseSubtree(true);
        SetPonderingMode(true);
        break;
      case COMMAND_TREE_SIZE:
        // UCTのノードの個数の設定
        SetHashSize(static_cast<unsigned int>(atoi(argv[++i])));
        break;
      case COMMAND_SUPERKO:
        // 超劫のh判定の設定
        SetSuperKo(true);
        break;
      case COMMAND_RESIGN_THRESHOLD:
        SetResignThreshold(atof(argv[++i]));
        break;
      case COMMAND_CGOS_MODE:
        SetCaptureAllMode(true);
        break;
      case COMMAND_NO_DEBUG:
        // デバッグメッセージを出力しない設定
        SetDebugMessageMode(false);
        break;
      default:
        for (int j = 0; j < COMMAND_MAX; j++){
          fprintf(stderr, "%-22s : %s\n", command[j].c_str(), errmessage[j].c_str());
        }
        exit(1);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, (%rsp)
movl %edi, 0x8(%rsp)
cmpl $0x2, %edi
jl 0x23c67
movl $0x1, %r12d
movslq %r12d, %r14
movq (%rsp), %rax
movq (%rax,%r14,8), %r13
movl $0xf, %r15d
leaq 0x5393b(%rip), %rbp     # 0x773c0
xorl %ebx, %ebx
movq (%rbp), %rsi
movq %r13, %rdi
callq 0x6580
testl %eax, %eax
cmovel %ebx, %r15d
incq %rbx
addq $0x20, %rbp
cmpq $0xe, %rbx
jne 0x23a87
cmpl $0xd, %r15d
ja 0x23c76
movl %r15d, %eax
leaq 0x3a29e(%rip), %rcx     # 0x5dd58
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leal 0x1(%r14), %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r14,8), %rdi
callq 0x6630
movl %eax, %edi
callq 0x4d3f5
movl $0x0, 0x14(%rsp)
leaq 0x14(%rsp), %rdi
jmp 0x23bee
movl $0x1, %edi
callq 0x53d64
jmp 0x23c59
leal 0x1(%r14), %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r14,8), %rdi
callq 0x6630
movl %eax, %edi
callq 0x4a4cc
jmp 0x23c59
leal 0x1(%r14), %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r14,8), %rdi
callq 0x6500
callq 0x4d1d0
jmp 0x23c59
leal 0x1(%r14), %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r14,8), %rdi
callq 0x6630
movl %eax, %edi
callq 0x567ec
jmp 0x23c59
leal 0x1(%r14), %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r14,8), %rdi
callq 0x6630
leaq 0x52d46(%rip), %rcx     # 0x768b4
cmpl %eax, (%rcx)
sete %cl
leal -0x1(%rax), %edx
cmpl $0x13, %edx
setae %dl
orb %cl, %dl
jne 0x23c59
movl %eax, %edi
callq 0x53d6c
callq 0x4a4db
jmp 0x23c59
leal 0x1(%r14), %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r14,8), %rdi
callq 0x6500
callq 0x4d44d
movl $0x1, 0xc(%rsp)
leaq 0xc(%rsp), %rdi
jmp 0x23bee
movl $0x1, %edi
callq 0x4a4d3
jmp 0x23c59
leal 0x1(%r14), %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r14,8), %rdi
callq 0x6500
callq 0x4d444
movl $0x2, 0x10(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x4d3e4
jmp 0x23c59
leal 0x1(%r14), %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r14,8), %rdi
callq 0x6500
callq 0x54351
jmp 0x23c59
movl $0x1, %edi
callq 0x4d1c8
jmp 0x23c59
leal 0x1(%r14), %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r14,8), %rdi
callq 0x6630
movl %eax, %edi
callq 0x56ccc
xorl %edi, %edi
callq 0x56cd3
jmp 0x23c59
xorl %edi, %edi
callq 0x1ce9c
jmp 0x23c59
movl $0x1, %edi
callq 0x4a4d3
movl $0x1, %edi
callq 0x4a4c4
incl %r12d
cmpl 0x8(%rsp), %r12d
jl 0x23a6d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6915
nop