// File: 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
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0xbc6e0
movq %rax, %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x90(%rbp), %rax
movl -0x14(%rbp), %ecx
movq %rcx, -0x98(%rbp)
movq 0x8(%rax), %rdi
callq 0x81040
movq %rax, %rdi
callq 0x81170
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
jae 0xad364
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x81040
movq %rax, %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
callq 0x81190
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x23f20
testb $0x1, %al
jne 0xacf71
jmp 0xad356
movq -0x10(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0x110a0
movsd %xmm0, -0x40(%rbp)
movsd %xmm1, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x11170
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x11110
movsd %xmm0, -0x30(%rbp)
movsd %xmm1, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x332f0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x99(%rbp)
jne 0xad067
leaq -0x30(%rbp), %rdi
callq 0x104e0
movsd %xmm0, -0xb0(%rbp)
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movsd (%rax), %xmm0
movsd %xmm0, -0xb8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1b470
movl %eax, -0x4c(%rbp)
leaq -0x4c(%rbp), %rdi
callq 0xbc700
movsd -0xb8(%rbp), %xmm2
movsd -0xb0(%rbp), %xmm1
cvtsi2sd %eax, %xmm0
movsd 0x18706(%rip), %xmm3    # 0xc5758
mulsd %xmm3, %xmm0
addsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
seta %al
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0xad073
jmp 0xad0ae
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x7d290
movq -0x20(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x20(%rbp), %rdi
callq 0x10a60
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x111b0
movq -0xc0(%rbp), %rdi
callq 0xbc720
jmp 0xad0c5
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x7d290
movq -0x20(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0xbc720
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x7d240
movq -0x20(%rbp), %rdi
callq 0x1b470
movl %eax, %ecx
movq -0x90(%rbp), %rax
movl %ecx, -0xc4(%rbp)
movq 0x8(%rax), %rdi
callq 0x1eeb0
movl %eax, %ecx
movl -0xc4(%rbp), %eax
cmpl %ecx, %eax
je 0xad132
movq -0x20(%rbp), %rdi
callq 0x1b470
movl %eax, %ecx
movq -0x90(%rbp), %rax
movl %ecx, -0xc8(%rbp)
movq 0x8(%rax), %rdi
callq 0x25310
movl %eax, %edx
movl -0xc8(%rbp), %eax
xorl %ecx, %ecx
subl %edx, %ecx
cmpl %ecx, %eax
jne 0xad314
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x10ed0
cmpl $0x1, %eax
je 0xad160
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x10ed0
cmpl $0x33, %eax
jne 0xad312
leaq -0x30(%rbp), %rdi
callq 0x104e0
movsd %xmm0, -0xd0(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x4f380
movsd -0xd0(%rbp), %xmm1
movsd (%rax), %xmm0
movsd 0x150e6(%rip), %xmm2    # 0xc2278
subsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xad312
movq -0x20(%rbp), %rdi
callq 0x1b470
movl %eax, %ecx
movq -0x90(%rbp), %rax
movl %ecx, -0xd4(%rbp)
movq 0x8(%rax), %rdi
callq 0x1eeb0
movl %eax, %ecx
movl -0xd4(%rbp), %eax
cmpl %ecx, %eax
jne 0xad272
callq 0x855e0
movq %rax, %rdi
callq 0x1fe50
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movsd 0x13e1b(%rip), %xmm0    # 0xc1008
movsd %xmm0, -0x58(%rbp)
leaq -0x58(%rbp), %rdx
callq 0x1d850
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xd5(%rbp)
jne 0xad20c
jmp 0xad253
callq 0x855e0
movq %rax, %rdi
callq 0x1fe50
movq %rax, -0xe0(%rbp)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq -0xe0(%rbp), %rdi
movq %rax, %rsi
movsd 0x13dc9(%rip), %xmm0    # 0xc1008
movsd %xmm0, -0x60(%rbp)
leaq -0x60(%rbp), %rdx
callq 0x1d850
movb %al, -0xd5(%rbp)
movb -0xd5(%rbp), %al
testb $0x1, %al
jne 0xad25f
jmp 0xad26d
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x7d240
jmp 0xad310
callq 0x855e0
movq %rax, %rdi
callq 0x8b2f0
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movsd 0x13d7a(%rip), %xmm0    # 0xc1008
movsd %xmm0, -0x68(%rbp)
leaq -0x68(%rbp), %rdx
callq 0x1d850
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xe1(%rbp)
jne 0xad2ad
jmp 0xad2f4
callq 0x855e0
movq %rax, %rdi
callq 0x8b2f0
movq %rax, -0xf0(%rbp)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq -0xf0(%rbp), %rdi
movq %rax, %rsi
movsd 0x13d28(%rip), %xmm0    # 0xc1008
movsd %xmm0, -0x70(%rbp)
leaq -0x70(%rbp), %rdx
callq 0x1d850
movb %al, -0xe1(%rbp)
movb -0xe1(%rbp), %al
testb $0x1, %al
jne 0xad300
jmp 0xad30e
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x7d240
jmp 0xad310
jmp 0xad312
jmp 0xad314
movq -0x20(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x10a60
movl %eax, -0xfc(%rbp)
movq -0x20(%rbp), %rdi
callq 0x10a80
movq %rax, %rdi
callq 0x104e0
movl -0xfc(%rbp), %edi
callq 0x570a0
movq -0xf8(%rbp), %rdi
callq 0x7d330
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xacf06
movl $0x0, -0x74(%rbp)
movq -0x90(%rbp), %rax
movl -0x74(%rbp), %ecx
movq %rcx, -0x108(%rbp)
movq 0x8(%rax), %rdi
callq 0x81040
movq %rax, %rdi
callq 0x81170
movq %rax, %rcx
movq -0x108(%rbp), %rax
cmpq %rcx, %rax
jae 0xad4b6
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x81040
movq %rax, %rdi
movl -0x74(%rbp), %eax
movl %eax, %esi
callq 0x81190
movq (%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rdi
callq 0x23f20
testb $0x1, %al
jne 0xad3d6
jmp 0xad4a8
movq -0x80(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x80(%rbp), %rdi
callq 0x1b470
movq -0x90(%rbp), %rdi
movl %eax, -0x84(%rbp)
leaq -0x84(%rbp), %rsi
xorl %edx, %edx
callq 0xad4c0
movq -0x118(%rbp), %rdi
xorl %esi, %esi
callq 0x7d350
movq -0x80(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x80(%rbp), %rdi
callq 0x1b470
movq -0x90(%rbp), %rdi
movl %eax, -0x88(%rbp)
leaq -0x88(%rbp), %rsi
movl $0x1, %edx
callq 0xad4c0
movq -0x110(%rbp), %rdi
movl $0x1, %esi
callq 0x7d350
callq 0x798a0
movq %rax, %rdi
callq 0x176d0
movsd (%rax), %xmm0
movsd 0x13d71(%rip), %xmm1    # 0xc11e0
ucomisd %xmm1, %xmm0
jbe 0xad4a6
movq -0x90(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, -0x120(%rbp)
movq -0x80(%rbp), %rdi
movq 0x8(%rax), %rsi
callq 0x8c3e0
movq -0x120(%rbp), %rdi
movzbl %al, %esi
andl $0x1, %esi
callq 0x7d3b0
jmp 0xad4a8
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0xad36b
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nop