// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0x0, 0x2c(%rdi)
andl $0x0, 0x30(%rdi)
movb $0x1, 0x34(%rdi)
pushq $0x1
popq %r14
movl $0x1b9, %r15d           # imm = 0x1B9
cmpq $0xb, %r14
je 0x52e01
movl 0x14(%rbx), %eax
cmpq %rax, %r14
je 0x52da5
movq 0x8(%rbx), %rax
cmpb $0x0, (%rax,%r15)
jne 0x52df9
movl -0x49(%rax,%r15), %r12d
callq 0x3db2c
movl 0x3320(%rax), %eax
decl %eax
cmpl %eax, %r12d
je 0x52df9
leaq -0x1(%r14), %rax
movl %r14d, %r12d
movq 0x8(%rbx), %rcx
imulq $0x178, %rax, %rax      # imm = 0x178
cmpb $0x0, 0x11e1(%rcx,%rax)
jne 0x52ded
addq %rcx, %rax
addq $0x10d0, %rax           # imm = 0x10D0
movl 0xc8(%rax), %r13d
callq 0x3db2c
movl 0x3320(%rax), %eax
decl %eax
incq %r14
addq $0x178, %r15            # imm = 0x178
cmpl %eax, %r13d
jne 0x52d71
movb $0x1, 0x2c(%rbx)
negl %r12d
movl %r12d, %r14d
jmp 0x52dfd
movb $0x1, 0x2c(%rbx)
movl %r14d, 0x30(%rbx)
movq 0x8(%rbx), %rax
cmpl $0x1, 0x48(%rax)
jg 0x52ed4
movslq 0x14(%rbx), %rcx
imulq $0x178, %rcx, %rdx      # imm = 0x178
cmpb $0x1, 0x58(%rax,%rdx)
jne 0x52ed4
movl %ecx, %ecx
movsd 0x38(%rax), %xmm0
movsd 0x40(%rax), %xmm1
imulq $0x178, %rcx, %rcx      # imm = 0x178
addq $-0x178, %rcx           # imm = 0xFE88
movsd 0x88b9(%rip), %xmm2     # 0x5b700
xorl %edx, %edx
cmpq $0x1028, %rdx           # imm = 0x1028
je 0x52ec6
cmpq %rdx, %rcx
je 0x52e8b
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 0x52e8b
movapd %xmm3, %xmm2
movsd 0x10d8(%rax,%rdx), %xmm3
movsd 0x10e0(%rax,%rdx), %xmm4
subsd %xmm0, %xmm3
subsd %xmm1, %xmm4
mulsd %xmm4, %xmm4
mulsd %xmm3, %xmm3
addsd %xmm4, %xmm3
sqrtsd %xmm3, %xmm3
minsd %xmm2, %xmm3
addq $0x178, %rdx            # imm = 0x178
movapd %xmm3, %xmm2
jmp 0x52e49
ucomisd 0x4872(%rip), %xmm2     # 0x57740
jbe 0x52ed4
movb $0x0, 0x34(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq