// File: /workspace/github_cpp_makefile_star2_O1/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 0x68a98(%rip), %r12d    # 0x87510
testl %r12d, %r12d
jle 0x1f24d
movq %rsi, %rbx
movq %rdi, %r14
movq 0x58(%r14), %rax
andq %rbx, %rax
cmpl $0x4, %eax
jg 0x1f24d
movl %eax, %ecx
cmpl 0xd0(%r14,%rcx,4), %r12d
jl 0x1f24d
movl 0x50(%r14), %ecx
sarq %cl, %rbx
cmpl $0x4, %eax
ja 0x1f25c
movl %ecx, -0x90(%rbp)
movl %eax, %eax
leaq 0x4d696(%rip), %rcx     # 0x6c15c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
movq %rbx, %rsi
movl $0x4, %edx
callq 0x1d640
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 0x1d640
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 0x1d640
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 0x1d640
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 0x4c4cb(%rip), %xmm0    # 0x6b050
divsd 0x4c4bb(%rip), %xmm0    # 0x6b048
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 0x3d2ce
callq 0x35b4a
movq %rax, %rdi
leaq 0x4d654(%rip), %rsi     # 0x6c23b
callq 0x35d5e
movq %rax, %r13
movq 0x8(%r14), %r15
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1ec14
addq $0xc, %r15
leaq 0x210(%r13), %rdi
movq %r15, %rsi
callq 0xea74
movq %r13, %rdi
leaq 0x4d665(%rip), %rsi     # 0x6c283
callq 0x1f2f0
movq %rax, %r13
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1ec5b
leaq 0x210(%r13), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1f49d
movq %r13, %rdi
leaq 0x4ff8f(%rip), %rsi     # 0x6ebf4
callq 0x135bc
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 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1ecc0
leaq 0x210(%r13), %rdi
leaq -0x70(%rbp), %rsi
callq 0x1f49d
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1ed03
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 0x1f239
movl %r12d, -0x50(%rbp)
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x1d640
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 0x1d640
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 0x3d360
callq 0x35b4a
movq %rax, %rdi
leaq 0x4d499(%rip), %rsi     # 0x6c23b
callq 0x35d5e
movq %rax, %r12
movq 0x8(%r14), %r15
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1edd0
addq $0xc, %r15
leaq 0x210(%r12), %rdi
movq %r15, %rsi
callq 0xea74
movq %r12, %rdi
leaq 0x4d4c1(%rip), %rsi     # 0x6c29b
callq 0x1f33a
jmp 0x1efda
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x1d640
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 0x1d640
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 0x3d302
callq 0x35b4a
movq %rax, %rdi
leaq 0x4d3e6(%rip), %rsi     # 0x6c23b
callq 0x35d5e
movq %rax, %r13
movq 0x8(%r14), %r15
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1ee82
addq $0xc, %r15
leaq 0x210(%r13), %rdi
movq %r15, %rsi
callq 0xea74
movq %r13, %rdi
leaq 0x4d3f7(%rip), %rsi     # 0x6c283
callq 0x1f2f0
movq %rax, %r13
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1eec6
leaq 0x210(%r13), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1f49d
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1ef09
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 0x1f239
movl %r12d, -0x50(%rbp)
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x1d640
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 0x1d640
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 0x3d324
callq 0x35b4a
movq %rax, %rdi
leaq 0x4d29e(%rip), %rsi     # 0x6c23b
callq 0x35d5e
movq %rax, %r12
movq 0x8(%r14), %r15
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1efcb
addq $0xc, %r15
leaq 0x210(%r12), %rdi
movq %r15, %rsi
callq 0xea74
movq %r12, %rdi
leaq 0x4d2bb(%rip), %rsi     # 0x6c290
callq 0x13672
movq %rax, %r12
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1effb
leaq 0x210(%r12), %rdi
movl %r13d, %esi
callq 0x9880
movq %r12, %rdi
leaq 0x4fbef(%rip), %rsi     # 0x6ebf4
callq 0x135bc
movq %rax, %r13
movsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1f03f
leaq 0x210(%r13), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1f49d
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
movl -0x50(%rbp), %r12d
jne 0x1f086
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 0x1f239
movl %r12d, -0x50(%rbp)
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x1d640
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 0x1d640
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 0x3d2ce
callq 0x35b4a
movq %rax, %rdi
leaq 0x4d127(%rip), %rsi     # 0x6c23b
callq 0x35d5e
movq %rax, %r13
movq 0x8(%r14), %r15
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1f141
addq $0xc, %r15
leaq 0x210(%r13), %rdi
movq %r15, %rsi
callq 0xea74
movq %r13, %rdi
leaq 0x4d138(%rip), %rsi     # 0x6c283
callq 0x1f2f0
movq %rax, %r12
movsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1f186
leaq 0x210(%r12), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1f49d
movq %r12, %rdi
leaq 0x4fa64(%rip), %rsi     # 0x6ebf4
callq 0x135bc
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 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1f1ec
leaq 0x210(%r13), %rdi
leaq -0x70(%rbp), %rsi
callq 0x1f49d
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
movl -0x50(%rbp), %r12d
jne 0x1f233
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 0x1ea87
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x67d8d(%rip), %rbx     # 0x86ff0
leaq 0x4cf6c(%rip), %rsi     # 0x6c1d6
movl $0x1c, %edx
movq %rbx, %rdi
callq 0x9560
leaq 0x4ff44(%rip), %rsi     # 0x6f1c2
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9560
movq %rbx, %rdi
movl $0x23f, %esi            # imm = 0x23F
callq 0x9880
movq %rax, %rbx
leaq 0x4e1dd(%rip), %rsi     # 0x6d47f
movl $0x3, %edx
movq %rax, %rdi
callq 0x9560
leaq 0x4cff1(%rip), %rsi     # 0x6c2a7
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 0x1f24d
nop