// File: /workspace/github_cpp_makefile_star2_O1/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
subq $0x20, %rsp
movq %rdi, %rbx
movb $0x0, 0x2c(%rdi)
movl $0x0, 0x30(%rdi)
movb $0x1, 0x34(%rdi)
movl $0x1, %r14d
xorl %r15d, %r15d
movl 0x14(%rbx), %eax
cmpq %rax, %r14
je 0x66097
movq 0x8(%rbx), %rax
cmpb $0x0, 0x1b9(%rax,%r15)
jne 0x660db
movl 0x170(%rax,%r15), %r12d
callq 0x4a75c
movl 0x3320(%rax), %eax
decl %eax
cmpl %eax, %r12d
je 0x660db
movq 0x8(%rbx), %rax
cmpb $0x0, 0x11e1(%rax,%r15)
jne 0x660d2
movl 0x1198(%rax,%r15), %r12d
callq 0x4a75c
movl 0x3320(%rax), %eax
decl %eax
cmpl %eax, %r12d
je 0x660d2
incq %r14
addq $0x178, %r15            # imm = 0x178
cmpq $0xb, %r14
jne 0x66066
jmp 0x660e3
movb $0x1, 0x2c(%rbx)
negl %r14d
jmp 0x660df
movb $0x1, 0x2c(%rbx)
movl %r14d, 0x30(%rbx)
movq 0x8(%rbx), %rax
cmpl $0x1, 0x48(%rax)
jg 0x662b8
movslq 0x14(%rbx), %rcx
imulq $0x178, %rcx, %rcx      # imm = 0x178
cmpb $0x1, 0x58(%rax,%rcx)
jne 0x662b8
movsd 0x38(%rax), %xmm2
movsd 0x40(%rax), %xmm3
movsd 0x9647(%rip), %xmm5     # 0x6f760
movl $0x1, %r14d
xorl %r15d, %r15d
xorpd %xmm4, %xmm4
movsd %xmm2, -0x30(%rbp)
movsd %xmm3, -0x28(%rbp)
movl 0x14(%rbx), %eax
cmpq %rax, %r14
je 0x661e9
movq 0x8(%rbx), %rax
movsd 0xb0(%rax,%r15), %xmm0
movsd 0xb8(%rax,%r15), %xmm1
subsd %xmm2, %xmm0
subsd %xmm3, %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm4, %xmm0
jb 0x66174
sqrtsd %xmm0, %xmm0
jmp 0x66191
movsd %xmm5, -0x38(%rbp)
callq 0x93c0
movsd -0x38(%rbp), %xmm5
xorpd %xmm4, %xmm4
movsd -0x28(%rbp), %xmm3
movsd -0x30(%rbp), %xmm2
ucomisd %xmm0, %xmm5
jbe 0x661e9
movq 0x8(%rbx), %rax
movsd 0xb0(%rax,%r15), %xmm0
movsd 0xb8(%rax,%r15), %xmm1
subsd %xmm2, %xmm0
subsd %xmm3, %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm4, %xmm0
jb 0x661d2
xorps %xmm5, %xmm5
sqrtsd %xmm0, %xmm5
jmp 0x661e9
callq 0x93c0
xorpd %xmm4, %xmm4
movsd -0x28(%rbp), %xmm3
movsd -0x30(%rbp), %xmm2
movapd %xmm0, %xmm5
movq 0x8(%rbx), %rax
movsd 0x10d8(%rax,%r15), %xmm0
movsd 0x10e0(%rax,%r15), %xmm1
subsd %xmm2, %xmm0
subsd %xmm3, %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm4, %xmm0
jb 0x66221
sqrtsd %xmm0, %xmm0
jmp 0x6623e
movsd %xmm5, -0x38(%rbp)
callq 0x93c0
movsd -0x38(%rbp), %xmm5
xorpd %xmm4, %xmm4
movsd -0x28(%rbp), %xmm3
movsd -0x30(%rbp), %xmm2
ucomisd %xmm0, %xmm5
jbe 0x66296
movq 0x8(%rbx), %rax
movsd 0x10d8(%rax,%r15), %xmm0
movsd 0x10e0(%rax,%r15), %xmm1
subsd %xmm2, %xmm0
subsd %xmm3, %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm4, %xmm0
jb 0x6627f
xorps %xmm5, %xmm5
sqrtsd %xmm0, %xmm5
jmp 0x66296
callq 0x93c0
xorpd %xmm4, %xmm4
movsd -0x28(%rbp), %xmm3
movsd -0x30(%rbp), %xmm2
movapd %xmm0, %xmm5
incq %r14
addq $0x178, %r15            # imm = 0x178
cmpq $0xc, %r14
jne 0x66130
ucomisd 0x54b6(%rip), %xmm5     # 0x6b768
jbe 0x662b8
movb $0x0, 0x34(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq