// File: /workspace/github_cpp_makefile_star2_O3/wrighteagle2d[P]wrighteaglebase/Debug/../src/Parser.cpp
// Function: Parser::ParsePlayer(char*)
Parser::ObjType Parser::ParsePlayer(char *msg) {
  ObjType result;
  const char *team_name = PlayerParam::instance().teamName().c_str();
  int team_name_len = PlayerParam::instance().teamNameLen();

  result.type = OBJ_Player;
  msg += 1;          // 'p'
  if (*msg == ' ') { /* there's a team */
    msg += 2;        // skip space and "
    if (msg[team_name_len] == '"' && !strncmp(msg, team_name, team_name_len)) {
      /* 一定要比较到双引号("),防止出现一个队名包含另一个的问题 */
      result.side = mpObserver->OurSide();
    } else {
      if (PlayerParam::instance().opponentTeamName().empty()) {
        int a = 0;
        char tmp[256];
        while (*msg != '"') {
          tmp[a++] = *msg++;
        }
        tmp[a] = '\0';
        PlayerParam::instance().setOpponentTeamName(tmp);
      }
      result.side = mpObserver->OppSide();
    }
    while (*msg != ' ' && *msg != ')') {
      msg++;
    }                  /* advance past team name */
    if (*msg == ' ') { /* there's a number */
      result.num = parser::get_int(&msg);
    }

    if (*msg == ' ') { // will be goalie
      msg += 1;
      if (!strncmp(msg, "goalie", 6)) { // there's goalie
        if (result.side == mpObserver->OurInitSide()) {
          // our goalie unum is no need to set
        } else {
          mpObserver->SeeOppGoalie(result.num);
        }
      }
      while (*msg != ' ' && *msg != ')') {
        msg++;
      } /* advance past goalie */
    }
  }
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdx, %r12
movq %rsi, -0x38(%rbp)
movq %rdi, %rbx
movabsq $0x500000038, %rax      # imm = 0x500000038
movq %rax, 0x4(%rdi)
movb $0x3f, 0xc(%rdi)
movq $0x0, 0x10(%rdi)
callq 0x43dce
movq 0x3138(%rax), %r13
callq 0x43dce
movslq 0x3158(%rax), %rdx
movl $0x4, (%rbx)
cmpb $0x20, 0x1(%r12)
jne 0x42f60
leaq 0x3(%r12), %r15
movq %r15, -0x30(%rbp)
cmpb $0x22, 0x3(%r12,%rdx)
jne 0x42e48
movq %r15, %rdi
movq %r13, %rsi
callq 0x9230
testl %eax, %eax
je 0x42e68
callq 0x43dce
movl $0x2a, %r14d
cmpq $0x0, 0x3168(%rax)
jne 0x42eaa
movb (%r15), %al
cmpb $0x22, %al
jne 0x42e70
xorl %eax, %eax
jmp 0x42e8a
movl $0x29, %r14d
jmp 0x42eaa
xorl %ecx, %ecx
movb %al, -0x140(%rbp,%rcx)
movb 0x4(%r12,%rcx), %al
incq %rcx
cmpb $0x22, %al
jne 0x42e72
movl %ecx, %eax
addq %rcx, %r15
movq %r15, -0x30(%rbp)
movb $0x0, -0x140(%rbp,%rax)
callq 0x43dce
leaq -0x140(%rbp), %rsi
movq %rax, %rdi
callq 0x4345e
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movb (%rax,%r14), %r14b
movb %r14b, 0xc(%rbx)
movzbl (%r15), %eax
cmpl $0x29, %eax
je 0x42f22
cmpl $0x20, %eax
je 0x42ecd
incq %r15
jmp 0x42eba
movq %r15, -0x30(%rbp)
movb $0x20, %cl
movabsq $0x680000000001, %rax   # imm = 0x680000000001
cmpb $0x2e, %cl
ja 0x42eeb
movzbl %cl, %ecx
btq %rcx, %rax
jb 0x42efd
movb 0x1(%r15), %cl
incq %r15
movsbl %cl, %edx
addl $-0x30, %edx
cmpl $0xa, %edx
jae 0x42edd
leaq -0x30(%rbp), %r13
movq %r15, (%r13)
movq %r15, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x9680
movq %rax, %r12
movl %r12d, 0x10(%rbx)
movq (%r13), %r15
jmp 0x42f29
movq %r15, -0x30(%rbp)
xorl %r12d, %r12d
cmpb $0x20, (%r15)
jne 0x42f60
incq %r15
movq %r15, -0x30(%rbp)
leaq 0x284cb(%rip), %rsi     # 0x6b408
movl $0x6, %edx
movq %r15, %rdi
callq 0x9230
testl %eax, %eax
jne 0x42f60
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
cmpb 0x28(%rax), %r14b
je 0x42f60
movl %r12d, 0x30(%rax)
movq %rbx, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop