// File: /workspace/github_cpp_makefile_star2_O3/wrighteagle2d[P]wrighteaglebase/Debug/../src/WorldState.cpp
// Function: WorldStateUpdater::UpdateActionInfo()
void WorldStateUpdater::UpdateActionInfo() {
  const Vector &ball_pos = GetBall().GetPos();

  for (unsigned i = 0; i < mpWorldState->GetPlayerList().size(); ++i) {
    PlayerState &player =
        const_cast<PlayerState &>(*mpWorldState->GetPlayerList()[i]);
    if (!player.IsAlive())
      continue;

    Vector ball_2_player =
        (ball_pos - player.GetPos()).Rotate(-player.GetBodyDir());

    if (!player.IsIdling() &&
        ball_2_player.Mod() < player.GetKickableArea() -
                                  KICKABLE_BUFFER * Sign(player.GetUnum())) {
      player.UpdateKickable(true);
      player.UpdateKickRate(GetKickRate(ball_2_player, player.GetPlayerType()));
    } else {
      player.UpdateKickable(false);
      player.UpdateKickRate(0.0);
    }

    player.UpdateBallCatchable(false);
    if (player.GetUnum() == mpWorldState->GetTeammateGoalieUnum() ||
        player.GetUnum() == -mpWorldState->GetOpponentGoalieUnum()) {
      if ((mpWorldState->GetPlayMode() == PM_Play_On ||
           mpWorldState->GetPlayMode() == PM_Opp_Penalty_Taken) &&
          ball_2_player.Mod() <
              ServerParam::instance().maxCatchableArea() - CATCHABLE_BUFFER) {
        if (player.GetUnum() == mpWorldState->GetTeammateGoalieUnum()) {
          if (ServerParam::instance().ourPenaltyArea().IsWithin(ball_pos) &&
              ServerParam::instance().ourPenaltyArea().IsWithin(
                  player.GetPos())) {
            player.UpdateBallCatchable(true);
          }
        } else {
          if (ServerParam::instance().oppPenaltyArea().IsWithin(ball_pos) &&
              ServerParam::instance().oppPenaltyArea().IsWithin(
                  player.GetPos())) {
            player.UpdateBallCatchable(true);
          }
        }
      }
    }

    player.UpdateMaxTurnAngle(
        GetMaxTurnAngle(player.GetPlayerType(), player.GetVel().Mod()));
  }

  for (unsigned i = 0; i < mpWorldState->GetPlayerList().size();
       ++i) { //这里要等到可踢信息更新完才能更新
    PlayerState &player =
        const_cast<PlayerState &>(*mpWorldState->GetPlayerList()[i]);
    if (!player.IsAlive())
      continue;

    player.UpdateTackleProb(ComputeTackleProb(player.GetUnum(), false), false);
    player.UpdateTackleProb(ComputeTackleProb(player.GetUnum(), true), true);

    if (PlayerParam::instance().playerVersion() > 14.0) {
      player.UpdateDangerousTackleCondition(
          Tackler::MayDangerousIfTackle(player, *mpWorldState));
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %r13
movq 0x20f8(%r13), %rax
movq 0x2100(%r13), %rdx
cmpq %rax, %rdx
je 0x5c0b0
movl $0x1, %r14d
xorl %ecx, %ecx
movq %r13, %rsi
movq %rbx, -0x68(%rbp)
movq (%rax,%rcx,8), %r12
cmpb $0x1, 0x112(%r12)
jne 0x5c087
movsd 0x38(%r13), %xmm1
movsd 0x40(%r13), %xmm0
subsd 0x8(%r12), %xmm1
movsd %xmm1, -0x30(%rbp)
subsd 0x10(%r12), %xmm0
movapd %xmm0, -0x40(%rbp)
movsd 0xb0(%r12), %xmm0
mulsd 0xd531(%rip), %xmm0     # 0x690a0
divsd 0xd4d1(%rip), %xmm0     # 0x69048
leaq -0x48(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x92d0
movsd -0x48(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
movsd -0x30(%rbp), %xmm3
movapd %xmm3, %xmm2
mulsd %xmm0, %xmm3
movapd -0x40(%rbp), %xmm4
mulsd %xmm4, %xmm0
mulsd %xmm1, %xmm2
subsd %xmm0, %xmm2
mulsd %xmm1, %xmm4
addsd %xmm3, %xmm4
movapd %xmm4, -0x40(%rbp)
cmpl $0x0, 0xc8(%r12)
jg 0x5bd8b
cmpl $0x0, 0x124(%r12)
jg 0x5bd8b
movapd -0x40(%rbp), %xmm0
mulsd %xmm0, %xmm0
movapd %xmm2, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movq (%r12), %rax
movq %r12, %rdi
movapd %xmm2, -0x80(%rbp)
callq *0x10(%rax)
movapd -0x80(%rbp), %xmm2
movl 0x11c(%r12), %ecx
sarl $0x1f, %ecx
orl $0x1, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
mulsd 0x11aa1(%rip), %xmm0    # 0x6d6d0
addsd (%rax), %xmm0
ucomisd -0x30(%rbp), %xmm0
jbe 0x5bd8b
movb $0x1, 0x128(%r12)
movslq 0x114(%r12), %r15
movapd %xmm2, %xmm0
andpd 0xd3b5(%rip), %xmm0     # 0x69010
movsd 0xd3dd(%rip), %xmm1     # 0x69040
ucomisd %xmm0, %xmm1
jbe 0x5bc88
movapd -0x40(%rbp), %xmm2
andpd 0xd39a(%rip), %xmm2     # 0x69010
xorpd %xmm0, %xmm0
movsd 0xd3be(%rip), %xmm1     # 0x69040
ucomisd %xmm2, %xmm1
ja 0x5bca7
movapd -0x40(%rbp), %xmm0
movapd -0x80(%rbp), %xmm1
callq 0x90d0
mulsd 0xd3a9(%rip), %xmm0     # 0x69048
divsd 0xd3a9(%rip), %xmm0     # 0x69050
andpd 0xd361(%rip), %xmm0     # 0x69010
movapd %xmm0, -0x60(%rbp)
callq 0x43dce
movq 0x5c38(%rax), %rax
imulq $0x3700, %r15, %r15     # imm = 0x3700
movsd -0x30(%rbp), %xmm0
subsd 0x3038(%rax,%r15), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x49360
movsd -0x30(%rbp), %xmm0
subsd 0x30d8(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x43dce
movq 0x5c38(%rax), %rax
movsd 0x3068(%rax,%r15), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd 0xd390(%rip), %xmm0     # 0x690a8
movapd -0x60(%rbp), %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, -0x60(%rbp)
movapd -0x60(%rbp), %xmm1
divsd 0xd32d(%rip), %xmm1     # 0x69060
movapd %xmm1, -0x60(%rbp)
movapd -0x60(%rbp), %xmm1
addsd 0xd313(%rip), %xmm1     # 0x69058
movapd %xmm1, -0x60(%rbp)
movsd -0x30(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
callq 0x43dce
movapd -0x60(%rbp), %xmm0
movq 0x5c38(%rax), %rax
movsd -0x30(%rbp), %xmm1
divsd 0x3040(%rax,%r15), %xmm1
subsd %xmm1, %xmm0
mulsd -0x88(%rbp), %xmm0
movapd -0x80(%rbp), %xmm2
jmp 0x5bd98
movb $0x0, 0x128(%r12)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x130(%r12)
movb $0x0, 0x138(%r12)
movl 0x11c(%r12), %ecx
movq 0x8(%rbx), %rax
cmpl 0x2110(%rax), %ecx
je 0x5bdcb
addl 0x2114(%rax), %ecx
jne 0x5c00a
movl 0x1c(%rax), %eax
cmpl $0x33, %eax
je 0x5bddc
cmpl $0x1, %eax
jne 0x5c00a
movapd -0x40(%rbp), %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
xorps %xmm0, %xmm0
sqrtsd %xmm2, %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0x49360
movsd 0x3458(%rax), %xmm0
addsd 0x118c2(%rip), %xmm0    # 0x6d6d0
ucomisd -0x40(%rbp), %xmm0
jbe 0x5c00a
movl 0x11c(%r12), %r15d
movq 0x8(%rbx), %rax
movl 0x2110(%rax), %ebx
callq 0x49360
movq %r13, %rcx
movsd 0x38(%r13), %xmm0
cmpl %ebx, %r15d
jne 0x5bf25
movsd 0x3830(%rax), %xmm1
addsd 0xd226(%rip), %xmm1     # 0x69078
ucomisd %xmm1, %xmm0
movq %rcx, %r13
movq -0x68(%rbp), %rbx
jb 0x5c00a
movsd 0x3838(%rax), %xmm1
addsd 0xd1cd(%rip), %xmm1     # 0x69040
ucomisd %xmm0, %xmm1
jb 0x5c00a
movsd 0x40(%r13), %xmm0
movsd 0x3840(%rax), %xmm1
addsd 0xd1e5(%rip), %xmm1     # 0x69078
ucomisd %xmm1, %xmm0
jb 0x5c00a
movsd 0x3848(%rax), %xmm1
addsd 0xd193(%rip), %xmm1     # 0x69040
ucomisd %xmm0, %xmm1
jb 0x5c00a
callq 0x49360
movsd 0x8(%r12), %xmm0
movsd 0x3830(%rax), %xmm1
addsd 0xd1a5(%rip), %xmm1     # 0x69078
ucomisd %xmm1, %xmm0
jb 0x5c00a
movsd 0x3838(%rax), %xmm1
addsd 0xd153(%rip), %xmm1     # 0x69040
ucomisd %xmm0, %xmm1
jb 0x5c00a
movsd 0x10(%r12), %xmm0
movsd 0x3840(%rax), %xmm1
addsd 0xd16a(%rip), %xmm1     # 0x69078
ucomisd %xmm1, %xmm0
jb 0x5c00a
movsd 0x3848(%rax), %xmm1
jmp 0x5bff3
movsd 0x3850(%rax), %xmm1
addsd 0xd143(%rip), %xmm1     # 0x69078
ucomisd %xmm1, %xmm0
movq %rcx, %r13
movq -0x68(%rbp), %rbx
jb 0x5c00a
movsd 0x3858(%rax), %xmm1
addsd 0xd0ea(%rip), %xmm1     # 0x69040
ucomisd %xmm0, %xmm1
jb 0x5c00a
movsd 0x40(%r13), %xmm0
movsd 0x3860(%rax), %xmm1
addsd 0xd102(%rip), %xmm1     # 0x69078
ucomisd %xmm1, %xmm0
jb 0x5c00a
movsd 0x3868(%rax), %xmm1
addsd 0xd0b0(%rip), %xmm1     # 0x69040
ucomisd %xmm0, %xmm1
jb 0x5c00a
callq 0x49360
movsd 0x8(%r12), %xmm0
movsd 0x3850(%rax), %xmm1
addsd 0xd0c6(%rip), %xmm1     # 0x69078
ucomisd %xmm1, %xmm0
jb 0x5c00a
movsd 0x3858(%rax), %xmm1
addsd 0xd078(%rip), %xmm1     # 0x69040
ucomisd %xmm0, %xmm1
jb 0x5c00a
movsd 0x10(%r12), %xmm0
movsd 0x3860(%rax), %xmm1
addsd 0xd093(%rip), %xmm1     # 0x69078
ucomisd %xmm1, %xmm0
jb 0x5c00a
movsd 0x3868(%rax), %xmm1
addsd 0xd045(%rip), %xmm1     # 0x69040
ucomisd %xmm0, %xmm1
jb 0x5c00a
movb $0x1, 0x138(%r12)
movslq 0x114(%r12), %r15
movsd 0x30(%r12), %xmm0
movsd 0x38(%r12), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0x49360
movsd 0x3140(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x43dce
movq 0x5c38(%rax), %rax
imulq $0x3700, %r15, %rcx     # imm = 0x3700
movsd -0x40(%rbp), %xmm0
mulsd 0x3028(%rax,%rcx), %xmm0
addsd 0xcfe8(%rip), %xmm0     # 0x69058
movsd -0x30(%rbp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x158(%r12)
movq 0x8(%rbx), %rsi
movl %r14d, %ecx
movq 0x20f8(%rsi), %rax
movq 0x2100(%rsi), %rdx
movq %rdx, %rdi
subq %rax, %rdi
sarq $0x3, %rdi
incl %r14d
cmpq %rcx, %rdi
ja 0x5bb26
jmp 0x5c0b3
movq %r13, %rsi
cmpq %rax, %rdx
je 0x5c16b
movl $0x1, %r12d
xorl %ecx, %ecx
leaq -0x48(%rbp), %r14
movq (%rax,%rcx,8), %r15
cmpb $0x1, 0x112(%r15)
jne 0x5c147
movl 0x11c(%r15), %eax
movl %eax, -0x48(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x5c17a
movsd %xmm0, 0x140(%r15)
movl 0x11c(%r15), %eax
movl %eax, -0x48(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x5c17a
movsd %xmm0, 0x148(%r15)
callq 0x43dce
movsd 0x31a8(%rax), %xmm0
ucomisd 0xd12a(%rip), %xmm0     # 0x69258
movq 0x8(%rbx), %rsi
jbe 0x5c147
movq %r15, %rdi
callq 0x4d734
movb %al, 0x150(%r15)
movq 0x8(%rbx), %rsi
movl %r12d, %ecx
movq 0x20f8(%rsi), %rax
movq 0x2100(%rsi), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %r12d
cmpq %rcx, %rdx
ja 0x5c0c8
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq