// File: /workspace/github_cpp_makefile_star2_O1/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), %r15d
cmpl $0x6f, %r15d
je 0x4109b
cmpl $0x73, %r15d
je 0x4127c
movsbl %r15b, %edi
cmpl $0x72, %r15d
jne 0x4112c
callq 0x97c0
testl %eax, %eax
je 0x4101e
movb 0x1(%r14), %r15b
incq %r14
movsbl %r15b, %edi
callq 0x97c0
testl %eax, %eax
jne 0x41006
movq %r14, -0x28(%rbp)
testb %r15b, %r15b
je 0x41042
incq %r14
movq %r14, -0x28(%rbp)
movsbl (%r14), %r15d
movl %r15d, %edi
callq 0x97c0
testl %r15d, %r15d
je 0x41042
incq %r14
testl %eax, %eax
je 0x41026
movabsq $-0x100000000, %r14     # imm = 0xFFFFFFFF00000000
movabsq $0x100000000, %rax      # imm = 0x100000000
movq -0x28(%rbp), %rsi
movq %rsi, %rcx
addq %rax, %r14
cmpb $0x29, (%rcx)
leaq 0x1(%rcx), %rcx
jne 0x4105d
sarq $0x20, %r14
leaq 0x3196dc(%rip), %r15    # 0x35a750
movq %r15, %rdi
movq %r14, %rdx
callq 0x9270
movb $0x0, (%r14,%r15)
movq %rbx, %rdi
movq %r15, %rsi
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4456c
leaq 0xe(%rsi), %rax
movq %rax, -0x28(%rbp)
movb 0xe(%rsi), %al
movq 0x10(%rbx), %rcx
cmpb 0x28(%rcx), %al
jne 0x4127c
movq -0x28(%rbp), %r14
cmpb $0x20, (%r14)
leaq 0x1(%r14), %r14
jne 0x410b7
movq %r14, -0x28(%rbp)
movq %r14, %rdi
callq 0x9200
movslq %eax, %r15
leaq 0x319679(%rip), %r12    # 0x35a750
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x9270
movb $0x0, (%r15,%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 0x13766
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x3ce32
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
jne 0x41270
jmp 0x4127c
addl $-0x30, %edi
cmpl $0xa, %edi
jb 0x4116c
movq -0x28(%rbp), %rcx
movabsq $0x680000000001, %rax   # imm = 0x680000000001
cmpb $0x2e, %r15b
ja 0x41152
movzbl %r15b, %edx
btq %rdx, %rax
jb 0x41168
movb 0x1(%r14), %r15b
incq %r14
movsbl %r15b, %edx
addl $-0x30, %edx
movq %r14, %rcx
cmpl $0xa, %edx
jae 0x41142
movq %rcx, -0x28(%rbp)
leaq -0x28(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x93a0
movq (%r15), %rdi
cmpb $0x75, 0x2(%rdi)
jne 0x4127c
movb (%rdi), %al
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
movsd %xmm0, -0x50(%rbp)
jb 0x411cd
movq -0x28(%rbp), %rdx
movabsq $0x680000000001, %rcx   # imm = 0x680000000001
cmpb $0x2e, %al
ja 0x411b5
movzbl %al, %eax
btq %rax, %rcx
jb 0x411c9
movb 0x1(%rdi), %al
incq %rdi
movsbl %al, %esi
addl $-0x30, %esi
movq %rdi, %rdx
cmpl $0xa, %esi
jae 0x411a8
movq %rdx, -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 0x411e4
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 0x41208
sarq $0x20, %r15
leaq 0x319531(%rip), %r12    # 0x35a750
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 0x13766
leaq -0x48(%rbp), %rdx
movq %rbx, %rdi
movsd -0x50(%rbp), %xmm0
movl %r14d, %esi
callq 0x3ce4a
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x4127c
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 0x412a3
jmp 0x412b6
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x412b6
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x94e0
jmp 0x412b6
jmp 0x412b3
movq %rax, %rbx
movq %rbx, %rdi
callq 0x98b0