// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Parser.cpp
// Function: Parser::ParseSound(char*)
void Parser::ParseSound(char *msg) {
  char *end;
  int n;
  static char buffer[MAX_MESSAGE];

  msg++;
  if (msg[0] == 'r') // referee
  {
    parser::get_next_word(&msg);
    end = msg;
    while (*end != ')')
      end++;
    n = end - msg;
    strncpy(buffer, msg, n * sizeof(char));
    buffer[n] = '\0';

    ParseRefereeMsg(buffer);
  } else if (msg[0] == 's') // self
  {
    // self say
  } else if (msg[0] == 'o') // coach say
  {
    msg += 13; /** online_coach_ */
    if (msg[0] == mpObserver->OurInitSide()) {
      while (*msg != ' ')
        ++msg;
      ++msg;

      end = msg;
      //  while (*end != ')' || *(end + 1) != ')') end++; //
      //  对手阵型信息中有可能包含右括号
      n = strlen(msg);
      strncpy(buffer, msg, n * sizeof(char));
      buffer[n] = '\0';

      mpObserver->HearOurCoachSay(std::string(buffer));
    } else {
      // opponent coach say
    }
  } else // player say
  {      // dir our|opp unum
    AngleDeg dir = parser::get_double(&msg);
    if (msg[2] == 'u') { // our
      Unum unum = parser::get_int(&msg);
      while (*msg != '\"')
        msg++;
      msg++;
      end = msg;
      while (*end != '\"')
        end++;
      n = end - msg;
      strncpy(buffer, msg, n * sizeof(char));
      buffer[n] = '\0';

      mpObserver->HearTeammateSay(dir, unum, std::string(buffer));
    } else {
      // opponent player say
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x1(%rsi), %rax
movq %rax, -0x30(%rbp)
movzbl 0x1(%rsi), %eax
cmpl $0x6f, %eax
je 0x360ba
cmpl $0x73, %eax
je 0x361d8
cmpl $0x72, %eax
jne 0x360e1
movabsq $-0x100000000, %r14     # imm = 0xFFFFFFFF00000000
movabsq $0x100000000, %r12      # imm = 0x100000000
leaq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x38180
movq (%r15), %rsi
movq %rsi, %rax
addq %r12, %r14
cmpb $0x29, (%rax)
leaq 0x1(%rax), %rax
jne 0x36083
sarq $0x20, %r14
leaq 0x3146b6(%rip), %r15    # 0x34a750
movq %r15, %rdi
movq %r14, %rdx
callq 0x9290
movb $0x0, (%r14,%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x38064
jmp 0x361d8
movq %rsi, %r14
movb 0xe(%rsi), %al
movq 0x10(%rbx), %rcx
cmpb 0x28(%rcx), %al
jne 0x361d8
addq $0xf, %r14
cmpb $0x20, %al
je 0x36186
movb (%r14), %al
incq %r14
jmp 0x360d1
leaq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x381af
movq (%r14), %rax
cmpb $0x75, 0x2(%rax)
jne 0x361d8
movsd %xmm0, -0x38(%rbp)
leaq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x38103
movl %eax, %r14d
movq (%r15), %rsi
cmpb $0x22, (%rsi)
leaq 0x1(%rsi), %rsi
movq %rsi, -0x30(%rbp)
jne 0x36111
movabsq $-0x100000000, %r15     # imm = 0xFFFFFFFF00000000
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rsi, %rcx
addq %rax, %r15
cmpb $0x22, (%rcx)
leaq 0x1(%rcx), %rcx
jne 0x36135
sarq $0x20, %r15
leaq 0x314604(%rip), %r12    # 0x34a750
movq %r12, %rdi
movq %r15, %rdx
callq 0x9290
movb $0x0, (%r15,%r12)
movq 0x10(%rbx), %rbx
leaq -0x58(%rbp), %rdi
leaq -0x21(%rbp), %rdx
movq %r12, %rsi
callq 0x10e4a
leaq -0x58(%rbp), %rdx
movq %rbx, %rdi
movsd -0x38(%rbp), %xmm0
movl %r14d, %esi
callq 0x3313a
jmp 0x361cf
movq %r14, -0x30(%rbp)
movq %r14, %rdi
callq 0x9210
movslq %eax, %r15
leaq 0x3145b4(%rip), %r12    # 0x34a750
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x9290
movb $0x0, (%r15,%r12)
movq 0x10(%rbx), %rbx
leaq -0x58(%rbp), %rdi
leaq -0x21(%rbp), %rdx
movq %r12, %rsi
callq 0x10e4a
leaq -0x58(%rbp), %rsi
movq %rbx, %rdi
callq 0x33122
leaq -0x58(%rbp), %rdi
callq 0x9240
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x361e7
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x9240
jmp 0x361fa
jmp 0x361f7
movq %rax, %rbx
movq %rbx, %rdi
callq 0x98b0