// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/WorldState.cpp
// Function: WorldStateUpdater::UpdateOtherKick()
void WorldStateUpdater::UpdateOtherKick() {
  mIsOtherKick = false;
  mOtherKickUnum = 0;
  mIsOtherMayKick = true;
  for (int i = 1; i < TEAMSIZE; i++) {
    if (i != mSelfUnum) {
      if (Teammate(i).IsKicked() ||
          Teammate(i).GetTackleBan() ==
              ServerParam::instance().tackleCycles() - 1) {
        mIsOtherKick = true;
        mOtherKickUnum = i;
        break;
      }
    }

    if (Opponent(i).IsKicked() ||
        Opponent(i).GetTackleBan() ==
            ServerParam::instance().tackleCycles() - 1) {
      mIsOtherKick = true;
      mOtherKickUnum = -i;
      break;
    }
  }

  double min_dist = 10000;
  int min_index;

  if (mpWorldState->GetBall().GetPosDelay() <= 1 && SelfState().IsKickable()) {
    Vector ball_pos = mpWorldState->GetBall().GetPos();
    for (int i = 1; i <= TEAMSIZE; i++) {
      if (i != mSelfUnum) {
        if (Teammate(i).GetPos().Dist(ball_pos) < min_dist) {
          min_dist = Teammate(i).GetPos().Dist(ball_pos);
          min_index = i;
        }
      }

      if (Opponent(i).GetPos().Dist(ball_pos) < min_dist) {
        min_dist = Opponent(i).GetPos().Dist(ball_pos);
        min_index = i;
      }
    }

    if (min_dist > 2.5) {
      mIsOtherMayKick = false;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movb $0x0, 0x2c(%rax)
movl $0x0, 0x30(%rax)
movb $0x1, 0x34(%rax)
movl $0x1, -0xc(%rbp)
cmpl $0xb, -0xc(%rbp)
jge 0xb7bb4
movq -0x40(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x14(%rcx), %eax
je 0xb7b4a
movq -0x40(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xbc780
movq %rax, %rdi
callq 0x7d2f0
testb $0x1, %al
jne 0xb7b38
movq -0x40(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xbc780
movq %rax, %rdi
callq 0x12c40
movl %eax, -0x44(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x78160
movl %eax, %ecx
movl -0x44(%rbp), %eax
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0xb7b48
movq -0x40(%rbp), %rax
movb $0x1, 0x2c(%rax)
movl -0xc(%rbp), %ecx
movl %ecx, 0x30(%rax)
jmp 0xb7bb4
jmp 0xb7b4a
movq -0x40(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xbc7e0
movq %rax, %rdi
callq 0x7d2f0
testb $0x1, %al
jne 0xb7b92
movq -0x40(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xbc7e0
movq %rax, %rdi
callq 0x12c40
movl %eax, -0x48(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x78160
movl %eax, %ecx
movl -0x48(%rbp), %eax
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0xb7ba4
movq -0x40(%rbp), %rax
movb $0x1, 0x2c(%rax)
xorl %ecx, %ecx
subl -0xc(%rbp), %ecx
movl %ecx, 0x30(%rax)
jmp 0xb7bb4
jmp 0xb7ba6
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xb7ada
movq -0x40(%rbp), %rax
movsd 0xb320(%rip), %xmm0     # 0xc2ee0
movsd %xmm0, -0x18(%rbp)
movq 0x8(%rax), %rdi
callq 0x10570
movq %rax, %rdi
addq $0x8, %rdi
callq 0x1ddd0
cmpl $0x1, %eax
jg 0xb7d33
movq -0x40(%rbp), %rdi
callq 0xbc740
movq %rax, %rdi
callq 0x10ef0
testb $0x1, %al
jne 0xb7bfd
jmp 0xb7d33
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x10570
movq %rax, %rdi
addq $0x8, %rdi
callq 0x11090
movq (%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x1, -0x34(%rbp)
cmpl $0xb, -0x34(%rbp)
jg 0xb7d16
movq -0x40(%rbp), %rcx
movl -0x34(%rbp), %eax
cmpl 0x14(%rcx), %eax
je 0xb7ca5
movq -0x40(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0xbc780
movq %rax, %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
leaq -0x30(%rbp), %rsi
callq 0x1d6d0
movaps %xmm0, %xmm1
movsd -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xb7ca3
movq -0x40(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0xbc780
movq %rax, %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
leaq -0x30(%rbp), %rsi
callq 0x1d6d0
movsd %xmm0, -0x18(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0xb7ca5
movq -0x40(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0xbc7e0
movq %rax, %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
leaq -0x30(%rbp), %rsi
callq 0x1d6d0
movaps %xmm0, %xmm1
movsd -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xb7d06
movq -0x40(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0xbc7e0
movq %rax, %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
leaq -0x30(%rbp), %rsi
callq 0x1d6d0
movsd %xmm0, -0x18(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0xb7d08
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xb7c2c
movsd -0x18(%rbp), %xmm0
movsd 0x99ed(%rip), %xmm1     # 0xc1710
ucomisd %xmm1, %xmm0
jbe 0xb7d31
movq -0x40(%rbp), %rax
movb $0x0, 0x34(%rax)
jmp 0xb7d33
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)