// File: /workspace/github_cpp_makefile_star2_O3/wrighteagle2d[P]wrighteaglebase/Debug/../src/Parser.cpp
// Function: Parser::ParseOkMsg(char*)
void Parser::ParseOkMsg(char *msg) {
  bool is_ok_say = false;

  msg++;
  parser::get_next_word(&msg);
  switch (msg[0]) {
  case 'c':
    switch (msg[1]) {
    case 'l':
      mOkMutex.Lock();
      mClangOk = true;
      mOkMutex.UnLock();
      break;
    case 'h':
      /*
      mOkMutex.Lock(); mChangePlayerTypeOk[parser::get_int(msg)] = true;
      mOkMutex.UnLock(); break;
      */
      mOkMutex.Lock();
      if ((!(mpObserver->SelfUnum() == TRAINER_UNUM)) ||
          std::strncmp(parser::get_next_word(&msg),
                       PlayerParam::instance().teamName().c_str(), 3) ==
              0) // Trainer接收到的信息包括己方和敌方，现在只处理己方
        mChangePlayerTypeOk[parser::get_int(msg)] = true;
      mOkMutex.UnLock();
      break;
    default:
      PRINT_ERROR("unknow ok message " << msg);
      break;
    }
    break;
  case 's':
    switch (msg[1]) {
    case 'y':
      mOkMutex.Lock();
      mSynchOk = true;
      mOkMutex.UnLock();
      break;
    case 'a':
      is_ok_say = true;
      break; /** (ok say) */
    default:
      PRINT_ERROR("unknow ok message " << msg);
      break;
    }
    break;
    //			case 'e': mOkMutex.Lock(); mEyeOnOk = true; mOkMutex.UnLock();
    //break;
  case 'e':
    switch (msg[1]) {
    case 'y':
      mOkMutex.Lock();
      mEyeOnOk = true;
      mOkMutex.UnLock();
      break;
    case 'a':
      mOkMutex.Lock();
      mEarOnOk = true;
      mOkMutex.UnLock();
      break;
    default:
      PRINT_ERROR("unknow ok message " << msg);
      break;
    }
    break;
  case 'm':
  case 'r': /*std::cout << "#" << PlayerParam::instance().teamName() << "
               Trainer: (" << msg << std::endl;*/
    break;
  default:
    PRINT_ERROR("unknow ok message " << msg);
    break;
  }

  if (is_ok_say && (PlayerParam::instance().isCoach() ||
                    PlayerParam::instance().isTrainer())) {
    mpObserver->SetCoachSayCount(mpObserver->GetCoachSayCount() + 1);
  } else {
    if (mpObserver->SelfUnum() == 0) {
      std::cout << "#" << PlayerParam::instance().teamName() << " Coach: ("
                << msg << std::endl;
    } else if (mpObserver->SelfUnum() == TRAINER_UNUM) {
      /*std::cout << "#" << PlayerParam::instance().teamName() << " Trainer: ("
       * << msg << std::endl;*/
    } else {
      std::cout << "#" << PlayerParam::instance().teamName() << " "
                << mpObserver->SelfUnum() << ": (" << msg << std::endl;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movb 0x1(%rsi), %r15b
incq %rbx
movsbl %r15b, %edi
callq 0x97c0
testl %eax, %eax
je 0x41209
movb 0x1(%rbx), %r15b
jmp 0x411f3
testb %r15b, %r15b
je 0x412b1
movsbl 0x1(%rbx), %r15d
incq %rbx
movl %r15d, %edi
callq 0x97c0
testl %r15d, %r15d
je 0x4122b
testl %eax, %eax
je 0x41212
movzbl %r15b, %eax
cmpl $0x6c, %eax
jle 0x41277
cmpl $0x6d, %eax
je 0x4151f
cmpl $0x72, %eax
je 0x4151f
cmpl $0x73, %eax
jne 0x412b1
movzbl 0x1(%rbx), %eax
cmpl $0x61, %eax
je 0x413b9
cmpl $0x79, %eax
jne 0x4143a
leaq 0x20(%r14), %r15
movq %r15, %rdi
callq 0x4e01a
movb $0x1, 0x4e(%r14)
jmp 0x41517
cmpl $0x63, %eax
je 0x4135a
cmpl $0x65, %eax
jne 0x412b1
movzbl 0x1(%rbx), %eax
cmpl $0x61, %eax
je 0x413e8
cmpl $0x79, %eax
jne 0x41476
leaq 0x20(%r14), %r15
movq %r15, %rdi
callq 0x4e01a
movb $0x1, 0x4f(%r14)
jmp 0x41517
movq 0x42d38(%rip), %r15     # 0x83ff0
leaq 0x2a0bf(%rip), %rsi     # 0x6b37e
movl $0x11, %edx
movq %r15, %rdi
callq 0x9560
leaq 0x2bebf(%rip), %rsi     # 0x6d192
movl $0x1, %edx
movq %r15, %rdi
callq 0x9560
movq %r15, %rdi
movl $0x679, %esi            # imm = 0x679
callq 0x9880
movq %rax, %r15
leaq 0x2a160(%rip), %rsi     # 0x6b457
movl $0x3, %edx
movq %rax, %rdi
callq 0x9560
leaq 0x2a104(%rip), %rsi     # 0x6b40f
movl $0x12, %edx
movq %r15, %rdi
callq 0x9560
movq %rbx, %rdi
callq 0x9200
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x9560
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %r15, %rdi
callq 0x9070
movq %rax, %rdi
callq 0x9330
jmp 0x4151f
movzbl 0x1(%rbx), %eax
cmpl $0x68, %eax
je 0x41382
cmpl $0x6c, %eax
jne 0x413fe
leaq 0x20(%r14), %r15
movq %r15, %rdi
callq 0x4e01a
movb $0x1, 0x4d(%r14)
jmp 0x41517
leaq 0x20(%r14), %r15
movq %r15, %rdi
callq 0x4e01a
movq 0x10(%r14), %rax
cmpl $0xc, 0x2c(%rax)
jne 0x414ed
movb (%rbx), %r12b
movsbl %r12b, %edi
callq 0x97c0
testl %eax, %eax
je 0x414b2
movb 0x1(%rbx), %r12b
incq %rbx
jmp 0x4139f
callq 0x43dce
cmpb $0x0, 0x31a5(%rax)
jne 0x413d9
callq 0x43dce
cmpb $0x1, 0x31a6(%rax)
jne 0x4151f
movq 0x10(%r14), %rax
incl 0x164(%rax)
jmp 0x41576
leaq 0x20(%r14), %r15
movq %r15, %rdi
callq 0x4e01a
movb $0x1, 0x50(%r14)
jmp 0x41517
movq 0x42beb(%rip), %r15     # 0x83ff0
leaq 0x29f72(%rip), %rsi     # 0x6b37e
movl $0x11, %edx
movq %r15, %rdi
callq 0x9560
leaq 0x2bd72(%rip), %rsi     # 0x6d192
movl $0x1, %edx
movq %r15, %rdi
callq 0x9560
movq %r15, %rdi
movl $0x64e, %esi            # imm = 0x64E
jmp 0x412e8
movq 0x42baf(%rip), %r15     # 0x83ff0
leaq 0x29f36(%rip), %rsi     # 0x6b37e
movl $0x11, %edx
movq %r15, %rdi
callq 0x9560
leaq 0x2bd36(%rip), %rsi     # 0x6d192
movl $0x1, %edx
movq %r15, %rdi
callq 0x9560
movq %r15, %rdi
movl $0x65d, %esi            # imm = 0x65D
jmp 0x412e8
movq 0x42b73(%rip), %r15     # 0x83ff0
leaq 0x29efa(%rip), %rsi     # 0x6b37e
movl $0x11, %edx
movq %r15, %rdi
callq 0x9560
leaq 0x2bcfa(%rip), %rsi     # 0x6d192
movl $0x1, %edx
movq %r15, %rdi
callq 0x9560
movq %r15, %rdi
movl $0x670, %esi            # imm = 0x670
jmp 0x412e8
testb %r12b, %r12b
je 0x414d0
movsbl 0x1(%rbx), %r12d
incq %rbx
movl %r12d, %edi
callq 0x97c0
testl %r12d, %r12d
je 0x414d0
testl %eax, %eax
je 0x414b7
callq 0x43dce
movq 0x3138(%rax), %rsi
movl $0x3, %edx
movq %rbx, %rdi
callq 0x9230
testl %eax, %eax
jne 0x41517
movb (%rbx), %al
movsbl %al, %ecx
addl $-0x30, %ecx
movq %rbx, %rdi
cmpl $0xa, %ecx
jae 0x41637
xorl %esi, %esi
movl $0xa, %edx
callq 0x9680
decl %eax
cltq
movb $0x1, 0x51(%r14,%rax)
movq %r15, %rdi
callq 0x4e036
movq 0x10(%r14), %rax
movl 0x2c(%rax), %eax
cmpl $0xc, %eax
je 0x41576
testl %eax, %eax
jne 0x4157f
movq 0x42a8a(%rip), %r14     # 0x83fc0
leaq 0x2b96e(%rip), %rsi     # 0x6ceab
movl $0x1, %edx
movq %r14, %rdi
callq 0x9560
callq 0x43dce
movq 0x3138(%rax), %rsi
movq 0x3140(%rax), %rdx
movq %r14, %rdi
callq 0x9560
movq %rax, %r14
leaq 0x29eb3(%rip), %rsi     # 0x6b422
movl $0x9, %edx
jmp 0x415ea
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x42a3a(%rip), %r15     # 0x83fc0
leaq 0x2b91e(%rip), %rsi     # 0x6ceab
movl $0x1, %edx
movq %r15, %rdi
callq 0x9560
callq 0x43dce
movq 0x3138(%rax), %rsi
movq 0x3140(%rax), %rdx
movq %r15, %rdi
callq 0x9560
movq %rax, %r15
leaq 0x2b605(%rip), %rsi     # 0x6cbc4
movl $0x1, %edx
movq %rax, %rdi
callq 0x9560
movq 0x10(%r14), %rax
movl 0x2c(%rax), %esi
movq %r15, %rdi
callq 0x9880
movq %rax, %r14
leaq 0x29e43(%rip), %rsi     # 0x6b428
movl $0x3, %edx
movq %rax, %rdi
callq 0x9560
movq %rbx, %rdi
callq 0x9200
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x9560
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %r14, %rdi
callq 0x9070
movq %rax, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9330
movabsq $0x680000000001, %rcx   # imm = 0x680000000001
movq %rbx, %rdi
cmpb $0x2e, %al
ja 0x41655
movzbl %al, %eax
btq %rax, %rcx
jb 0x41501
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
cmpl $0xa, %edx
jae 0x41644
jmp 0x41501
nop