// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/Player.cpp
// Function: Player::Run()
void Player::Run() {
  // TIMETEST("Run");

  static Time last_time = Time(-100, 0);

  mpObserver->Lock();

  /** 下面几个更新顺序不能变 */
  Formation::instance.SetTeammateFormations();
  CommunicateSystem::instance().Update(); //在这里解析hear信息，必须首先更新
  mpAgent->CheckCommands(mpObserver);
  mpWorldModel->Update(mpObserver);

  mpObserver->UnLock();

  const Time &time = mpAgent->GetWorldState().CurrentTime();

  if (last_time.T() >= 0) {
    if (time != Time(last_time.T() + 1, 0) &&
        time != Time(last_time.T(), last_time.S() + 1)) {
      if (time == last_time) {
        mpAgent->World().SetCurrentTime(
            Time(last_time.T(), last_time.S() + 1)); //否则决策数据更新会出问题
      }
    }
  }

  last_time = time;

  Formation::instance
      .UpdateOpponentRole(); // TODO:
                             // 暂时放在这里，教练未发来对手阵型信息时自己先计算

  VisualSystem::instance().ResetVisualRequest();
  mpDecisionTree->Decision(*mpAgent);

  VisualSystem::instance().Decision();
  CommunicateSystem::instance().Decision();

  if (ServerParam::instance().synchMode()) {
    mpAgent->Done();
  }

  mpAgent->SetHistoryActiveBehaviors();

  Logger::instance().LogSight();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpb $0x0, 0x35cbd5(%rip)    # 0x3d58c0
jne 0x78d1f
leaq 0x35cbcc(%rip), %rdi    # 0x3d58c0
callq 0xaad0
cmpl $0x0, %eax
je 0x78d1f
leaq 0x35cbaf(%rip), %rdi    # 0x3d58b4
movl $0xffffff9c, %esi       # imm = 0xFFFFFF9C
xorl %edx, %edx
callq 0x13c70
jmp 0x78d13
leaq 0x35cba6(%rip), %rdi    # 0x3d58c0
callq 0xa390
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x29870
leaq 0x8c49d(%rip), %rdi     # 0x1051d0
callq 0x3ee20
callq 0x2c310
movq %rax, %rdi
callq 0x2c9a0
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rdi
movq 0x8(%rax), %rsi
callq 0x28990
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x8(%rax), %rsi
callq 0xaae30
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x298a0
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x10550
movq %rax, %rdi
callq 0x12100
movq %rax, -0x20(%rbp)
leaq 0x35cb20(%rip), %rdi    # 0x3d58b4
callq 0x13040
cmpl $0x0, %eax
jl 0x78eb4
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq 0x35cb03(%rip), %rdi    # 0x3d58b4
callq 0x13040
movl %eax, %esi
addl $0x1, %esi
leaq -0x28(%rbp), %rdi
xorl %edx, %edx
callq 0x13c70
movq -0x50(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x175f0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x41(%rbp)
jne 0x78de1
jmp 0x78e25
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq 0x35cac4(%rip), %rdi    # 0x3d58b4
callq 0x13040
movl %eax, -0x5c(%rbp)
leaq 0x35cab5(%rip), %rdi    # 0x3d58b4
callq 0x13050
movl -0x5c(%rbp), %esi
movl %eax, %edx
addl $0x1, %edx
leaq -0x30(%rbp), %rdi
callq 0x13c70
movq -0x58(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x175f0
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x78e31
jmp 0x78eb2
movq -0x20(%rbp), %rdi
leaq 0x35ca78(%rip), %rsi    # 0x3d58b4
callq 0x120a0
testb $0x1, %al
jne 0x78e47
jmp 0x78eb0
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x1a9b0
movq %rax, -0x68(%rbp)
leaq 0x35ca55(%rip), %rdi    # 0x3d58b4
callq 0x13040
movl %eax, -0x6c(%rbp)
leaq 0x35ca46(%rip), %rdi    # 0x3d58b4
callq 0x13050
movl -0x6c(%rbp), %esi
movl %eax, %edx
addl $0x1, %edx
leaq -0x38(%rbp), %rdi
callq 0x13c70
movq -0x68(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x790a0
jmp 0x78eb0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq 0x35ca1a(%rip), %rdi    # 0x3d58c0
callq 0xa380
jmp 0x78f46
jmp 0x78eb2
jmp 0x78eb4
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, 0x35c9f2(%rip)    # 0x3d58b4
leaq 0x8c307(%rip), %rdi     # 0x1051d0
callq 0x3f050
callq 0xa47b0
movq %rax, %rdi
callq 0xa49b0
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rdi
movq 0x18(%rax), %rsi
callq 0x32ff0
callq 0xa47b0
movq %rax, %rdi
callq 0xa4c50
callq 0x2c310
movq %rax, %rdi
callq 0x2d830
callq 0x855e0
movq %rax, %rdi
callq 0x298d0
testb $0x1, %al
jne 0x78f19
jmp 0x78f26
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x298f0
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x137c0
callq 0x5add0
movq %rax, %rdi
callq 0x5b410
addq $0x70, %rsp
popq %rbp
retq
movq -0x10(%rbp), %rdi
callq 0xaa60
nop