// File: /workspace/github_cpp_makefile_star2_O3/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 0x1d5df
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %ecx
xorl %esi, %esi
leaq 0x6d565(%rip), %rdi     # 0x8ab20
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 0x1d5bd
jmp 0x1d5e1
xorl %edx, %edx
movl 0x40(%r14), %eax
movl 0x66f25(%rip), %ecx     # 0x84510
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 0x34c60
leaq 0x4cc99(%rip), %rsi     # 0x6a2ab
movq %rax, %rdi
callq 0x34e74
testl %r12d, %r13d
je 0x1d6ef
leaq 0x4c738(%rip), %rsi     # 0x69d62
movq %rax, %rdi
callq 0x1efb6
movq %rax, %r14
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1d678
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 0x66971(%rip), %r14     # 0x83ff0
leaq 0x4cb50(%rip), %rsi     # 0x6a1d6
movl $0x1c, %edx
movq %r14, %rdi
callq 0x9560
leaq 0x4faf8(%rip), %rsi     # 0x6d192
movl $0x1, %edx
movq %r14, %rdi
callq 0x9560
movq %r14, %rdi
movl $0x258, %esi            # imm = 0x258
callq 0x9880
movq %rax, %r14
leaq 0x4dd99(%rip), %rsi     # 0x6b457
movl $0x3, %edx
movq %rax, %rdi
callq 0x9560
testq %rbx, %rbx
je 0x1d75d
movq %rbx, %rdi
callq 0x9200
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x9560
jmp 0x1d777
leaq 0x4cb45(%rip), %rsi     # 0x6a23b
movq %rax, %rdi
callq 0x1ef6c
movq %rax, %rbx
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1d744
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 0x1e5a6
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