// File: /workspace/github_cpp_makefile_star2_O1/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 0x1e53f
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 0x1e601
movq %rsi, %r12
decq %r13
imulq $0x178, %r13, %rax      # imm = 0x178
cmpb $0x1, 0x11e2(%rsi,%rax)
jne 0x1e601
movl %ecx, %r15d
movq %rax, -0x48(%rbp)
movq 0x10(%r14), %rax
movq 0x20(%rax), %rdi
callq 0x2adf8
movq 0x10(%r14), %rcx
movl 0x8(%rcx), %esi
movl %ebx, %edx
negl %edx
movq %rax, %rdi
callq 0x4848a
movsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0x4a75c
movsd -0x50(%rbp), %xmm0
ucomisd 0x3410(%rax), %xmm0
ja 0x1e601
movq -0x48(%rbp), %rax
addq %r12, %rax
addq $0x10d0, %rax           # imm = 0x10D0
cmpl %r15d, 0x18(%rax)
jg 0x1e601
movl 0x20(%r14), %ecx
addl 0xe0(%r14), %ecx
cmpl 0x68f11(%rip), %ecx     # 0x87510
jle 0x1e612
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 0x1dd72
movsd -0x40(%rbp), %xmm0
movq %r14, %rdi
xorl %esi, %esi
callq 0x1db6c
movsd -0x38(%rbp), %xmm0
movq %r14, %rdi
movl $0x1, %esi
callq 0x1db6c
movq %r14, %rdi
movl $0x4, %esi
callq 0x1dc6a
movb $0x1, 0x30(%r14,%r13)
callq 0x35b4a
leaq 0x4dbd4(%rip), %rsi     # 0x6c23b
movq %rax, %rdi
callq 0x35d5e
movq %rax, %r15
movq 0x10(%r14), %rax
movq 0x18(%rax), %r14
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1e69e
addq $0x10, %r14
movq %r15, %rdi
addq $0x210, %rdi            # imm = 0x210
movq %r14, %rsi
callq 0xea74
leaq 0x4dbc8(%rip), %rsi     # 0x6c26d
movq %r15, %rdi
callq 0x1f33a
movq %rax, %r14
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1e6cf
movq %r14, %rdi
addq $0x210, %rdi            # imm = 0x210
movl %ebx, %esi
callq 0x9880
leaq 0x5051e(%rip), %rsi     # 0x6ebf4
movq %r14, %rdi
callq 0x135bc
movq %rax, %rbx
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1e6ff
leaq 0x210(%rbx), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1f49d
callq 0x450ba
cmpb $0x1, 0x5c45(%rax)
jne 0x1e71c
addq $0x210, %rbx            # imm = 0x210
movq %rbx, %rdi
callq 0x9240
movb $0x1, %al
jmp 0x1e603
nop