// File: /workspace/github_cpp_makefile_star2_O2/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)
pushq $0x1
popq %r12
cmpl 0x8(%rsp), %r12d
jge 0x143c8
movslq %r12d, %r13
movq (%rsp), %rax
movq (%rax,%r13,8), %r15
leaq 0x4e1c5(%rip), %rbp     # 0x623c0
xorl %ebx, %ebx
pushq $0xf
popq %r14
cmpq $0xe, %rbx
je 0x14222
movq (%rbp), %rsi
movq %r15, %rdi
callq 0x6570
testl %eax, %eax
cmovel %ebx, %r14d
incq %rbx
addq $0x20, %rbp
jmp 0x14201
cmpl $0xd, %r14d
ja 0x143d7
movl %r14d, %eax
leaq 0x30b26(%rip), %rcx     # 0x44d5c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
incl %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r13,8), %rdi
callq 0x6600
movl %eax, %edi
callq 0x35815
andl $0x0, 0x14(%rsp)
leaq 0x14(%rsp), %rdi
jmp 0x1435c
pushq $0x1
popq %rdi
callq 0x3ac84
jmp 0x143c0
incl %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r13,8), %rdi
callq 0x6600
movl %eax, %edi
callq 0x32c30
jmp 0x143c0
incl %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r13,8), %rdi
callq 0x64d0
callq 0x35650
jmp 0x143c0
incl %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r13,8), %rdi
callq 0x6600
movl %eax, %edi
callq 0x3ce80
jmp 0x143c0
incl %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r13,8), %rdi
callq 0x6600
leaq 0x4d5d4(%rip), %rcx     # 0x618b4
cmpl %eax, (%rcx)
sete %cl
leal -0x1(%rax), %edx
cmpl $0x13, %edx
setae %dl
orb %cl, %dl
jne 0x143c0
movl %eax, %edi
callq 0x3ac8c
callq 0x32c3f
jmp 0x143c0
incl %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r13,8), %rdi
callq 0x64d0
callq 0x3586d
movl $0x1, 0xc(%rsp)
leaq 0xc(%rsp), %rdi
jmp 0x1435c
pushq $0x1
popq %rdi
callq 0x32c37
jmp 0x143c0
incl %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r13,8), %rdi
callq 0x64d0
callq 0x35864
movl $0x2, 0x10(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x35804
jmp 0x143c0
incl %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r13,8), %rdi
callq 0x64d0
callq 0x3b0f3
jmp 0x143c0
pushq $0x1
popq %rdi
callq 0x35648
jmp 0x143c0
incl %r12d
movq (%rsp), %rax
movq 0x8(%rax,%r13,8), %rdi
callq 0x6600
movl %eax, %edi
callq 0x3d2ac
xorl %edi, %edi
callq 0x3d2b3
jmp 0x143c0
xorl %edi, %edi
callq 0xf33c
jmp 0x143c0
pushq $0x1
popq %rbx
movl %ebx, %edi
callq 0x32c37
movl %ebx, %edi
callq 0x32c28
incl %r12d
jmp 0x141de
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4cbda(%rip), %r14     # 0x60fb8
leaq 0x4dfdb(%rip), %r15     # 0x623c0
leaq 0x4e194(%rip), %r12     # 0x62580
leaq 0x30b9f(%rip), %rbx     # 0x44f92
xorl %r13d, %r13d
cmpq $0x1c0, %r13            # imm = 0x1C0
je 0x1441c
movq (%r14), %rdi
movq (%r13,%r15), %rdx
movq (%r13,%r12), %rcx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6590
addq $0x20, %r13
jmp 0x143f6
pushq $0x1
popq %rdi
callq 0x64b0