// File: 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
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movl $0x0, -0xc(%rbp)
movq -0xd0(%rbp), %rax
movl -0xc(%rbp), %ecx
movq %rcx, -0xd8(%rbp)
movq 0x8(%rax), %rdi
callq 0x81040
movq %rax, %rdi
callq 0x81170
movq %rax, %rcx
movq -0xd8(%rbp), %rax
cmpq %rcx, %rax
jae 0xb4c7c
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x81040
movq %rax, %rdi
movl -0xc(%rbp), %eax
movl %eax, %esi
callq 0x81190
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1b470
movq -0xd0(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jne 0xb4b34
jmp 0xb4c6e
movq -0x18(%rbp), %rdi
callq 0x23f20
testb $0x1, %al
jne 0xb4b46
jmp 0xb4c6c
movq -0x18(%rbp), %rdi
callq 0x1d780
testb $0x1, %al
jne 0xb4b65
movq -0x18(%rbp), %rdi
callq 0x10a60
cmpl $0x0, %eax
je 0xb4c6a
movq -0x18(%rbp), %rdi
callq 0x10a80
movq (%rax), %rcx
movq %rcx, -0x28(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x104e0
movsd %xmm0, -0xe0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1d810
movsd (%rax), %xmm0
movsd %xmm0, -0xe8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1d690
movsd -0xe8(%rbp), %xmm1
movsd -0xe0(%rbp), %xmm0
mulsd (%rax), %xmm1
ucomisd %xmm1, %xmm0
jbe 0xb4c68
leaq -0x28(%rbp), %rdi
callq 0xbd960
movsd %xmm0, -0x58(%rbp)
movsd %xmm1, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1d810
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x13320
movsd %xmm0, -0x48(%rbp)
movsd %xmm1, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1d690
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x13320
movsd %xmm0, -0x38(%rbp)
movsd %xmm1, -0x30(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x28a30
movl %eax, -0xec(%rbp)
movq -0x18(%rbp), %rdi
callq 0x32aa0
movq -0xf8(%rbp), %rdi
movl -0xec(%rbp), %edx
movsd (%rax), %xmm0
leaq -0x28(%rbp), %rsi
callq 0x142a0
jmp 0xb4c6a
jmp 0xb4c6c
jmp 0xb4c6e
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xb4ac1
movq -0xd0(%rbp), %rdi
callq 0xbc760
movq %rax, %rdi
callq 0x10a80
movq (%rax), %rcx
movq %rcx, -0x68(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x60(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x104e0
movsd %xmm0, -0x100(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x23d60
movsd (%rax), %xmm0
movsd %xmm0, -0x108(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x113d0
movsd -0x108(%rbp), %xmm1
movsd -0x100(%rbp), %xmm0
mulsd (%rax), %xmm1
ucomisd %xmm1, %xmm0
jbe 0xb4dc7
leaq -0x68(%rbp), %rdi
callq 0xbd960
movsd %xmm0, -0x98(%rbp)
movsd %xmm1, -0x90(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x23d60
movq %rax, %rsi
leaq -0x98(%rbp), %rdi
callq 0x13320
movsd %xmm0, -0x88(%rbp)
movsd %xmm1, -0x80(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x113d0
movq %rax, %rsi
leaq -0x88(%rbp), %rdi
callq 0x13320
movq -0xd0(%rbp), %rdi
movsd %xmm0, -0x78(%rbp)
movsd %xmm1, -0x70(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x60(%rbp)
callq 0xbc760
movq -0xd0(%rbp), %rdi
movq %rax, -0x118(%rbp)
callq 0xbc760
movq %rax, %rdi
callq 0x28a30
movq -0xd0(%rbp), %rdi
movl %eax, -0x10c(%rbp)
callq 0xbc760
movq %rax, %rdi
callq 0x32aa0
movq -0x118(%rbp), %rdi
movl -0x10c(%rbp), %edx
movsd (%rax), %xmm0
leaq -0x68(%rbp), %rsi
callq 0x142a0
movq -0xd0(%rbp), %rdi
callq 0xbc760
movq %rax, %rdi
addq $0x8, %rdi
callq 0x11090
movq (%rax), %rcx
movq %rcx, -0xa8(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0xa0(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x176f0
movsd (%rax), %xmm0
movsd %xmm0, -0x120(%rbp)
callq 0x855e0
movsd -0x120(%rbp), %xmm0
movsd 0xc1ff(%rip), %xmm1     # 0xc1020
leaq 0xf210(%rip), %rax      # 0xc4038
mulsd (%rax), %xmm1
ucomisd %xmm1, %xmm0
jb 0xb4e7a
callq 0x855e0
leaq 0xf1fa(%rip), %rax      # 0xc4038
movsd (%rax), %xmm0
movsd 0xc1d6(%rip), %xmm1     # 0xc1020
mulsd %xmm1, %xmm0
movsd 0xc9ca(%rip), %xmm1     # 0xc1820
addsd %xmm1, %xmm0
movsd %xmm0, -0xb0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x1ee90
jmp 0xb4f2f
leaq -0xa8(%rbp), %rdi
callq 0x176f0
movsd (%rax), %xmm0
movsd %xmm0, -0x128(%rbp)
callq 0x855e0
movsd -0x128(%rbp), %xmm1
leaq 0xf192(%rip), %rax      # 0xc4038
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0xc157(%rip), %xmm2     # 0xc1020
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0xb4f2d
callq 0x855e0
leaq 0xf159(%rip), %rax      # 0xc4038
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0xc11e(%rip), %xmm1     # 0xc1020
mulsd %xmm1, %xmm0
movsd 0xc0fa(%rip), %xmm1     # 0xc1008
addsd %xmm1, %xmm0
movsd %xmm0, -0xb8(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x1ee90
jmp 0xb4f2f
leaq -0xa8(%rbp), %rdi
callq 0x17700
movsd (%rax), %xmm0
movsd %xmm0, -0x130(%rbp)
callq 0x855e0
movsd -0x130(%rbp), %xmm0
movsd 0xc0c4(%rip), %xmm1     # 0xc1020
leaq 0xf0dd(%rip), %rax      # 0xc4040
mulsd (%rax), %xmm1
ucomisd %xmm1, %xmm0
jb 0xb4fb5
callq 0x855e0
leaq 0xf0c7(%rip), %rax      # 0xc4040
movsd (%rax), %xmm0
movsd 0xc09b(%rip), %xmm1     # 0xc1020
mulsd %xmm1, %xmm0
movsd 0xc88f(%rip), %xmm1     # 0xc1820
addsd %xmm1, %xmm0
movsd %xmm0, -0xc0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x26210
jmp 0xb506a
leaq -0xa8(%rbp), %rdi
callq 0x17700
movsd (%rax), %xmm0
movsd %xmm0, -0x138(%rbp)
callq 0x855e0
movsd -0x138(%rbp), %xmm1
leaq 0xf05f(%rip), %rax      # 0xc4040
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0xc01c(%rip), %xmm2     # 0xc1020
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0xb5068
callq 0x855e0
leaq 0xf026(%rip), %rax      # 0xc4040
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0xbfe3(%rip), %xmm1     # 0xc1020
mulsd %xmm1, %xmm0
movsd 0xbfbf(%rip), %xmm1     # 0xc1008
addsd %xmm1, %xmm0
movsd %xmm0, -0xc8(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x26210
jmp 0xb506a
movq -0xd0(%rbp), %rdi
callq 0xbc760
movq -0xd0(%rbp), %rdi
movq %rax, -0x148(%rbp)
callq 0xbc760
movq %rax, %rdi
addq $0x8, %rdi
callq 0x1ddd0
movq -0xd0(%rbp), %rdi
movl %eax, -0x13c(%rbp)
callq 0xbc760
movq %rax, %rdi
addq $0x8, %rdi
callq 0x1d930
movq -0x148(%rbp), %rdi
movl -0x13c(%rbp), %edx
movsd (%rax), %xmm0
leaq -0xa8(%rbp), %rsi
callq 0x142f0
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopl (%rax)