// File: /workspace/github_cpp_makefile_star2_O3/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::SendOpponentStatus(WorldState const*, int, int)
bool CommunicateSystem::SendOpponentStatus(const WorldState *pWorldState,
                                           Unum num, int cd) {
  Assert(num > 0);

  if (mCommuType != FREE_FORM) {
    return false;
  }

  SetCommunicateType(FREE_FORM);

  if (mOpponentSended[num] == true) {
    return false;
  }
  if (pWorldState->GetOpponent(num).IsAlive() == false) {
    return false;
  }
  if (mpAgent->GetInfoState().GetPositionInfo().GetPlayerDistToPlayer(
          mpAgent->GetSelfUnum(), -num) >
      ServerParam::instance().unumFarLength()) {
    return false;
  }

  int pos_cd = pWorldState->GetOpponent(num).GetPosDelay();
  if (pos_cd <= cd) {
    if (mFreeFormCodecBitCount[OPPONENT_ONLY_POS] + mBitsUsed <=
        MAX_BITS_USED) {
      Vector pos = pWorldState->GetOpponent(num).GetPos();
      AddUnumToCommuBits(num);
      AddDataToCommuBits(pos.X(), POS_X);
      AddDataToCommuBits(pos.Y(), POS_Y);
      AddFreeFormFlagToCommuBits(OPPONENT_ONLY_POS);
      mOpponentSended[num] = true;
      Logger::instance().GetTextLogger("freeform")
          << mpAgent->GetWorldState().CurrentTime() << " send opp: " << num
          << " " << pos << endl;
      return true;
    }
  }
  return false;
}

// Assembly:
cmpl $0x0, 0x3c(%rdi)
je 0x1e0a5
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebx
movq %rdi, %r14
leaq 0x80(%rdi), %rax
movq %rax, 0xc0(%rdi)
leaq 0x98(%rdi), %rax
movq %rax, 0xc8(%rdi)
movslq %edx, %r13
cmpb $0x0, 0x2f(%rdi,%r13)
jne 0x1e167
movq %rsi, %r12
decq %r13
imulq $0x178, %r13, %rax      # imm = 0x178
cmpb $0x1, 0x11e2(%rsi,%rax)
jne 0x1e167
movl %ecx, %r15d
movq %rax, -0x48(%rbp)
movq 0x10(%r14), %rax
movq 0x20(%rax), %rdi
callq 0x2a4b4
movq 0x10(%r14), %rcx
movl 0x8(%rcx), %esi
movl %ebx, %edx
negl %edx
movq %rax, %rdi
callq 0x47086
movsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0x49360
movsd -0x50(%rbp), %xmm0
ucomisd 0x3410(%rax), %xmm0
ja 0x1e167
movq -0x48(%rbp), %rax
addq %r12, %rax
addq $0x10d0, %rax           # imm = 0x10D0
cmpl %r15d, 0x18(%rax)
jg 0x1e167
movl 0x20(%r14), %ecx
addl 0xe0(%r14), %ecx
cmpl 0x663ab(%rip), %ecx     # 0x84510
jle 0x1e178
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %rax
movups (%rax), %xmm0
movaps %xmm0, -0x40(%rbp)
movq %r14, %rdi
movl %ebx, %esi
callq 0x1d9b2
movsd -0x40(%rbp), %xmm0
movq %r14, %rdi
xorl %esi, %esi
callq 0x1d7ac
movsd -0x38(%rbp), %xmm0
movq %r14, %rdi
movl $0x1, %esi
callq 0x1d7ac
movq %r14, %rdi
movl $0x4, %esi
callq 0x1d8aa
movb $0x1, 0x30(%r14,%r13)
callq 0x34c60
leaq 0x4c06e(%rip), %rsi     # 0x6a23b
movq %rax, %rdi
callq 0x34e74
movq %rax, %r15
movq 0x10(%r14), %rax
movq 0x18(%rax), %r14
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1e204
addq $0x10, %r14
movq %r15, %rdi
addq $0x210, %rdi            # imm = 0x210
movq %r14, %rsi
callq 0xe974
leaq 0x4c051(%rip), %rsi     # 0x6a25c
movq %r15, %rdi
callq 0x1ee9c
movq %rax, %r14
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1e235
movq %r14, %rdi
addq $0x210, %rdi            # imm = 0x210
movl %ebx, %esi
callq 0x9880
leaq 0x4e988(%rip), %rsi     # 0x6cbc4
movq %r14, %rdi
callq 0x13482
movq %rax, %rbx
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1e265
leaq 0x210(%rbx), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1efff
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1e282
addq $0x210, %rbx            # imm = 0x210
movq %rbx, %rdi
callq 0x9240
movb $0x1, %al
jmp 0x1e169
nop