// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x20f8(%rax), %rcx
cmpq %rcx, 0x2100(%rax)
je 0x6179a
movl $0x1, %r15d
xorl %edx, %edx
leaq -0x50(%rbp), %r14
movq (%rcx,%rdx,8), %rdi
movl 0x11c(%rdi), %ecx
cmpl 0x14(%rbx), %ecx
je 0x61776
cmpb $0x1, 0x112(%rdi)
jne 0x61776
cmpb $0x0, 0x175(%rdi)
jne 0x616d6
cmpl $0x0, 0x114(%rdi)
je 0x61776
movups 0x30(%rdi), %xmm0
movaps %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
movsd -0x48(%rbp), %xmm2
movapd %xmm2, %xmm1
mulsd %xmm2, %xmm1
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
addsd %xmm1, %xmm3
xorps %xmm5, %xmm5
sqrtsd %xmm3, %xmm5
movsd 0x58(%rdi), %xmm1
movsd 0x60(%rdi), %xmm3
movapd %xmm3, %xmm4
mulsd %xmm1, %xmm4
ucomisd %xmm4, %xmm5
jbe 0x61776
xorpd %xmm4, %xmm4
ucomisd %xmm4, %xmm5
movsd 0x792d(%rip), %xmm6     # 0x69058
divsd %xmm5, %xmm6
ja 0x61737
xorpd %xmm0, %xmm0
jmp 0x6173b
mulsd %xmm6, %xmm0
mulsd %xmm6, %xmm2
cmpltsd %xmm5, %xmm4
andpd %xmm2, %xmm4
mulsd %xmm3, %xmm0
mulsd %xmm3, %xmm4
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm4
movsd %xmm0, -0x50(%rbp)
movsd %xmm4, -0x48(%rbp)
movl 0x40(%rdi), %edx
movsd 0x48(%rdi), %xmm0
movq %r14, %rsi
callq 0xf53c
movq 0x8(%rbx), %rax
movl %r15d, %edx
movq 0x20f8(%rax), %rcx
movq 0x2100(%rax), %rsi
subq %rcx, %rsi
sarq $0x3, %rsi
incl %r15d
cmpq %rdx, %rsi
ja 0x616a0
movups 0x60(%rax), %xmm0
movaps %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm1
movsd -0x48(%rbp), %xmm0
movapd %xmm0, -0x70(%rbp)
mulsd %xmm0, %xmm0
movsd %xmm1, -0x20(%rbp)
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0x49360
movsd 0x30f8(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x49360
movsd -0x40(%rbp), %xmm3
movsd -0x28(%rbp), %xmm0
mulsd 0x30e0(%rax), %xmm0
ucomisd %xmm0, %xmm3
jbe 0x618b1
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm3
movsd 0x7847(%rip), %xmm0     # 0x69058
divsd %xmm3, %xmm0
movapd -0x70(%rbp), %xmm1
mulsd %xmm0, %xmm1
ja 0x6182b
xorpd %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0x61839
movsd -0x20(%rbp), %xmm4
mulsd %xmm0, %xmm4
movsd %xmm4, -0x20(%rbp)
cmpltsd %xmm3, %xmm2
andpd %xmm1, %xmm2
movapd %xmm2, -0x40(%rbp)
callq 0x49360
movsd 0x30f8(%rax), %xmm0
movsd -0x20(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x20(%rbp)
movapd -0x40(%rbp), %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, -0x40(%rbp)
callq 0x49360
movsd 0x30e0(%rax), %xmm0
movsd -0x20(%rbp), %xmm2
mulsd %xmm0, %xmm2
movapd -0x40(%rbp), %xmm1
mulsd %xmm0, %xmm1
leaq -0x50(%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 0xf53c
movq 0x8(%rbx), %rax
movups 0x38(%rax), %xmm0
movaps %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0x49360
leaq 0xa615(%rip), %rax      # 0x6bee8
movsd (%rax), %xmm0
movsd 0x7f99(%rip), %xmm1     # 0x69878
movsd %xmm0, -0x20(%rbp)
mulsd %xmm0, %xmm1
movsd %xmm1, -0x28(%rbp)
callq 0x49360
movsd -0x28(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jae 0x6192e
movsd -0x20(%rbp), %xmm0
mulsd 0x7779(%rip), %xmm0     # 0x69088
ucomisd %xmm1, %xmm0
jb 0x6193b
movsd %xmm0, -0x20(%rbp)
callq 0x49360
movsd -0x20(%rbp), %xmm0
addsd 0x7714(%rip), %xmm0     # 0x69040
jmp 0x61936
addsd 0x7742(%rip), %xmm0     # 0x69078
movsd %xmm0, -0x60(%rbp)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0x49360
leaq 0xa59f(%rip), %rax      # 0x6bef0
movsd (%rax), %xmm0
movsd 0x7f1b(%rip), %xmm1     # 0x69878
movsd %xmm0, -0x20(%rbp)
mulsd %xmm0, %xmm1
movsd %xmm1, -0x28(%rbp)
callq 0x49360
movsd -0x28(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jae 0x619ac
movsd -0x20(%rbp), %xmm0
mulsd 0x76fb(%rip), %xmm0     # 0x69088
ucomisd %xmm1, %xmm0
jb 0x619b9
movsd %xmm0, -0x20(%rbp)
callq 0x49360
movsd -0x20(%rbp), %xmm0
addsd 0x7696(%rip), %xmm0     # 0x69040
jmp 0x619b4
addsd 0x76c4(%rip), %xmm0     # 0x69078
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 0xf572
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop