// File: /workspace/github_cpp_makefile_star2_O1/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
cmpq %rax, 0x2100(%r13)
je 0x5d9e3
movl $0x1, %r14d
xorl %ecx, %ecx
movq %rbx, -0x70(%rbp)
movq (%rax,%rcx,8), %r12
cmpb $0x1, 0x112(%r12)
jne 0x5d9bb
movsd 0x38(%r13), %xmm1
movsd 0x40(%r13), %xmm0
subsd 0x8(%r12), %xmm1
movsd %xmm1, -0x40(%rbp)
subsd 0x10(%r12), %xmm0
movapd %xmm0, -0x50(%rbp)
movsd 0xb0(%r12), %xmm0
mulsd 0xdc61(%rip), %xmm0     # 0x6b0a0
divsd 0xdc01(%rip), %xmm0     # 0x6b048
leaq -0x68(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x92d0
movsd -0x68(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
movsd -0x40(%rbp), %xmm3
movapd %xmm3, %xmm2
mulsd %xmm0, %xmm3
movapd -0x50(%rbp), %xmm4
mulsd %xmm4, %xmm0
mulsd %xmm1, %xmm2
subsd %xmm0, %xmm2
mulsd %xmm1, %xmm4
addsd %xmm3, %xmm4
movapd %xmm4, -0x50(%rbp)
cmpl $0x0, 0xc8(%r12)
jg 0x5d5a5
cmpl $0x0, 0x124(%r12)
jg 0x5d5a5
movapd -0x50(%rbp), %xmm0
mulsd %xmm0, %xmm0
movapd %xmm2, -0x90(%rbp)
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
ucomisd 0xdbc8(%rip), %xmm2     # 0x6b090
movapd %xmm2, -0x60(%rbp)
jb 0x5d4d8
xorps %xmm0, %xmm0
sqrtsd %xmm2, %xmm0
jmp 0x5d4e1
movapd %xmm2, %xmm0
callq 0x93c0
movsd %xmm0, -0x40(%rbp)
movq (%r12), %rax
movq %r12, %rdi
callq *0x10(%rax)
movl 0x11c(%r12), %ecx
sarl $0x1f, %ecx
orl $0x1, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
mulsd 0x12203(%rip), %xmm0    # 0x6f710
addsd (%rax), %xmm0
ucomisd -0x40(%rbp), %xmm0
movapd -0x90(%rbp), %xmm2
jbe 0x5d5a5
movb $0x1, 0x128(%r12)
movslq 0x114(%r12), %r15
movapd %xmm2, %xmm0
andpd 0xdacf(%rip), %xmm0     # 0x6b010
movsd 0xdaf7(%rip), %xmm1     # 0x6b040
ucomisd %xmm0, %xmm1
jbe 0x5d56e
movapd -0x50(%rbp), %xmm0
andpd 0xdab4(%rip), %xmm0     # 0x6b010
xorpd %xmm3, %xmm3
movsd 0xdad8(%rip), %xmm1     # 0x6b040
ucomisd %xmm0, %xmm1
ja 0x5d590
movapd -0x50(%rbp), %xmm0
movapd %xmm2, %xmm1
callq 0x90d0
movapd %xmm0, %xmm3
mulsd 0xdac0(%rip), %xmm3     # 0x6b048
divsd 0xdac0(%rip), %xmm3     # 0x6b050
movapd -0x60(%rbp), %xmm0
ucomisd 0xdaf3(%rip), %xmm0     # 0x6b090
jb 0x5d5b7
sqrtsd %xmm0, %xmm0
jmp 0x5d5c6
movb $0x0, 0x128(%r12)
xorpd %xmm0, %xmm0
jmp 0x5d6aa
movapd %xmm3, -0x40(%rbp)
callq 0x93c0
movapd -0x40(%rbp), %xmm3
movsd %xmm0, -0x60(%rbp)
andpd 0xda3d(%rip), %xmm3     # 0x6b010
movapd %xmm3, -0x40(%rbp)
callq 0x450ba
movq 0x5c38(%rax), %rax
imulq $0x3700, %r15, %r15     # imm = 0x3700
movsd -0x60(%rbp), %xmm0
subsd 0x3038(%rax,%r15), %xmm0
movsd %xmm0, -0x60(%rbp)
callq 0x4a75c
movsd -0x60(%rbp), %xmm0
subsd 0x30d8(%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
callq 0x450ba
movq 0x5c38(%rax), %rax
movsd 0x3068(%rax,%r15), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd 0xda6f(%rip), %xmm0     # 0x6b0a8
movapd -0x40(%rbp), %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, -0x40(%rbp)
movapd -0x40(%rbp), %xmm1
divsd 0xda0c(%rip), %xmm1     # 0x6b060
movapd %xmm1, -0x40(%rbp)
movapd -0x40(%rbp), %xmm1
addsd 0xd9f2(%rip), %xmm1     # 0x6b058
movapd %xmm1, -0x40(%rbp)
movsd -0x60(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x60(%rbp)
callq 0x450ba
movapd -0x40(%rbp), %xmm0
movq 0x5c38(%rax), %rax
movsd -0x60(%rbp), %xmm1
divsd 0x3040(%rax,%r15), %xmm1
subsd %xmm1, %xmm0
mulsd -0x78(%rbp), %xmm0
movapd -0x90(%rbp), %xmm2
movsd %xmm0, 0x130(%r12)
movb $0x0, 0x138(%r12)
movl 0x11c(%r12), %ecx
movq 0x8(%rbx), %rax
cmpl 0x2110(%rax), %ecx
je 0x5d6dd
addl 0x2114(%rax), %ecx
jne 0x5d931
movl 0x1c(%rax), %eax
cmpl $0x33, %eax
je 0x5d6ee
cmpl $0x1, %eax
jne 0x5d931
movapd -0x50(%rbp), %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
ucomisd 0xd989(%rip), %xmm2     # 0x6b090
jb 0x5d712
xorps %xmm0, %xmm0
sqrtsd %xmm2, %xmm0
jmp 0x5d71b
movapd %xmm2, %xmm0
callq 0x93c0
movsd %xmm0, -0x50(%rbp)
callq 0x4a75c
movsd 0x3458(%rax), %xmm0
addsd 0x11fdb(%rip), %xmm0    # 0x6f710
ucomisd -0x50(%rbp), %xmm0
jbe 0x5d931
movl 0x11c(%r12), %r15d
movq 0x8(%rbx), %rax
movl 0x2110(%rax), %ebx
callq 0x4a75c
movq %r13, %rcx
movsd 0x38(%r13), %xmm0
cmpl %ebx, %r15d
jne 0x5d84c
movsd 0x3830(%rax), %xmm1
addsd 0xd8ff(%rip), %xmm1     # 0x6b078
ucomisd %xmm1, %xmm0
movq %rcx, %r13
movq -0x70(%rbp), %rbx
jb 0x5d931
movsd 0x3838(%rax), %xmm1
addsd 0xd8a6(%rip), %xmm1     # 0x6b040
ucomisd %xmm0, %xmm1
jb 0x5d931
movsd 0x40(%r13), %xmm0
movsd 0x3840(%rax), %xmm1
addsd 0xd8be(%rip), %xmm1     # 0x6b078
ucomisd %xmm1, %xmm0
jb 0x5d931
movsd 0x3848(%rax), %xmm1
addsd 0xd86c(%rip), %xmm1     # 0x6b040
ucomisd %xmm0, %xmm1
jb 0x5d931
callq 0x4a75c
movsd 0x8(%r12), %xmm0
movsd 0x3830(%rax), %xmm1
addsd 0xd87e(%rip), %xmm1     # 0x6b078
ucomisd %xmm1, %xmm0
jb 0x5d931
movsd 0x3838(%rax), %xmm1
addsd 0xd82c(%rip), %xmm1     # 0x6b040
ucomisd %xmm0, %xmm1
jb 0x5d931
movsd 0x10(%r12), %xmm0
movsd 0x3840(%rax), %xmm1
addsd 0xd843(%rip), %xmm1     # 0x6b078
ucomisd %xmm1, %xmm0
jb 0x5d931
movsd 0x3848(%rax), %xmm1
jmp 0x5d91a
movsd 0x3850(%rax), %xmm1
addsd 0xd81c(%rip), %xmm1     # 0x6b078
ucomisd %xmm1, %xmm0
movq %rcx, %r13
movq -0x70(%rbp), %rbx
jb 0x5d931
movsd 0x3858(%rax), %xmm1
addsd 0xd7c3(%rip), %xmm1     # 0x6b040
ucomisd %xmm0, %xmm1
jb 0x5d931
movsd 0x40(%r13), %xmm0
movsd 0x3860(%rax), %xmm1
addsd 0xd7db(%rip), %xmm1     # 0x6b078
ucomisd %xmm1, %xmm0
jb 0x5d931
movsd 0x3868(%rax), %xmm1
addsd 0xd789(%rip), %xmm1     # 0x6b040
ucomisd %xmm0, %xmm1
jb 0x5d931
callq 0x4a75c
movsd 0x8(%r12), %xmm0
movsd 0x3850(%rax), %xmm1
addsd 0xd79f(%rip), %xmm1     # 0x6b078
ucomisd %xmm1, %xmm0
jb 0x5d931
movsd 0x3858(%rax), %xmm1
addsd 0xd751(%rip), %xmm1     # 0x6b040
ucomisd %xmm0, %xmm1
jb 0x5d931
movsd 0x10(%r12), %xmm0
movsd 0x3860(%rax), %xmm1
addsd 0xd76c(%rip), %xmm1     # 0x6b078
ucomisd %xmm1, %xmm0
jb 0x5d931
movsd 0x3868(%rax), %xmm1
addsd 0xd71e(%rip), %xmm1     # 0x6b040
ucomisd %xmm0, %xmm1
jb 0x5d931
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
ucomisd 0xd735(%rip), %xmm0     # 0x6b090
jb 0x5d963
sqrtsd %xmm0, %xmm0
jmp 0x5d968
callq 0x93c0
movsd %xmm0, -0x50(%rbp)
callq 0x4a75c
movsd 0x3140(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0x450ba
movq 0x5c38(%rax), %rax
imulq $0x3700, %r15, %rcx     # imm = 0x3700
movsd -0x50(%rbp), %xmm0
mulsd 0x3028(%rax,%rcx), %xmm0
addsd 0xd6b0(%rip), %xmm0     # 0x6b058
movsd -0x40(%rbp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x158(%r12)
movl %r14d, %ecx
movq 0x8(%rbx), %rdx
movq 0x20f8(%rdx), %rax
movq 0x2100(%rdx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %r14d
cmpq %rcx, %rdx
ja 0x5d3f6
movq 0x8(%rbx), %rcx
movq 0x20f8(%rcx), %rax
cmpq %rax, 0x2100(%rcx)
je 0x5daaa
movl $0x1, %r12d
xorl %ecx, %ecx
leaq -0x68(%rbp), %r14
movq (%rax,%rcx,8), %r15
cmpb $0x1, 0x112(%r15)
jne 0x5da82
movl 0x11c(%r15), %eax
movl %eax, -0x68(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x5daba
movsd %xmm0, 0x140(%r15)
movl 0x11c(%r15), %eax
movl %eax, -0x68(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x5daba
movsd %xmm0, 0x148(%r15)
callq 0x450ba
movsd 0x31a8(%rax), %xmm0
ucomisd 0xd7eb(%rip), %xmm0     # 0x6b258
jbe 0x5da82
movq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x4eda0
movb %al, 0x150(%r15)
movl %r12d, %ecx
movq 0x8(%rbx), %rdx
movq 0x20f8(%rdx), %rax
movq 0x2100(%rdx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %r12d
cmpq %rcx, %rdx
ja 0x5da07
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop