// File: /workspace/github_cpp_makefile_star2_O1/wrighteagle2d[P]wrighteaglebase/Debug/../src/WorldState.cpp
// Function: WorldStateUpdater::MaintainConsistency()
void WorldStateUpdater::MaintainConsistency() {
  for (unsigned int i = 0; i < mpWorldState->GetPlayerList().size(); ++i) {
    PlayerState *player = mpWorldState->GetPlayerList()[i];
    if (player->GetUnum() == mSelfUnum)
      continue;
    if (player->IsAlive()) {
      if (player->IsGoalie() || player->GetPlayerType() != 0) {
        Vector vel = player->GetVel();
        if (vel.Mod() > player->GetEffectiveSpeedMax() * player->GetDecay()) {
          vel = vel.Normalize() * player->GetEffectiveSpeedMax() *
                player->GetDecay();
          player->UpdateVel(vel, player->GetVelDelay(), player->GetVelConf());
        }
      }
    }
  }

  Vector vel = Ball().GetVel();
  if (vel.Mod() > ServerParam::instance().ballSpeedMax() *
                      ServerParam::instance().ballDecay()) {
    vel = vel.Normalize() * ServerParam::instance().ballSpeedMax() *
          ServerParam::instance().ballDecay();
    Ball().UpdateVel(vel, Ball().GetVelDelay(), Ball().GetVelConf());
  }

  {
    Vector pos = Ball().GetPos();

    if (pos.X() >= ServerParam::instance().PITCH_LENGTH * 0.5) {
      pos.SetX(ServerParam::instance().PITCH_LENGTH * 0.5 - FLOAT_EPS);
    } else if (pos.X() <= -ServerParam::instance().PITCH_LENGTH * 0.5) {
      pos.SetX(-ServerParam::instance().PITCH_LENGTH * 0.5 + FLOAT_EPS);
    }
    if (pos.Y() >= ServerParam::instance().PITCH_WIDTH * 0.5) {
      pos.SetY(ServerParam::instance().PITCH_WIDTH * 0.5 - FLOAT_EPS);
    } else if (pos.Y() <= -ServerParam::instance().PITCH_WIDTH * 0.5) {
      pos.SetY(-ServerParam::instance().PITCH_WIDTH * 0.5 + FLOAT_EPS);
    }

    Ball().UpdatePos(pos, Ball().GetPosDelay(), Ball().GetPosConf());
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdx
movq 0x20f8(%rdx), %rax
cmpq %rax, 0x2100(%rdx)
je 0x637a9
movl $0x1, %r12d
xorl %ecx, %ecx
leaq -0x40(%rbp), %r14
movq (%rax,%rcx,8), %r15
movl 0x11c(%r15), %eax
cmpl 0x14(%rbx), %eax
je 0x63781
cmpb $0x1, 0x112(%r15)
jne 0x63781
cmpb $0x0, 0x175(%r15)
jne 0x6367e
cmpl $0x0, 0x114(%r15)
je 0x63781
movups 0x30(%r15), %xmm0
movaps %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0x79eb(%rip), %xmm0     # 0x6b090
jb 0x636ad
sqrtsd %xmm0, %xmm0
jmp 0x636b2
callq 0x93c0
movsd 0x60(%r15), %xmm1
mulsd 0x58(%r15), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x63781
movsd -0x40(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0x79aa(%rip), %xmm0     # 0x6b090
jb 0x636ee
sqrtsd %xmm0, %xmm0
jmp 0x636f3
callq 0x93c0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
xorpd %xmm2, %xmm2
jbe 0x63746
movsd -0x40(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0x7971(%rip), %xmm0     # 0x6b090
jb 0x63727
sqrtsd %xmm0, %xmm0
jmp 0x6372c
callq 0x93c0
movsd 0x7924(%rip), %xmm2     # 0x6b058
divsd %xmm0, %xmm2
movsd -0x40(%rbp), %xmm1
mulsd %xmm2, %xmm1
mulsd -0x38(%rbp), %xmm2
movsd 0x58(%r15), %xmm0
movsd 0x60(%r15), %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm3, %xmm2
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm2
movsd %xmm1, -0x40(%rbp)
movsd %xmm2, -0x38(%rbp)
movl 0x40(%r15), %edx
movsd 0x48(%r15), %xmm0
movq %r15, %rdi
movq %r14, %rsi
callq 0xf64c
movl %r12d, %ecx
movq 0x8(%rbx), %rdx
movq 0x20f8(%rdx), %rax
movq 0x2100(%rdx), %rsi
subq %rax, %rsi
sarq $0x3, %rsi
incl %r12d
cmpq %rcx, %rsi
ja 0x63644
movups 0x60(%rdx), %xmm0
movaps %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x637d7
sqrtsd %xmm0, %xmm0
jmp 0x637dc
callq 0x93c0
movsd %xmm0, -0x28(%rbp)
callq 0x4a75c
movsd 0x30f8(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0x4a75c
movsd -0x48(%rbp), %xmm1
mulsd 0x30e0(%rax), %xmm1
movsd -0x28(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x63906
movsd -0x40(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x6383a
sqrtsd %xmm0, %xmm0
jmp 0x63843
callq 0x93c0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
xorpd %xmm2, %xmm2
jbe 0x63892
movsd -0x40(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x63873
sqrtsd %xmm0, %xmm0
jmp 0x63878
callq 0x93c0
movsd 0x77d8(%rip), %xmm2     # 0x6b058
divsd %xmm0, %xmm2
movsd -0x40(%rbp), %xmm1
mulsd %xmm2, %xmm1
mulsd -0x38(%rbp), %xmm2
movsd %xmm1, -0x48(%rbp)
movsd %xmm2, -0x28(%rbp)
callq 0x4a75c
movsd 0x30f8(%rax), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x48(%rbp)
movsd -0x28(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x28(%rbp)
callq 0x4a75c
movsd 0x30e0(%rax), %xmm0
movsd -0x48(%rbp), %xmm2
mulsd %xmm0, %xmm2
movsd -0x28(%rbp), %xmm1
mulsd %xmm0, %xmm1
leaq -0x40(%rbp), %rsi
movsd %xmm2, (%rsi)
movsd %xmm1, 0x8(%rsi)
movq 0x8(%rbx), %rax
leaq 0x30(%rax), %rdi
movl 0x70(%rax), %edx
movsd 0x78(%rax), %xmm0
callq 0xf64c
movq 0x8(%rbx), %rax
movups 0x38(%rax), %xmm0
movaps %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x4a75c
leaq 0xa5f0(%rip), %rax      # 0x6df18
movsd (%rax), %xmm0
movsd 0x7f44(%rip), %xmm1     # 0x6b878
mulsd %xmm0, %xmm1
movsd -0x28(%rbp), %xmm2
ucomisd %xmm1, %xmm2
jae 0x63984
movsd -0x60(%rbp), %xmm1
movsd %xmm1, -0x48(%rbp)
movsd %xmm0, -0x28(%rbp)
callq 0x4a75c
movsd -0x28(%rbp), %xmm0
mulsd 0x7724(%rip), %xmm0     # 0x6b088
ucomisd -0x48(%rbp), %xmm0
jb 0x639a0
movsd %xmm0, -0x28(%rbp)
callq 0x4a75c
movsd -0x28(%rbp), %xmm0
addsd 0x76be(%rip), %xmm0     # 0x6b040
jmp 0x6399b
movsd %xmm1, -0x28(%rbp)
callq 0x4a75c
movsd -0x28(%rbp), %xmm0
addsd 0x76dd(%rip), %xmm0     # 0x6b078
movsd %xmm0, -0x60(%rbp)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x4a75c
leaq 0xa56a(%rip), %rax      # 0x6df20
movsd (%rax), %xmm0
movsd 0x7eb6(%rip), %xmm1     # 0x6b878
mulsd %xmm0, %xmm1
movsd -0x28(%rbp), %xmm2
ucomisd %xmm1, %xmm2
jae 0x63a12
movsd -0x58(%rbp), %xmm1
movsd %xmm1, -0x48(%rbp)
movsd %xmm0, -0x28(%rbp)
callq 0x4a75c
movsd -0x28(%rbp), %xmm0
mulsd 0x7696(%rip), %xmm0     # 0x6b088
ucomisd -0x48(%rbp), %xmm0
jb 0x63a2e
movsd %xmm0, -0x28(%rbp)
callq 0x4a75c
movsd -0x28(%rbp), %xmm0
addsd 0x7630(%rip), %xmm0     # 0x6b040
jmp 0x63a29
movsd %xmm1, -0x28(%rbp)
callq 0x4a75c
movsd -0x28(%rbp), %xmm0
addsd 0x764f(%rip), %xmm0     # 0x6b078
movsd %xmm0, -0x58(%rbp)
movq 0x8(%rbx), %rax
leaq 0x30(%rax), %rdi
movl 0x48(%rax), %edx
movsd 0x50(%rax), %xmm0
leaq -0x60(%rbp), %rsi
callq 0xf682
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq