// File: /workspace/github_cpp_makefile_star2_O3/wrighteagle2d[P]wrighteaglebase/Debug/../src/BehaviorDribble.cpp
// Function: BehaviorDribbleExecuter::Execute(ActiveBehavior const&)
bool BehaviorDribbleExecuter::Execute(const ActiveBehavior &dribble) {
  Logger::instance().LogDribble(mBallState.GetPos(), dribble.mTarget,
                                "@Dribble", true);

  if (dribble.mDetailType == BDT_Dribble_Normal) {
    Vector ballpos = mBallState.GetPos();
    PlayerState oppState =
        mWorldState.GetOpponent(mPositionInfo.GetClosestOpponentToBall());
    Vector posOpp = oppState.GetPos();
    ballpos = mBallState.GetPredictedPos(1);
    Vector agentpos = mSelfState.GetPos();
    Vector agent_v = agentpos - mSelfState.GetPos();
    AngleDeg agentang = mSelfState.GetBodyDir();

    AtomicAction act;

    if (mSelfState.GetStamina() < 2700) {
      Dasher::instance().GoToPoint(mAgent, act, dribble.mTarget, 0.01, 30);
    } else {
      Dasher::instance().GoToPoint(mAgent, act, dribble.mTarget, 0.01, 100);
    }

    act.mDashPower =
        MinMax(-ServerParam::instance().maxDashPower(), act.mDashPower,
               ServerParam::instance().maxDashPower());

    agent_v = mSelfState.GetVel() * mSelfState.GetDecay();
    if (act.mType != CT_Dash) {
      agentpos = mSelfState.GetPredictedPos(1);
    } else
      agentpos =
          mSelfState.GetPredictedPosWithDash(1, act.mDashPower, act.mDashDir);

    bool collide = mSelfState.GetCollideWithPlayer();
    if (ballpos.Dist(agentpos) > 0.95 * (mSelfState.GetKickableArea()) ||
        collide) // will not be kickable or will make a collision ??
    {
      int p = ((mBallState.GetPos() - mSelfState.GetPos()).Dir() -
               mSelfState.GetBodyDir()) > 0
                  ? 1
                  : -1;
      double outSpeed = mSelfState.GetVel().Mod();
      if (act.mType == CT_Dash && fabs(act.mDashDir) < FLOAT_EPS)
        outSpeed += mSelfState.GetAccelerationFront(act.mDashPower);
      if ((agentpos +
           Polar2Vector(mSelfState.GetKickableArea(), agentang + p * 45) -
           mBallState.GetPos())
              .Mod() <
          (agentpos +
           Polar2Vector(mSelfState.GetKickableArea(), agentang + p * 45) -
           mSelfState.GetPos())
              .Mod()) {
        if (mSelfState.GetStamina() < 2700) {
          return Dasher::instance().GoToPoint(mAgent, dribble.mTarget, 0.01,
                                              30); // dash slow
        } else
          return Dasher::instance().GoToPoint(mAgent, dribble.mTarget, 0.01,
                                              100);
      }
      return Kicker::instance().KickBall(
          mAgent,
          agentpos +
              Polar2Vector(mSelfState.GetKickableArea(), agentang + p * 45),
          outSpeed, KM_Hard);
    } else {
      if (mSelfState.GetStamina() < 2700) {
        return Dasher::instance().GoToPoint(mAgent, dribble.mTarget, 0.01,
                                            30); // dash slow
      } else
        return Dasher::instance().GoToPoint(mAgent, dribble.mTarget, 0.01, 100);
    }
  } else /*if(dribble.mDetailType == BDT_Dribble_Fast)*/ {
    return Kicker::instance().KickBall(mAgent, dribble.mAngle,
                                       dribble.mKickSpeed, KM_Quick);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rsi, %r14
movq %rdi, %rbx
callq 0x34c60
movq 0x18(%rbx), %rsi
addq $0x8, %rsi
leaq 0x28(%r14), %rdx
leaq 0x559d5(%rip), %rcx     # 0x697d7
movq %rax, %rdi
movl $0x1, %r8d
callq 0x35578
cmpl $0x6, 0x98(%r14)
jne 0x1406d
movq %r14, -0x48(%rbp)
movq 0x10(%rbx), %r13
movq 0x28(%rbx), %rdi
callq 0x14f02
decl %eax
cltq
imulq $0x178, %rax, %r14      # imm = 0x178
leaq (%r14,%r13), %r15
addq $0x10d0, %r15           # imm = 0x10D0
leaq -0x248(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x14fbe
leaq 0x6f00a(%rip), %rax     # 0x82e68
movq %rax, (%r12)
movups 0x78(%r15), %xmm0
movupd 0x88(%r15), %xmm1
movups %xmm0, 0x78(%r12)
movupd %xmm1, 0x88(%r12)
movsd 0x98(%r15), %xmm0
movsd %xmm0, 0x98(%r12)
movl 0xa0(%r15), %eax
movl %eax, 0xa0(%r12)
movsd 0xa8(%r15), %xmm0
movsd %xmm0, 0xa8(%r12)
movsd 0xb0(%r15), %xmm0
movsd %xmm0, 0xb0(%r12)
movl 0xb8(%r15), %eax
movl %eax, 0xb8(%r12)
movsd 0xc0(%r15), %xmm0
movsd %xmm0, 0xc0(%r12)
movq 0xc8(%r15), %rax
movq %rax, 0xc8(%r12)
xorpd %xmm1, %xmm1
movupd %xmm1, 0xd0(%r12)
movq $0x0, 0xe0(%r12)
movups 0xd0(%r15), %xmm0
movups %xmm0, 0xd0(%r12)
movq 0xe0(%r15), %rax
movq %rax, 0xe0(%r12)
movl 0xe8(%r15), %eax
movl %eax, 0xe8(%r12)
movsd 0xf0(%r15), %xmm0
movsd %xmm0, 0xf0(%r12)
movb $0x3f, 0xf8(%r12)
movl $0x0, 0xfc(%r12)
movq 0xf8(%r15), %rax
movq %rax, 0xf8(%r12)
movl 0x100(%r15), %eax
movl %eax, 0x100(%r12)
movsd 0x108(%r15), %xmm0
movsd %xmm0, 0x108(%r12)
leaq -0x138(%rbp), %rax
leaq 0x11e0(%r13,%r14), %rdx
movl $0xc, %ecx
movq %rax, %rdi
movq %rdx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x60(%rdx), %ecx
movl 0x63(%rdx), %edx
movl %ecx, 0x60(%rax)
movl %edx, 0x63(%rax)
movq 0x18(%rbx), %rax
movq 0x68(%rax), %r15
movl $0x1, -0xb0(%rbp)
movl $0x1, %eax
cmpl $0x0, 0x668(%r15)
jg 0x13fff
leaq -0xb0(%rbp), %rsi
movq %r15, %rdi
callq 0xef58
movslq -0xb0(%rbp), %rax
xorpd %xmm1, %xmm1
shlq $0x4, %rax
movsd 0x8(%r15,%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0x10(%r15,%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq 0x20(%rbx), %rax
movsd 0xb0(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movb $0x0, -0xb0(%rbp)
movupd %xmm1, -0xac(%rbp)
movupd %xmm1, -0x9c(%rbp)
movupd %xmm1, -0x90(%rbp)
movsd 0x556d5(%rip), %xmm0    # 0x69728
ucomisd 0x78(%rax), %xmm0
jbe 0x140a5
callq 0x1f148
movq -0x48(%rbp), %r12
movsd 0x556cd(%rip), %xmm3    # 0x69738
jmp 0x140b6
callq 0x2d3f2
movq 0x8(%rbx), %rsi
movsd 0x20(%r14), %xmm0
movsd 0x48(%r14), %xmm1
movq %rax, %rdi
movl $0x2, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30394
callq 0x1f148
movq -0x48(%rbp), %r12
movsd 0x5567a(%rip), %xmm3    # 0x69730
movq 0x8(%rbx), %rsi
movsd 0x28(%r12), %xmm0
movsd 0x30(%r12), %xmm1
leaq -0xb0(%rbp), %rdx
movsd 0x55669(%rip), %xmm2    # 0x69740
movq %rax, %rdi
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x1f1a0
callq 0x49360
movsd 0x33c0(%rax), %xmm0
movapd %xmm0, -0x60(%rbp)
callq 0x49360
movapd -0x60(%rbp), %xmm0
xorpd 0x54f15(%rip), %xmm0    # 0x69020
movsd -0x90(%rbp), %xmm1
maxsd %xmm0, %xmm1
movsd 0x33c0(%rax), %xmm0
minsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movq 0x20(%rbx), %rdi
cmpl $0x2, -0xac(%rbp)
jne 0x14156
movsd -0x88(%rbp), %xmm1
movl $0x1, %esi
callq 0x45c5c
movsd %xmm0, -0x60(%rbp)
movsd %xmm1, -0x40(%rbp)
jmp 0x1419c
movq 0x68(%rdi), %r15
movl $0x1, -0x78(%rbp)
movl $0x1, %eax
cmpl $0x0, 0x668(%r15)
jg 0x14180
leaq -0x78(%rbp), %rsi
movq %r15, %rdi
callq 0xef58
movslq -0x78(%rbp), %rax
shlq $0x4, %rax
movsd 0x8(%r15,%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd 0x10(%r15,%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq 0x20(%rbx), %rdi
movb 0x121(%rdi), %r14b
movq (%rdi), %rax
callq *0x10(%rax)
movsd -0x30(%rbp), %xmm0
subsd -0x60(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
subsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd (%rax), %xmm1
mulsd 0x5556b(%rip), %xmm1    # 0x69748
ucomisd %xmm1, %xmm0
ja 0x14211
testb %r14b, %r14b
jne 0x14211
movq 0x20(%rbx), %rax
movsd 0x55534(%rip), %xmm0    # 0x69728
ucomisd 0x78(%rax), %xmm0
jbe 0x14477
callq 0x1f148
movsd 0x5552c(%rip), %xmm3    # 0x69738
jmp 0x14484
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %r15
movsd 0x8(%rax), %xmm1
movsd 0x10(%rax), %xmm0
subsd 0x8(%r15), %xmm1
subsd 0x10(%r15), %xmm0
movapd 0x54dd9(%rip), %xmm2    # 0x69010
movapd %xmm1, %xmm3
andpd %xmm2, %xmm3
movsd 0x54df9(%rip), %xmm4    # 0x69040
ucomisd %xmm3, %xmm4
jbe 0x14260
andpd %xmm0, %xmm2
xorpd %xmm3, %xmm3
movsd %xmm3, -0x30(%rbp)
ucomisd %xmm2, %xmm4
ja 0x14286
callq 0x90d0
movsd 0x54dd3(%rip), %xmm4    # 0x69040
mulsd 0x54dd3(%rip), %xmm0    # 0x69048
divsd 0x54dd3(%rip), %xmm0    # 0x69050
movsd %xmm0, -0x30(%rbp)
movq 0x20(%rbx), %r15
movsd 0xb0(%r15), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x30(%r15), %xmm0
movsd 0x38(%r15), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x68(%rbp)
cmpl $0x2, -0xac(%rbp)
jne 0x1430c
movsd -0x88(%rbp), %xmm0
andpd 0x54d42(%rip), %xmm0    # 0x69010
ucomisd %xmm0, %xmm4
jbe 0x1430c
callq 0x43dce
leaq -0x90(%rbp), %rsi
movslq 0x114(%r15), %rcx
imulq $0x3700, %rcx, %rdi     # imm = 0x3700
addq 0x5c38(%rax), %rdi
callq 0x43d6a
movsd -0x68(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, -0x68(%rbp)
movq 0x20(%rbx), %r15
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq %rax, %r15
xorl %eax, %eax
movsd -0x30(%rbp), %xmm0
ucomisd -0x38(%rbp), %xmm0
seta %al
leaq 0x55462(%rip), %rcx     # 0x69790
movsd -0x50(%rbp), %xmm0
addsd (%rcx,%rax,8), %xmm0
mulsd 0x54d10(%rip), %xmm0    # 0x69050
divsd 0x54d00(%rip), %xmm0    # 0x69048
leaq -0x78(%rbp), %r12
leaq -0x80(%rbp), %r13
movsd %xmm0, -0x50(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x92d0
movsd (%r12), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd (%r13), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd (%r15), %xmm0
movsd %xmm0, -0xc8(%rbp)
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rdi
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0xc0(%rbp)
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %r15
movsd -0x30(%rbp), %xmm0
movsd -0xc8(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd -0x60(%rbp), %xmm0
subsd -0xb8(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm2, %xmm1
addsd -0x40(%rbp), %xmm1
subsd -0xc0(%rbp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x50(%rbp), %xmm0
movq %r12, %rdi
movq %r13, %rsi
callq 0x92d0
movsd (%r15), %xmm0
movsd (%r13), %xmm1
mulsd %xmm0, %xmm1
mulsd (%r12), %xmm0
addsd -0x60(%rbp), %xmm1
addsd -0x40(%rbp), %xmm0
movq 0x20(%rbx), %rax
subsd 0x8(%rax), %xmm1
subsd 0x10(%rax), %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
ucomisd -0x30(%rbp), %xmm0
jbe 0x144b2
movsd 0x552d2(%rip), %xmm0    # 0x69728
ucomisd 0x78(%rax), %xmm0
jbe 0x14536
callq 0x1f148
movq -0x48(%rbp), %rcx
movsd 0x552c6(%rip), %xmm3    # 0x69738
jmp 0x14547
callq 0x1f148
movsd 0x552ac(%rip), %xmm3    # 0x69730
movq 0x8(%rbx), %rsi
movsd 0x28(%r12), %xmm0
movsd 0x30(%r12), %xmm1
movsd 0x552a2(%rip), %xmm2    # 0x69740
movq %rax, %rdi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x20f68
jmp 0x1456c
callq 0x2d3f2
movq %rax, %r14
movq 0x8(%rbx), %r15
movq 0x20(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %rbx
leaq -0x80(%rbp), %r12
leaq -0xd0(%rbp), %r13
movsd -0x50(%rbp), %xmm0
movq %r12, %rdi
movq %r13, %rsi
callq 0x92d0
movsd (%rbx), %xmm0
movsd (%r13), %xmm1
mulsd %xmm0, %xmm1
mulsd (%r12), %xmm0
movsd -0x60(%rbp), %xmm2
addsd %xmm1, %xmm2
movsd -0x40(%rbp), %xmm1
addsd %xmm0, %xmm1
leaq -0x78(%rbp), %rdx
movsd %xmm2, (%rdx)
movsd %xmm1, 0x8(%rdx)
movq %r14, %rdi
movq %r15, %rsi
movsd -0x68(%rbp), %xmm0
movl $0x1, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3043a
jmp 0x1456c
callq 0x1f148
movq -0x48(%rbp), %rcx
movsd 0x551e9(%rip), %xmm3    # 0x69730
movq 0x8(%rbx), %rsi
movsd 0x28(%rcx), %xmm0
movsd 0x30(%rcx), %xmm1
movsd 0x551e3(%rip), %xmm2    # 0x69740
movq %rax, %rdi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x20f68
movl %eax, %ebx
leaq 0x6de5b(%rip), %rax     # 0x823d0
movq %rax, -0x248(%rbp)
movq -0x1e0(%rbp), %rdi
movl $0x670, %esi            # imm = 0x670
callq 0x94e0
movl %ebx, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x145b3
jmp 0x145b3
jmp 0x145b3
jmp 0x145b3
jmp 0x145b3
jmp 0x145b3
jmp 0x145b3
jmp 0x145b3
jmp 0x145b3
movq %rax, %rbx
leaq 0x6de13(%rip), %rax     # 0x823d0
movq %rax, -0x248(%rbp)
movq -0x1e0(%rbp), %rdi
movl $0x670, %esi            # imm = 0x670
callq 0x94e0
movq %rbx, %rdi
callq 0x98b0
nop