// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/Strategy.cpp
// Function: Strategy::AdjustTargetForSetplay(Vector)
Vector Strategy::AdjustTargetForSetplay(Vector target) {
  if (mWorldState.GetPlayMode() > PM_Opp_Mode) {
    while (target.Dist(mBallState.GetPos()) <
           ServerParam::instance().offsideKickMargin() + 0.5) {
      target.SetX(target.X() - 0.5);
    }

    if (mWorldState.GetPlayMode() == PM_Opp_Kick_Off) {
      target.SetX(Min(target.X(), -0.1));
    } else if (mWorldState.GetPlayMode() == PM_Opp_Offside_Kick) {
      target.SetX(Min(target.X(), mBallState.GetPos().X() - 0.5));
    } else if (mWorldState.GetPlayMode() == PM_Opp_Goal_Kick) {
      if (ServerParam::instance().oppPenaltyArea().IsWithin(target)) {
        if (mSelfState.GetPos().X() <
            ServerParam::instance().oppPenaltyArea().Left()) {
          if (mSelfState.GetPos().Y() <
              ServerParam::instance().oppPenaltyArea().Top()) {
            target = ServerParam::instance().oppPenaltyArea().TopLeftCorner();
          } else if (mSelfState.GetPos().Y() >
                     ServerParam::instance().oppPenaltyArea().Bottom()) {
            target =
                ServerParam::instance().oppPenaltyArea().BottomLeftCorner();
          } else {
            target.SetX(
                Min(target.X(),
                    ServerParam::instance().oppPenaltyArea().Left() - 0.5));
          }
        } else {
          if (mSelfState.GetPos().Y() <
              ServerParam::instance().oppPenaltyArea().Top()) {
            target.SetY(
                Min(target.Y(),
                    ServerParam::instance().oppPenaltyArea().Top() - 0.5));
          } else if (mSelfState.GetPos().Y() >
                     ServerParam::instance().oppPenaltyArea().Bottom()) {
            target.SetY(
                Max(target.Y(),
                    ServerParam::instance().oppPenaltyArea().Bottom() + 0.5));
          } else {
            target = mSelfState.GetPos(); // do nothing
          }
        }
      }
    }
  }

  return target;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movsd %xmm0, -0x20(%rbp)
movsd %xmm1, -0x18(%rbp)
movq %rdi, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x88(%rbp)
movq 0x18(%rax), %rdi
callq 0x10ed0
cmpl $0x24, %eax
jle 0x8af8b
jmp 0x8aad8
movq -0x88(%rbp), %rax
movq 0x20(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rsi
leaq -0x20(%rbp), %rdi
callq 0x1d6d0
movsd %xmm0, -0x90(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x8b2d0
movsd -0x90(%rbp), %xmm1
movsd 0x36503(%rip), %xmm0    # 0xc1020
addsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x8ab54
leaq -0x20(%rbp), %rdi
callq 0x176f0
movsd (%rax), %xmm0
movsd 0x364e4(%rip), %xmm1    # 0xc1020
subsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1ee90
jmp 0x8aad8
movq -0x88(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x10ed0
cmpl $0x25, %eax
jne 0x8ab9c
leaq -0x20(%rbp), %rdi
callq 0x176f0
movq %rax, %rdi
movsd 0x38a03(%rip), %xmm0    # 0xc3580
movsd %xmm0, -0x38(%rbp)
leaq -0x38(%rbp), %rsi
callq 0x12a60
movq %rax, %rsi
leaq -0x20(%rbp), %rdi
callq 0x1ee90
jmp 0x8af89
movq -0x88(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x10ed0
cmpl $0x2c, %eax
jne 0x8ac16
leaq -0x20(%rbp), %rdi
callq 0x176f0
movq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, -0x98(%rbp)
movq 0x20(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
callq 0x176f0
movq -0x98(%rbp), %rdi
movsd (%rax), %xmm0
movsd 0x3642d(%rip), %xmm1    # 0xc1020
subsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
leaq -0x40(%rbp), %rsi
callq 0x12a60
movq %rax, %rsi
leaq -0x20(%rbp), %rdi
callq 0x1ee90
jmp 0x8af87
movq -0x88(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x10ed0
cmpl $0x28, %eax
jne 0x8af85
callq 0x855e0
movq %rax, %rdi
callq 0x8b2f0
movq %rax, %rdi
movsd 0x363c1(%rip), %xmm0    # 0xc1008
movsd %xmm0, -0x48(%rbp)
leaq -0x20(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x1d850
testb $0x1, %al
jne 0x8ac62
jmp 0x8af83
movq -0x88(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
callq 0x176f0
movsd (%rax), %xmm0
movsd %xmm0, -0xa0(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x8b2f0
movq %rax, %rdi
callq 0x8b310
movsd -0xa0(%rbp), %xmm1
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x8ae11
movq -0x88(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
callq 0x17700
movsd (%rax), %xmm0
movsd %xmm0, -0xa8(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x8b2f0
movq %rax, %rdi
callq 0x23f40
movsd -0xa8(%rbp), %xmm1
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x8ad38
callq 0x855e0
movq %rax, %rdi
callq 0x8b2f0
movq %rax, %rdi
callq 0x49350
movsd %xmm0, -0x58(%rbp)
movsd %xmm1, -0x50(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x8ae0c
movq -0x88(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
callq 0x17700
movsd (%rax), %xmm0
movsd %xmm0, -0xb0(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x8b2f0
movq %rax, %rdi
callq 0x23f60
movsd -0xb0(%rbp), %xmm0
ucomisd (%rax), %xmm0
jbe 0x8adb4
callq 0x855e0
movq %rax, %rdi
callq 0x8b2f0
movq %rax, %rdi
callq 0x493c0
movsd %xmm0, -0x68(%rbp)
movsd %xmm1, -0x60(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x8ae0a
leaq -0x20(%rbp), %rdi
callq 0x176f0
movq %rax, -0xb8(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x8b2f0
movq %rax, %rdi
callq 0x8b310
movq -0xb8(%rbp), %rdi
movsd (%rax), %xmm0
movsd 0x36234(%rip), %xmm1    # 0xc1020
subsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
leaq -0x70(%rbp), %rsi
callq 0x12a60
movq %rax, %rsi
leaq -0x20(%rbp), %rdi
callq 0x1ee90
jmp 0x8ae0c
jmp 0x8af81
movq -0x88(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
callq 0x17700
movsd (%rax), %xmm0
movsd %xmm0, -0xc0(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x8b2f0
movq %rax, %rdi
callq 0x23f40
movsd -0xc0(%rbp), %xmm1
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x8aebb
leaq -0x20(%rbp), %rdi
callq 0x17700
movq %rax, -0xc8(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x8b2f0
movq %rax, %rdi
callq 0x23f40
movq -0xc8(%rbp), %rdi
movsd (%rax), %xmm0
movsd 0x36188(%rip), %xmm1    # 0xc1020
subsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
leaq -0x78(%rbp), %rsi
callq 0x12a60
movq %rax, %rsi
leaq -0x20(%rbp), %rdi
callq 0x26210
jmp 0x8af7f
movq -0x88(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
callq 0x17700
movsd (%rax), %xmm0
movsd %xmm0, -0xd0(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x8b2f0
movq %rax, %rdi
callq 0x23f60
movsd -0xd0(%rbp), %xmm0
ucomisd (%rax), %xmm0
jbe 0x8af5a
leaq -0x20(%rbp), %rdi
callq 0x17700
movq %rax, -0xd8(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x8b2f0
movq %rax, %rdi
callq 0x23f60
movq -0xd8(%rbp), %rdi
movsd 0x360e6(%rip), %xmm0    # 0xc1020
addsd (%rax), %xmm0
movsd %xmm0, -0x80(%rbp)
leaq -0x80(%rbp), %rsi
callq 0x12a90
movq %rax, %rsi
leaq -0x20(%rbp), %rdi
callq 0x26210
jmp 0x8af7d
movq -0x88(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq (%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x8af7f
jmp 0x8af81
jmp 0x8af83
jmp 0x8af85
jmp 0x8af87
jmp 0x8af89
jmp 0x8af8b
movups -0x20(%rbp), %xmm0
movaps %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)