// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::DoCommunication()
void CommunicateSystem::DoCommunication() {
  if (!mpAgent)
    return;

  PositionInfo &position_info = mpAgent->GetInfoState().GetPositionInfo();
  const Unum closest_tm = position_info.GetClosestTeammateToBall();

  if (closest_tm == mpAgent->GetSelfUnum()) {
    mpAgent->AttentiontoOff();
  } else if (closest_tm) {
    if (closest_tm != mpAgent->GetSelf().GetFocusOnUnum()) {
      mpAgent->Attentionto(closest_tm);
    }
  }

  SendBallStatus(mpAgent->GetWorldState().GetBall());
  SendTeammateStatus(&mpAgent->GetWorldState(), mpAgent->GetSelfUnum());

  const vector<Unum> &o2b =
      mpAgent->GetInfoState().GetPositionInfo().GetCloseOpponentToTeammate(
          mpAgent->GetSelfUnum());
  const vector<Unum> &t2b =
      mpAgent->GetInfoState().GetPositionInfo().GetCloseTeammateToTeammate(
          mpAgent->GetSelfUnum());

  for (uint i = 0; i < TEAMSIZE; ++i) {
    if (i < o2b.size()) {
      SendOpponentStatus(&mpAgent->GetWorldState(), o2b[i]);
    }
    if (i < t2b.size()) {
      SendTeammateStatus(&mpAgent->GetWorldState(), t2b[i]);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, 0x10(%rax)
jne 0x2da13
jmp 0x2dc24
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2e810
movq %rax, %rdi
callq 0x49590
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1b410
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, -0x14(%rbp)
movl -0x14(%rbp), %ecx
movl %ecx, -0x3c(%rbp)
movq 0x10(%rax), %rdi
callq 0x10e40
movl %eax, %ecx
movl -0x3c(%rbp), %eax
cmpl %ecx, %eax
jne 0x2da65
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2ea10
jmp 0x2daa3
cmpl $0x0, -0x14(%rbp)
je 0x2daa1
movq -0x38(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, -0x40(%rbp)
movq 0x10(%rax), %rdi
callq 0x10590
movq %rax, %rdi
callq 0x10e60
movl %eax, %ecx
movl -0x40(%rbp), %eax
cmpl %ecx, %eax
je 0x2da9f
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x14(%rbp), %esi
callq 0x2ea40
jmp 0x2daa1
jmp 0x2daa3
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10550
movq %rax, %rdi
callq 0x10570
movq -0x38(%rbp), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x2ced0
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10550
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0x58(%rbp)
movq 0x10(%rax), %rdi
callq 0x10e40
movq -0x58(%rbp), %rsi
movq -0x38(%rbp), %rdi
movl %eax, %edx
xorl %ecx, %ecx
callq 0x2d390
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2e810
movq %rax, %rdi
callq 0x49590
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0x50(%rbp)
movq 0x10(%rax), %rdi
callq 0x10e40
movq -0x50(%rbp), %rdi
movl %eax, %esi
callq 0x22220
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq 0x10(%rax), %rdi
callq 0x2e810
movq %rax, %rdi
callq 0x49590
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0x48(%rbp)
movq 0x10(%rax), %rdi
callq 0x10e40
movq -0x48(%rbp), %rdi
movl %eax, %esi
callq 0x23d80
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
cmpl $0xb, -0x2c(%rbp)
jae 0x2dc24
movl -0x2c(%rbp), %eax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1d7a0
movq %rax, %rcx
movq -0x60(%rbp), %rax
cmpq %rcx, %rax
jae 0x2dbc8
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10550
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x1b610
movq -0x38(%rbp), %rdi
movq -0x68(%rbp), %rsi
movl (%rax), %edx
xorl %ecx, %ecx
callq 0x2d5e0
movl -0x2c(%rbp), %eax
movq %rax, -0x70(%rbp)
movq -0x28(%rbp), %rdi
callq 0x1d7a0
movq %rax, %rcx
movq -0x70(%rbp), %rax
cmpq %rcx, %rax
jae 0x2dc14
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10550
movq %rax, -0x78(%rbp)
movq -0x28(%rbp), %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x1b610
movq -0x38(%rbp), %rdi
movq -0x78(%rbp), %rsi
movl (%rax), %edx
xorl %ecx, %ecx
callq 0x2d390
jmp 0x2dc16
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2db72
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)