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

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

  SetCommunicateType(FREE_FORM);

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

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

// Assembly:
cmpl $0x0, 0x3c(%rdi)
je 0x1debb
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %r14d
movq %rdi, %rbx
leaq 0x80(%rdi), %rax
movq %rax, 0xc0(%rdi)
leaq 0x98(%rdi), %rax
movq %rax, 0xc8(%rdi)
movslq %edx, %rax
cmpb $0x0, 0x24(%rdi,%rax)
jne 0x1df74
movq %rsi, %r12
decq %rax
imulq $0x178, %rax, %r13      # imm = 0x178
cmpb $0x1, 0x1ba(%rsi,%r13)
jne 0x1df74
movl %ecx, %r15d
movq %rax, -0x48(%rbp)
movq 0x10(%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x2a4b4
movq 0x10(%rbx), %rcx
movl 0x8(%rcx), %esi
movq %rax, %rdi
movl %r14d, %edx
callq 0x47086
movsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0x49360
movsd -0x50(%rbp), %xmm0
ucomisd 0x3410(%rax), %xmm0
ja 0x1df74
leaq (%r12,%r13), %rax
addq $0xa8, %rax
cmpl %r15d, 0x18(%rax)
jg 0x1df74
movl 0x20(%rbx), %ecx
addl 0xdc(%rbx), %ecx
cmpl 0x6659e(%rip), %ecx     # 0x84510
jle 0x1df85
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 %rbx, %rdi
movl %r14d, %esi
callq 0x1d9b2
movsd -0x40(%rbp), %xmm0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1d7ac
movsd -0x38(%rbp), %xmm0
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1d7ac
movq %rbx, %rdi
movl $0x3, %esi
callq 0x1d8aa
callq 0x34c60
leaq 0x4c266(%rip), %rsi     # 0x6a23b
movq %rax, %rdi
callq 0x34e74
movq %rax, %r15
movq 0x10(%rbx), %rax
movq 0x18(%rax), %r12
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1e00c
addq $0x10, %r12
movq %r15, %rdi
addq $0x210, %rdi            # imm = 0x210
movq %r12, %rsi
callq 0xe974
leaq 0x4c23e(%rip), %rsi     # 0x6a251
movq %r15, %rdi
callq 0x13538
movq %rax, %r15
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1e03e
movq %r15, %rdi
addq $0x210, %rdi            # imm = 0x210
movl %r14d, %esi
callq 0x9880
leaq 0x4eb7f(%rip), %rsi     # 0x6cbc4
movq %r15, %rdi
callq 0x13482
movq %rax, %r14
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1e06e
leaq 0x210(%r14), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1efff
callq 0x43dce
cmpb $0x1, 0x5c45(%rax)
jne 0x1e08b
addq $0x210, %r14            # imm = 0x210
movq %r14, %rdi
callq 0x9240
movq -0x48(%rbp), %rax
movb $0x1, 0x25(%rbx,%rax)
movb $0x1, %al
jmp 0x1df76
nop