// File: /workspace/github_cpp_makefile_star2_O3/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 $0x30, %rsp
movq %rdi, %rbx
leaq 0x1(%rsi), %r14
movq %r14, -0x28(%rbp)
movzbl 0x1(%rsi), %eax
cmpl $0x6f, %eax
je 0x3ff70
cmpl $0x73, %eax
je 0x40139
cmpl $0x72, %eax
jne 0x3fff8
movl $0x72, %edi
callq 0x97c0
testl %eax, %eax
je 0x3fef6
movb 0x1(%r14), %r15b
incq %r14
movsbl %r15b, %edi
callq 0x97c0
testl %eax, %eax
jne 0x3fed9
movq %r14, -0x28(%rbp)
testb %r15b, %r15b
je 0x3ff18
incq %r14
movq %r14, -0x28(%rbp)
movsbl (%r14), %r15d
movl %r15d, %edi
callq 0x97c0
incq %r14
testl %r15d, %r15d
je 0x3ff15
testl %eax, %eax
je 0x3fef9
decq %r14
movabsq $-0x100000000, %r15     # imm = 0xFFFFFFFF00000000
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %r14, %rcx
addq %rax, %r15
cmpb $0x29, (%rcx)
leaq 0x1(%rcx), %rcx
jne 0x3ff2f
sarq $0x20, %r15
leaq 0x31780a(%rip), %r12    # 0x357750
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x9270
movb $0x0, (%r15,%r12)
movq %rbx, %rdi
movq %r12, %rsi
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x432ac
movq %rsi, %r15
movb 0xe(%rsi), %al
movq 0x10(%rbx), %rcx
cmpb 0x28(%rcx), %al
jne 0x40139
addq $0xe, %r15
cmpb $0x20, (%r15)
leaq 0x1(%r15), %r15
jne 0x3ff87
movq %r15, %rdi
callq 0x9200
movslq %eax, %r14
leaq 0x3177ad(%rip), %r12    # 0x357750
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x9270
movb $0x0, (%r14,%r12)
movq 0x10(%rbx), %rbx
leaq -0x38(%rbp), %r14
movq %r14, -0x10(%r14)
movq %r12, %rdi
callq 0x9200
leaq (%rax,%r12), %rdx
leaq -0x48(%rbp), %rdi
movq %r12, %rsi
callq 0x1362e
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x3be62
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
jne 0x4012d
jmp 0x40139
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x40030
movabsq $0x680000000001, %rcx   # imm = 0x680000000001
cmpb $0x2e, %al
ja 0x4001a
movzbl %al, %eax
btq %rax, %rcx
jb 0x4002c
movb 0x1(%r14), %al
incq %r14
movsbl %al, %edx
addl $-0x30, %edx
cmpl $0xa, %edx
jae 0x4000d
movq %r14, -0x28(%rbp)
leaq -0x28(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x93a0
movq (%r15), %rdi
cmpb $0x75, 0x2(%rdi)
jne 0x40139
movb (%rdi), %al
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
movsd %xmm0, -0x50(%rbp)
jb 0x4008a
movabsq $0x680000000001, %rcx   # imm = 0x680000000001
cmpb $0x2e, %al
ja 0x40075
movzbl %al, %eax
btq %rax, %rcx
jb 0x40086
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %edx
addl $-0x30, %edx
cmpl $0xa, %edx
jae 0x40068
movq %rdi, -0x28(%rbp)
leaq -0x28(%rbp), %r15
movq %r15, %rsi
movl $0xa, %edx
callq 0x9680
movq %rax, %r14
movq (%r15), %rsi
cmpb $0x22, (%rsi)
leaq 0x1(%rsi), %rsi
jne 0x400a1
movabsq $-0x100000000, %r15     # imm = 0xFFFFFFFF00000000
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rsi, -0x28(%rbp)
movq %rsi, %rcx
addq %rax, %r15
cmpb $0x22, (%rcx)
leaq 0x1(%rcx), %rcx
jne 0x400c5
sarq $0x20, %r15
leaq 0x317674(%rip), %r12    # 0x357750
movq %r12, %rdi
movq %r15, %rdx
callq 0x9270
movb $0x0, (%r15,%r12)
movq 0x10(%rbx), %rbx
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
movq %r12, %rdi
callq 0x9200
leaq (%rax,%r12), %rdx
leaq -0x48(%rbp), %rdi
movq %r12, %rsi
callq 0x1362e
leaq -0x48(%rbp), %rdx
movq %rbx, %rdi
movsd -0x50(%rbp), %xmm0
movl %r14d, %esi
callq 0x3be7a
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x40139
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x94e0
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
jne 0x40160
jmp 0x40173
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x40173
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x94e0
jmp 0x40173
jmp 0x40170
movq %rax, %rbx
movq %rbx, %rdi
callq 0x98b0
nop