// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movb $0x0, 0x2c(%rdi)
movl $0x0, 0x30(%rdi)
movb $0x1, 0x34(%rdi)
movl $0x1, %r14d
movl $0x1b9, %r15d           # imm = 0x1B9
movl 0x14(%rbx), %eax
cmpq %rax, %r14
je 0x63ea3
movq 0x8(%rbx), %rax
cmpb $0x0, (%rax,%r15)
jne 0x63ef9
movl -0x49(%rax,%r15), %r12d
callq 0x49360
movl 0x3320(%rax), %eax
decl %eax
cmpl %eax, %r12d
je 0x63ef9
leaq -0x1(%r14), %rax
movq 0x8(%rbx), %rcx
imulq $0x178, %rax, %rax      # imm = 0x178
cmpb $0x0, 0x11e1(%rcx,%rax)
jne 0x63ef0
addq %rcx, %rax
addq $0x10d0, %rax           # imm = 0x10D0
movl 0xc8(%rax), %r12d
callq 0x49360
movl 0x3320(%rax), %eax
decl %eax
cmpl %eax, %r12d
je 0x63ef0
incq %r14
addq $0x178, %r15            # imm = 0x178
cmpq $0xb, %r14
jne 0x63e79
jmp 0x63f01
movb $0x1, 0x2c(%rbx)
negl %r14d
jmp 0x63efd
movb $0x1, 0x2c(%rbx)
movl %r14d, 0x30(%rbx)
movq 0x8(%rbx), %rax
cmpl $0x1, 0x48(%rax)
jg 0x63fd2
movslq 0x14(%rbx), %rcx
imulq $0x178, %rcx, %rdx      # imm = 0x178
cmpb $0x1, 0x58(%rax,%rdx)
jne 0x63fd2
movl %ecx, %ecx
movsd 0x38(%rax), %xmm0
movsd 0x40(%rax), %xmm1
imulq $0x178, %rcx, %rcx      # imm = 0x178
addq $-0x178, %rcx           # imm = 0xFE88
movsd 0x97d9(%rip), %xmm2     # 0x6d720
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x63f82
movsd 0xb0(%rax,%rdx), %xmm3
movsd 0xb8(%rax,%rdx), %xmm4
subsd %xmm0, %xmm3
subsd %xmm1, %xmm4
mulsd %xmm4, %xmm4
mulsd %xmm3, %xmm3
addsd %xmm4, %xmm3
sqrtsd %xmm3, %xmm3
ucomisd %xmm3, %xmm2
jbe 0x63f82
movapd %xmm3, %xmm2
movapd %xmm2, %xmm3
movsd 0x10d8(%rax,%rdx), %xmm2
movsd 0x10e0(%rax,%rdx), %xmm4
subsd %xmm0, %xmm2
subsd %xmm1, %xmm4
mulsd %xmm4, %xmm4
mulsd %xmm2, %xmm2
addsd %xmm4, %xmm2
sqrtsd %xmm2, %xmm2
minsd %xmm3, %xmm2
addq $0x178, %rdx            # imm = 0x178
cmpq $0x1028, %rdx           # imm = 0x1028
jne 0x63f49
ucomisd 0x579c(%rip), %xmm2     # 0x69768
jbe 0x63fd2
movb $0x0, 0x34(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq