// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
pushq %rax
movq %rdi, %rbx
incq %rsi
leaq -0x20(%rbp), %r14
movq %rsi, (%r14)
movq %r14, %rdi
callq 0x38180
movq (%r14), %rax
movzbl (%rax), %ecx
cmpl $0x73, %ecx
je 0x36ab1
cmpl $0x65, %ecx
je 0x36a5b
cmpl $0x6d, %ecx
je 0x36c30
cmpl $0x72, %ecx
je 0x36c30
cmpl $0x63, %ecx
jne 0x36a82
movzbl 0x1(%rax), %eax
cmpl $0x68, %eax
je 0x36aeb
cmpl $0x6c, %eax
jne 0x36ba3
leaq 0x20(%rbx), %r14
movq %r14, %rdi
callq 0x4206e
movb $0x1, 0x4d(%rbx)
jmp 0x36b38
movzbl 0x1(%rax), %eax
cmpl $0x61, %eax
je 0x36ad9
cmpl $0x79, %eax
jne 0x36b45
leaq 0x20(%rbx), %r14
movq %r14, %rdi
callq 0x4206e
movb $0x1, 0x4f(%rbx)
jmp 0x36b38
movq 0x40567(%rip), %rdi     # 0x76ff0
leaq 0x228b6(%rip), %rsi     # 0x59346
callq 0x94b0
leaq 0x246d6(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl $0x679, %esi            # imm = 0x679
jmp 0x36bf9
movzbl 0x1(%rax), %eax
cmpl $0x61, %eax
je 0x36b74
cmpl $0x79, %eax
jne 0x36bcf
leaq 0x20(%rbx), %r14
movq %r14, %rdi
callq 0x4206e
movb $0x1, 0x4e(%rbx)
jmp 0x36b38
leaq 0x20(%rbx), %r14
movq %r14, %rdi
callq 0x4206e
movb $0x1, 0x50(%rbx)
jmp 0x36b38
leaq 0x20(%rbx), %r14
movq %r14, %rdi
callq 0x4206e
movq 0x10(%rbx), %rax
cmpl $0xc, 0x2c(%rax)
jne 0x36b28
leaq -0x20(%rbp), %rdi
callq 0x38180
movq %rax, %r15
callq 0x38d94
movq 0x3138(%rax), %rsi
pushq $0x3
popq %rdx
movq %r15, %rdi
callq 0x9260
testl %eax, %eax
jne 0x36b38
movq -0x20(%rbp), %rdi
callq 0x383d1
cltq
movb $0x1, 0x50(%rax,%rbx)
movq %r14, %rdi
callq 0x4208a
jmp 0x36c30
movq 0x404a4(%rip), %rdi     # 0x76ff0
leaq 0x227f3(%rip), %rsi     # 0x59346
callq 0x94b0
leaq 0x24613(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl $0x670, %esi            # imm = 0x670
jmp 0x36bf9
callq 0x38d94
cmpb $0x0, 0x31a5(%rax)
jne 0x36b94
callq 0x38d94
cmpb $0x1, 0x31a6(%rax)
jne 0x36c30
movq 0x10(%rbx), %rax
incl 0x164(%rax)
jmp 0x36cd4
movq 0x40446(%rip), %rdi     # 0x76ff0
leaq 0x22795(%rip), %rsi     # 0x59346
callq 0x94b0
leaq 0x245b5(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl $0x64e, %esi            # imm = 0x64E
jmp 0x36bf9
movq 0x4041a(%rip), %rdi     # 0x76ff0
leaq 0x22769(%rip), %rsi     # 0x59346
callq 0x94b0
leaq 0x24589(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl $0x65d, %esi            # imm = 0x65D
callq 0x9890
leaq 0x2281a(%rip), %rsi     # 0x5941f
movq %rax, %rdi
callq 0x94b0
leaq 0x227c3(%rip), %rsi     # 0x593d7
movq %rax, %rdi
callq 0x94b0
movq -0x20(%rbp), %rsi
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
callq 0x99e8
movq 0x10(%rbx), %rax
movl 0x2c(%rax), %eax
cmpl $0xc, %eax
je 0x36cd4
movq 0x40379(%rip), %rdi     # 0x76fc0
leaq 0x2423d(%rip), %rsi     # 0x5ae8b
testl %eax, %eax
jne 0x36c77
callq 0x94b0
movq %rax, %rbx
callq 0x38d94
leaq 0x3138(%rax), %rsi
movq %rbx, %rdi
callq 0x9430
leaq 0x22775(%rip), %rsi     # 0x593ea
jmp 0x36cb8
callq 0x94b0
movq %rax, %r14
callq 0x38d94
leaq 0x3138(%rax), %rsi
movq %r14, %rdi
callq 0x9430
leaq 0x23f0a(%rip), %rsi     # 0x5aba4
movq %rax, %rdi
callq 0x94b0
movq 0x10(%rbx), %rcx
movl 0x2c(%rcx), %esi
movq %rax, %rdi
callq 0x9890
leaq 0x22738(%rip), %rsi     # 0x593f0
movq %rax, %rdi
callq 0x94b0
movq -0x20(%rbp), %rsi
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
callq 0x99e8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop