// File: /workspace/github_cpp_makefile_star2_O1/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::ParseReceivedTeammateMsg(unsigned char*)
void CommunicateSystem::ParseReceivedTeammateMsg(unsigned char *msg) {
  DWORD64 bits;
  // cerr << mpObserver->CurrentTime() << " (h) " << msg << endl;

  Decode(msg, bits);

  DWORD64 mask = 1;
  mask <<= (MAX_BITS_USED + mCommuFlagBitCount);
  mask -= 1;
  bits += ~mask; //高三位补1

  CommuType type = static_cast<CommuType>(bits & mCommuFlagMask);
  bits >>= mCommuFlagBitCount;

  if (type == FREE_FORM) {
    Logger::instance().GetTextLogger("receive") << "freeform" << endl;
    RecvFreeForm(bits);
  } else {
    Logger::instance().GetTextLogger("receive") << "???" << endl;
    PRINT_ERROR(msg);
    // TODO: 其他信息
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x9200
testl %eax, %eax
jle 0x1d99f
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %ecx
xorl %esi, %esi
leaq 0x701a5(%rip), %rdi     # 0x8db20
xorl %edx, %edx
movzbl (%rbx,%rsi), %r8d
movslq (%rdi,%r8,4), %r8
imulq %rcx, %r8
addq %r8, %rdx
leaq (%rcx,%rcx,8), %r8
leaq (%rcx,%r8,8), %rcx
incq %rsi
cmpq %rsi, %rax
jne 0x1d97d
jmp 0x1d9a1
xorl %edx, %edx
movl 0x40(%r14), %eax
movl 0x69b65(%rip), %ecx     # 0x87510
addl %eax, %ecx
movq $-0x1, %r12
shlq %cl, %r12
addq %rdx, %r12
movq %r12, %r15
movl %eax, %ecx
sarq %cl, %r15
movl 0x48(%r14), %r13d
callq 0x35b4a
leaq 0x4e8ea(%rip), %rsi     # 0x6c2bc
movq %rax, %rdi
callq 0x35d5e
testl %r12d, %r13d
je 0x1daaf
leaq 0x4e378(%rip), %rsi     # 0x6bd62
movq %rax, %rdi
callq 0x1f454
movq %rax, %r14
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1da38
movq %r14, %r15
addq $0x210, %r15            # imm = 0x210
movq 0x210(%r14), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %r15, %rdi
callq 0x9070
movq %rax, %rdi
callq 0x9330
movq 0x695b1(%rip), %r14     # 0x86ff0
leaq 0x4e790(%rip), %rsi     # 0x6c1d6
movl $0x1c, %edx
movq %r14, %rdi
callq 0x9560
leaq 0x51768(%rip), %rsi     # 0x6f1c2
movl $0x1, %edx
movq %r14, %rdi
callq 0x9560
movq %r14, %rdi
movl $0x258, %esi            # imm = 0x258
callq 0x9880
movq %rax, %r14
leaq 0x4fa01(%rip), %rsi     # 0x6d47f
movl $0x3, %edx
movq %rax, %rdi
callq 0x9560
testq %rbx, %rbx
je 0x1db1d
movq %rbx, %rdi
callq 0x9200
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x9560
jmp 0x1db37
leaq 0x4e785(%rip), %rsi     # 0x6c23b
movq %rax, %rdi
callq 0x1f40a
movq %rax, %rbx
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1db04
movq %rbx, %r12
addq $0x210, %r12            # imm = 0x210
movq 0x210(%rbx), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %r12, %rdi
callq 0x9070
movq %rax, %rdi
callq 0x9330
movq %r14, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1ea44
movq (%r14), %rax
movq -0x18(%rax), %rax
movq %r14, %rdi
addq %rax, %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x9860
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %r14, %rdi
callq 0x9070
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9330