// File: /workspace/github_cpp_makefile_star2_O3/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::RecvFreeForm(long)
void CommunicateSystem::RecvFreeForm(DWORD64 bits) {
  SetCommunicateType(FREE_FORM);

  FreeFormType type;
  int bit_left = MAX_BITS_USED;
  while (bit_left > 0) {
    type = static_cast<FreeFormType>(bits & mFreeFormFlagMask);
    if (type >= FREE_FORM_DUMMY) {
      break; // mCommuBits
             // 的左端全是1，可以用来作为结束标志，因为FREE_FORM_DUMMY是不用的
    }
    if (bit_left < mFreeFormCodecBitCount[type]) {
      break;
    }

    bits >>= mFreeFormFlagBitCount;
    bit_left -= mFreeFormFlagBitCount;

    if (type == BALL_WITH_SPEED) {
      AngleDeg dir = ExtractDataFromBits(bits, DIR, bit_left);
      double speed = ExtractDataFromBits(bits, BALL_SPEED, bit_left);
      double y = ExtractDataFromBits(bits, POS_Y, bit_left);
      double x = ExtractDataFromBits(bits, POS_X, bit_left);
      mpObserver->HearBall(Vector(x, y), Polar2Vector(speed, dir));
      Logger::instance().GetTextLogger("freeform")
          << mpObserver->CurrentTime() << " hear ball: " << Vector(x, y) << " "
          << Polar2Vector(speed, dir) << endl;
    } else if (type == BALL_WITH_ZERO_SPEED) {
      double y = ExtractDataFromBits(bits, POS_Y, bit_left);
      double x = ExtractDataFromBits(bits, POS_X, bit_left);
      mpObserver->HearBall(Vector(x, y), Vector(0.0, 0.0));
      Logger::instance().GetTextLogger("freeform")
          << mpObserver->CurrentTime() << " hear ball: " << Vector(x, y) << " "
          << Polar2Vector(0, 0) << endl;
    } else if (type == BALL_ONLY_POS) {
      double y = ExtractDataFromBits(bits, POS_Y, bit_left);
      double x = ExtractDataFromBits(bits, POS_X, bit_left);
      mpObserver->HearBall(Vector(x, y));
      Logger::instance().GetTextLogger("freeform")
          << mpObserver->CurrentTime() << " hear ball: " << Vector(x, y)
          << endl;
    } else if (type == TEAMMATE_ONLY_POS) {
      double y = ExtractDataFromBits(bits, POS_Y, bit_left);
      double x = ExtractDataFromBits(bits, POS_X, bit_left);
      Unum num = ExtractUnumFromBits(bits, bit_left);
      mpObserver->HearTeammate(num, Vector(x, y));
      Logger::instance().GetTextLogger("freeform")
          << mpObserver->CurrentTime() << " hear tm: " << num << " "
          << Vector(x, y) << endl;
    } else if (type == OPPONENT_ONLY_POS) {
      double y = ExtractDataFromBits(bits, POS_Y, bit_left);
      double x = ExtractDataFromBits(bits, POS_X, bit_left);
      Unum num = ExtractUnumFromBits(bits, bit_left);
      mpObserver->HearOpponent(num, Vector(x, y));
      Logger::instance().GetTextLogger("freeform")
          << mpObserver->CurrentTime() << " hear opp: " << num << " "
          << Vector(x, y) << endl;
    } else {
      PRINT_ERROR("recv free form error");
      return;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
leaq 0x80(%rdi), %rax
movq %rax, 0xc0(%rdi)
leaq 0x98(%rdi), %rax
movq %rax, 0xc8(%rdi)
movl 0x65f36(%rip), %r12d    # 0x84510
testl %r12d, %r12d
jle 0x1edaf
movq %rsi, %rbx
movq %rdi, %r14
movq 0x58(%r14), %rax
andq %rbx, %rax
cmpl $0x4, %eax
jg 0x1edaf
movl %eax, %ecx
cmpl 0xd0(%r14,%rcx,4), %r12d
jl 0x1edaf
movl 0x50(%r14), %ecx
sarq %cl, %rbx
cmpl $0x4, %eax
ja 0x1edbe
movl %ecx, -0x90(%rbp)
movl %eax, %eax
leaq 0x4bb34(%rip), %rcx     # 0x6a15c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
movq %rbx, %rsi
movl $0x4, %edx
callq 0x1d278
movsd %xmm0, -0x50(%rbp)
movq 0xc0(%r14), %rax
movl 0x10(%rax), %ecx
movl %ecx, -0x78(%rbp)
sarq %cl, %rbx
movq %r14, %rdi
movq %rbx, %rsi
movl $0x2, %edx
callq 0x1d278
movsd %xmm0, -0x48(%rbp)
movq 0xc0(%r14), %rax
movl 0x8(%rax), %ecx
movl %ecx, -0x80(%rbp)
sarq %cl, %rbx
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x1d278
movsd %xmm0, -0x58(%rbp)
movq 0xc0(%r14), %rax
movl 0x4(%rax), %ecx
movl %ecx, -0x2c(%rbp)
sarq %cl, %rbx
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x1d278
movq 0x8(%r14), %r15
movq 0xc0(%r14), %rax
movl (%rax), %ecx
movl %ecx, -0x8c(%rbp)
sarq %cl, %rbx
movsd %xmm0, -0x98(%rbp)
movsd %xmm0, -0x40(%rbp)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x50(%rbp), %xmm0
mulsd 0x4a969(%rip), %xmm0    # 0x69050
divsd 0x4a959(%rip), %xmm0    # 0x69048
movsd %xmm0, -0x50(%rbp)
leaq -0x70(%rbp), %r13
movq %r13, %rdi
leaq -0x88(%rbp), %rsi
callq 0x92d0
movsd -0x88(%rbp), %xmm0
movsd -0x48(%rbp), %xmm2
mulsd %xmm2, %xmm0
movsd -0x70(%rbp), %xmm1
mulsd %xmm2, %xmm1
movsd %xmm0, -0x70(%rbp)
movsd %xmm1, -0x68(%rbp)
movq %r15, %rdi
leaq -0x40(%rbp), %rsi
movq %r13, %rdx
callq 0x3c2fe
callq 0x34c60
movq %rax, %rdi
leaq 0x4baf2(%rip), %rsi     # 0x6a23b
callq 0x34e74
movq %rax, %r13
movq 0x8(%r14), %r15
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1e776
addq $0xc, %r15
leaq 0x210(%r13), %rdi
movq %r15, %rsi
callq 0xe974
movq %r13, %rdi
leaq 0x4baf2(%rip), %rsi     # 0x6a272
callq 0x1ee52
movq %rax, %r13
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1e7bd
leaq 0x210(%r13), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1efff
movq %r13, %rdi
leaq 0x4e3fd(%rip), %rsi     # 0x6cbc4
callq 0x13482
movq %rax, %r13
movsd -0x50(%rbp), %xmm0
leaq -0x70(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x92d0
movsd -0x88(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
mulsd -0x70(%rbp), %xmm1
movsd %xmm0, -0x70(%rbp)
movsd %xmm1, -0x68(%rbp)
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1e822
leaq 0x210(%r13), %rdi
leaq -0x70(%rbp), %rsi
callq 0x1efff
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1e865
movq %r13, %r15
addq $0x210, %r15            # imm = 0x210
movq 0x210(%r13), %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
movl -0x80(%rbp), %eax
addl -0x78(%rbp), %eax
movl -0x2c(%rbp), %ecx
addl -0x8c(%rbp), %ecx
addl %eax, %ecx
jmp 0x1ed9b
movl %r12d, -0x50(%rbp)
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x1d278
movsd %xmm0, -0x48(%rbp)
movq 0xc0(%r14), %rax
movl 0x4(%rax), %ecx
movl %ecx, -0x58(%rbp)
sarq %cl, %rbx
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x1d278
movq 0xc0(%r14), %rax
movl (%rax), %ecx
movl %ecx, -0x2c(%rbp)
sarq %cl, %rbx
movl 0x78(%r14), %r13d
andl %ebx, %r13d
movl 0x70(%r14), %ecx
movl %ecx, -0x78(%rbp)
sarq %cl, %rbx
movq 0x8(%r14), %rdi
movsd %xmm0, -0x80(%rbp)
movsd %xmm0, -0x40(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movl %r13d, %esi
leaq -0x40(%rbp), %rdx
callq 0x3c390
callq 0x34c60
movq %rax, %rdi
leaq 0x4b937(%rip), %rsi     # 0x6a23b
callq 0x34e74
movq %rax, %r12
movq 0x8(%r14), %r15
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1e932
addq $0xc, %r15
leaq 0x210(%r12), %rdi
movq %r15, %rsi
callq 0xe974
movq %r12, %rdi
leaq 0x4b94e(%rip), %rsi     # 0x6a28a
callq 0x1ee9c
jmp 0x1eb3c
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x1d278
movsd %xmm0, -0x50(%rbp)
movq 0xc0(%r14), %rax
movl 0x4(%rax), %ecx
movl %ecx, -0x48(%rbp)
sarq %cl, %rbx
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x1d278
movq 0xc0(%r14), %rax
movl (%rax), %ecx
movl %ecx, -0x2c(%rbp)
sarq %cl, %rbx
movq 0x8(%r14), %rdi
movsd %xmm0, -0x58(%rbp)
movsd %xmm0, -0x40(%rbp)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
leaq -0x40(%rbp), %rsi
callq 0x3c332
callq 0x34c60
movq %rax, %rdi
leaq 0x4b884(%rip), %rsi     # 0x6a23b
callq 0x34e74
movq %rax, %r13
movq 0x8(%r14), %r15
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1e9e4
addq $0xc, %r15
leaq 0x210(%r13), %rdi
movq %r15, %rsi
callq 0xe974
movq %r13, %rdi
leaq 0x4b884(%rip), %rsi     # 0x6a272
callq 0x1ee52
movq %rax, %r13
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1ea28
leaq 0x210(%r13), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1efff
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1ea6b
movq %r13, %r15
addq $0x210, %r15            # imm = 0x210
movq 0x210(%r13), %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
movl -0x2c(%rbp), %ecx
addl -0x48(%rbp), %ecx
jmp 0x1ed9b
movl %r12d, -0x50(%rbp)
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x1d278
movsd %xmm0, -0x48(%rbp)
movq 0xc0(%r14), %rax
movl 0x4(%rax), %ecx
movl %ecx, -0x58(%rbp)
sarq %cl, %rbx
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x1d278
movq 0xc0(%r14), %rax
movl (%rax), %ecx
movl %ecx, -0x2c(%rbp)
sarq %cl, %rbx
movl 0x78(%r14), %r13d
andl %ebx, %r13d
movl 0x70(%r14), %ecx
movl %ecx, -0x78(%rbp)
sarq %cl, %rbx
movq 0x8(%r14), %rdi
movsd %xmm0, -0x80(%rbp)
movsd %xmm0, -0x40(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movl %r13d, %esi
leaq -0x40(%rbp), %rdx
callq 0x3c354
callq 0x34c60
movq %rax, %rdi
leaq 0x4b73c(%rip), %rsi     # 0x6a23b
callq 0x34e74
movq %rax, %r12
movq 0x8(%r14), %r15
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1eb2d
addq $0xc, %r15
leaq 0x210(%r12), %rdi
movq %r15, %rsi
callq 0xe974
movq %r12, %rdi
leaq 0x4b748(%rip), %rsi     # 0x6a27f
callq 0x13538
movq %rax, %r12
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1eb5d
leaq 0x210(%r12), %rdi
movl %r13d, %esi
callq 0x9880
movq %r12, %rdi
leaq 0x4e05d(%rip), %rsi     # 0x6cbc4
callq 0x13482
movq %rax, %r13
movsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1eba1
leaq 0x210(%r13), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1efff
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
movl -0x50(%rbp), %r12d
jne 0x1ebe8
movq %r13, %r15
addq $0x210, %r15            # imm = 0x210
movq 0x210(%r13), %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
movl -0x2c(%rbp), %ecx
addl -0x58(%rbp), %ecx
addl -0x78(%rbp), %ecx
jmp 0x1ed9b
movl %r12d, -0x50(%rbp)
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x1d278
movsd %xmm0, -0x48(%rbp)
movq 0xc0(%r14), %rax
movl 0x4(%rax), %ecx
movl %ecx, -0x58(%rbp)
sarq %cl, %rbx
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x1d278
movq 0xc0(%r14), %rax
movl (%rax), %ecx
movl %ecx, -0x2c(%rbp)
sarq %cl, %rbx
movq 0x8(%r14), %rdi
movsd %xmm0, -0x78(%rbp)
movsd %xmm0, -0x40(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
leaq -0x40(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x3c2fe
callq 0x34c60
movq %rax, %rdi
leaq 0x4b5c5(%rip), %rsi     # 0x6a23b
callq 0x34e74
movq %rax, %r13
movq 0x8(%r14), %r15
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1eca3
addq $0xc, %r15
leaq 0x210(%r13), %rdi
movq %r15, %rsi
callq 0xe974
movq %r13, %rdi
leaq 0x4b5c5(%rip), %rsi     # 0x6a272
callq 0x1ee52
movq %rax, %r12
movsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1ece8
leaq 0x210(%r12), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1efff
movq %r12, %rdi
leaq 0x4ded2(%rip), %rsi     # 0x6cbc4
callq 0x13482
movq %rax, %r13
xorps %xmm0, %xmm0
leaq -0x70(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x92d0
movsd -0x88(%rbp), %xmm0
xorpd %xmm2, %xmm2
mulsd %xmm2, %xmm0
movsd -0x70(%rbp), %xmm1
mulsd %xmm2, %xmm1
movsd %xmm0, -0x70(%rbp)
movsd %xmm1, -0x68(%rbp)
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1ed4e
leaq 0x210(%r13), %rdi
leaq -0x70(%rbp), %rsi
callq 0x1efff
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
movl -0x50(%rbp), %r12d
jne 0x1ed95
movq %r13, %r15
addq $0x210, %r15            # imm = 0x210
movq 0x210(%r13), %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
movl -0x2c(%rbp), %ecx
addl -0x58(%rbp), %ecx
movl -0x90(%rbp), %eax
addl %ecx, %eax
subl %eax, %r12d
testl %r12d, %r12d
jg 0x1e5e9
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6522b(%rip), %rbx     # 0x83ff0
leaq 0x4b40a(%rip), %rsi     # 0x6a1d6
movl $0x1c, %edx
movq %rbx, %rdi
callq 0x9560
leaq 0x4e3b2(%rip), %rsi     # 0x6d192
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9560
movq %rbx, %rdi
movl $0x23f, %esi            # imm = 0x23F
callq 0x9880
movq %rax, %rbx
leaq 0x4c653(%rip), %rsi     # 0x6b457
movl $0x3, %edx
movq %rax, %rdi
callq 0x9560
leaq 0x4b47e(%rip), %rsi     # 0x6a296
movl $0x14, %edx
movq %rbx, %rdi
callq 0x9560
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %rbx, %rdi
callq 0x9070
movq %rax, %rdi
callq 0x9330
jmp 0x1edaf
nop