// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/WorldState.cpp
// Function: (anonymous namespace)::LimitToField(Vector)
Vector LimitToField(Vector pos) {
  if (pos.X() > ServerParam::instance().PITCH_LENGTH / 2) {
    pos.SetX(ServerParam::instance().PITCH_LENGTH / 2);
  } else if (pos.X() < -ServerParam::instance().PITCH_LENGTH / 2) {
    pos.SetX(-ServerParam::instance().PITCH_LENGTH / 2);
  }

  if (pos.Y() > ServerParam::instance().PITCH_WIDTH / 2) {
    pos.SetY(ServerParam::instance().PITCH_WIDTH / 2);
  } else if (pos.Y() < -ServerParam::instance().PITCH_WIDTH / 2) {
    pos.SetY(-ServerParam::instance().PITCH_WIDTH / 2);
  }

  return pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movsd %xmm0, -0x20(%rbp)
movsd %xmm1, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x176f0
movsd (%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0x855e0
movsd -0x48(%rbp), %xmm0
leaq 0xc223(%rip), %rax      # 0xc4038
movsd (%rax), %xmm1
movsd 0x968f(%rip), %xmm2     # 0xc14b0
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xb7e5e
callq 0x855e0
leaq 0xc201(%rip), %rax      # 0xc4038
movsd (%rax), %xmm0
movsd 0x966d(%rip), %xmm1     # 0xc14b0
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1ee90
jmp 0xb7ef5
leaq -0x20(%rbp), %rdi
callq 0x176f0
movsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0x855e0
movsd -0x50(%rbp), %xmm1
leaq 0xc1b7(%rip), %rax      # 0xc4038
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x960c(%rip), %xmm2     # 0xc14b0
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xb7ef3
callq 0x855e0
leaq 0xc17e(%rip), %rax      # 0xc4038
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x95d3(%rip), %xmm1     # 0xc14b0
divsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1ee90
jmp 0xb7ef5
leaq -0x20(%rbp), %rdi
callq 0x17700
movsd (%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
callq 0x855e0
movsd -0x58(%rbp), %xmm0
leaq 0xc128(%rip), %rax      # 0xc4040
movsd (%rax), %xmm1
movsd 0x958c(%rip), %xmm2     # 0xc14b0
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xb7f61
callq 0x855e0
leaq 0xc106(%rip), %rax      # 0xc4040
movsd (%rax), %xmm0
movsd 0x956a(%rip), %xmm1     # 0xc14b0
divsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x26210
jmp 0xb7ff8
leaq -0x20(%rbp), %rdi
callq 0x17700
movsd (%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
callq 0x855e0
movsd -0x60(%rbp), %xmm1
leaq 0xc0bc(%rip), %rax      # 0xc4040
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x9509(%rip), %xmm2     # 0xc14b0
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xb7ff6
callq 0x855e0
leaq 0xc083(%rip), %rax      # 0xc4040
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x94d0(%rip), %xmm1     # 0xc14b0
divsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x26210
jmp 0xb7ff8
movups -0x20(%rbp), %xmm0
movaps %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
addq $0x60, %rsp
popq %rbp
retq