// File: /workspace/github_cpp_makefile_star2_O1/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 $0x218, %rsp            # imm = 0x218
movq %rsi, %r14
movq %rdi, %rbx
callq 0x35b4a
movq 0x18(%rbx), %rsi
addq $0x8, %rsi
leaq 0x28(%r14), %rdx
leaq 0x57869(%rip), %rcx     # 0x6b7d7
movq %rax, %rdi
movl $0x1, %r8d
callq 0x36462
cmpl $0x6, 0x98(%r14)
jne 0x14150
movq %r14, -0x40(%rbp)
movq 0x10(%rbx), %r13
movq 0x28(%rbx), %rdi
callq 0x150fe
decl %eax
cltq
imulq $0x178, %rax, %r14      # imm = 0x178
leaq (%r14,%r13), %r15
addq $0x10d0, %r15           # imm = 0x10D0
leaq -0x238(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x151ba
leaq 0x71dfe(%rip), %rax     # 0x85dc8
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)
xorps %xmm0, %xmm0
movups %xmm0, 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 -0x128(%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, -0xb8(%rbp)
cmpl $0x0, 0x668(%r15)
jle 0x14188
addq $0x18, %r15
jmp 0x141a9
callq 0x2ddfa
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 $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30ece
leaq -0xb8(%rbp), %rsi
movq %r15, %rdi
callq 0xf062
movslq -0xb8(%rbp), %rax
shlq $0x4, %rax
addq %rax, %r15
addq $0x8, %r15
movq -0x40(%rbp), %r12
movsd (%r15), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0x8(%r15), %xmm0
movsd %xmm0, -0x50(%rbp)
movq 0x20(%rbx), %rax
movsd 0xb0(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movb $0x0, -0xb8(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, -0xb4(%rbp)
movups %xmm0, -0xa4(%rbp)
movups %xmm0, -0x98(%rbp)
movsd 0x5752e(%rip), %xmm0    # 0x6b728
ucomisd 0x78(%rax), %xmm0
jbe 0x14210
callq 0x1f5e8
movsd 0x5752a(%rip), %xmm3    # 0x6b738
jmp 0x1421d
callq 0x1f5e8
movsd 0x57513(%rip), %xmm3    # 0x6b730
movq 0x8(%rbx), %rsi
movsd 0x28(%r12), %xmm0
movsd 0x30(%r12), %xmm1
leaq -0xb8(%rbp), %rdx
movsd 0x57502(%rip), %xmm2    # 0x6b740
movq %rax, %rdi
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x1f640
callq 0x4a75c
movsd 0x33c0(%rax), %xmm0
movapd %xmm0, -0x70(%rbp)
callq 0x4a75c
movapd -0x70(%rbp), %xmm2
xorpd 0x56dae(%rip), %xmm2    # 0x6b020
movsd -0x98(%rbp), %xmm1
movsd 0x33c0(%rax), %xmm0
maxsd %xmm2, %xmm1
minsd %xmm1, %xmm0
movsd %xmm0, -0x98(%rbp)
movq 0x20(%rbx), %rdi
cmpl $0x2, -0xb4(%rbp)
jne 0x142b3
movsd -0x90(%rbp), %xmm1
movl $0x1, %esi
callq 0x46fba
jmp 0x142f4
movq 0x68(%rdi), %r15
movl $0x1, -0x80(%rbp)
cmpl $0x0, 0x668(%r15)
jle 0x142ce
addq $0x18, %r15
jmp 0x142e9
leaq -0x80(%rbp), %rsi
movq %r15, %rdi
callq 0xf062
movslq -0x80(%rbp), %rax
shlq $0x4, %rax
addq %rax, %r15
addq $0x8, %r15
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
movsd %xmm1, -0x58(%rbp)
movsd %xmm0, -0x70(%rbp)
movq 0x20(%rbx), %rax
movb 0x121(%rax), %r14b
movsd -0x30(%rbp), %xmm2
subsd %xmm0, %xmm2
movsd -0x50(%rbp), %xmm0
subsd %xmm1, %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
movapd %xmm2, %xmm0
jb 0x1433b
sqrtsd %xmm0, %xmm0
jmp 0x14340
callq 0x93c0
movsd %xmm0, -0x30(%rbp)
movq 0x20(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movsd (%rax), %xmm0
mulsd 0x573ed(%rip), %xmm0    # 0x6b748
movsd -0x30(%rbp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x14394
testb %r14b, %r14b
jne 0x14394
movq 0x20(%rbx), %rax
movsd 0x573b1(%rip), %xmm0    # 0x6b728
ucomisd 0x78(%rax), %xmm0
jbe 0x14543
callq 0x1f5e8
movsd 0x573a9(%rip), %xmm3    # 0x6b738
jmp 0x14550
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rcx
movsd 0x8(%rax), %xmm1
movsd 0x10(%rax), %xmm0
subsd 0x8(%rcx), %xmm1
subsd 0x10(%rcx), %xmm0
movapd 0x56c58(%rip), %xmm2    # 0x6b010
movapd %xmm1, %xmm3
andpd %xmm2, %xmm3
movsd 0x56c78(%rip), %xmm4    # 0x6b040
ucomisd %xmm3, %xmm4
jbe 0x143dc
andpd %xmm0, %xmm2
xorpd %xmm3, %xmm3
ucomisd %xmm2, %xmm4
ja 0x143fd
callq 0x90d0
movsd 0x56c57(%rip), %xmm4    # 0x6b040
movapd %xmm0, %xmm3
mulsd 0x56c53(%rip), %xmm3    # 0x6b048
divsd 0x56c53(%rip), %xmm3    # 0x6b050
movq 0x20(%rbx), %rax
movsd 0xb0(%rax), %xmm2
movsd 0x30(%rax), %xmm0
movsd 0x38(%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movsd %xmm3, -0x30(%rbp)
movsd %xmm2, -0x50(%rbp)
jb 0x14439
sqrtsd %xmm0, %xmm0
jmp 0x14446
callq 0x93c0
movsd 0x56bfa(%rip), %xmm4    # 0x6b040
movsd %xmm0, -0x38(%rbp)
cmpl $0x2, -0xb4(%rbp)
jne 0x144a2
movsd -0x90(%rbp), %xmm0
andpd 0x56bac(%rip), %xmm0    # 0x6b010
ucomisd %xmm0, %xmm4
jbe 0x144a2
movq 0x20(%rbx), %r14
callq 0x450ba
leaq -0x98(%rbp), %rsi
movslq 0x114(%r14), %rcx
imulq $0x3700, %rcx, %rdi     # imm = 0x3700
addq 0x5c38(%rax), %rdi
callq 0x45056
movsd -0x38(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq 0x20(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %r15
xorl %eax, %eax
movsd -0x30(%rbp), %xmm0
ucomisd -0x50(%rbp), %xmm0
seta %al
leaq 0x572cb(%rip), %rcx     # 0x6b790
movsd -0x48(%rbp), %xmm0
addsd (%rcx,%rax,8), %xmm0
mulsd 0x56b79(%rip), %xmm0    # 0x6b050
divsd 0x56b69(%rip), %xmm0    # 0x6b048
leaq -0x80(%rbp), %r12
leaq -0x88(%rbp), %r13
movsd %xmm0, -0x48(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x92d0
movsd (%r15), %xmm1
movsd (%r13), %xmm0
mulsd %xmm1, %xmm0
mulsd (%r12), %xmm1
addsd -0x70(%rbp), %xmm0
addsd -0x58(%rbp), %xmm1
movq 0x18(%rbx), %rax
subsd 0x8(%rax), %xmm0
subsd 0x10(%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1457e
sqrtsd %xmm0, %xmm0
jmp 0x14583
callq 0x1f5e8
movsd 0x571e0(%rip), %xmm3    # 0x6b730
movq 0x8(%rbx), %rsi
movsd 0x28(%r12), %xmm0
movsd 0x30(%r12), %xmm1
movsd 0x571d6(%rip), %xmm2    # 0x6b740
movq %rax, %rdi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x2157e
jmp 0x146e6
callq 0x93c0
movsd %xmm0, -0x30(%rbp)
movq 0x20(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %r15
movsd -0x48(%rbp), %xmm0
movq %r12, %rdi
movq %r13, %rsi
callq 0x92d0
movsd (%r15), %xmm1
movsd (%r13), %xmm0
mulsd %xmm1, %xmm0
mulsd (%r12), %xmm1
addsd -0x70(%rbp), %xmm0
addsd -0x58(%rbp), %xmm1
movq 0x20(%rbx), %rax
subsd 0x8(%rax), %xmm0
subsd 0x10(%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x145ee
sqrtsd %xmm0, %xmm0
jmp 0x145f3
callq 0x93c0
movq -0x40(%rbp), %r14
movsd -0x30(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1462b
movq 0x20(%rbx), %rax
movsd 0x5711a(%rip), %xmm0    # 0x6b728
ucomisd 0x78(%rax), %xmm0
jbe 0x146b2
callq 0x1f5e8
movsd 0x57112(%rip), %xmm3    # 0x6b738
jmp 0x146bf
callq 0x2ddfa
movq %rax, %r14
movq 0x8(%rbx), %r15
movq 0x20(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %rbx
leaq -0x88(%rbp), %r12
leaq -0xc0(%rbp), %r13
movsd -0x48(%rbp), %xmm0
movq %r12, %rdi
movq %r13, %rsi
callq 0x92d0
movsd (%rbx), %xmm0
movsd (%r13), %xmm1
mulsd %xmm0, %xmm1
mulsd (%r12), %xmm0
movsd -0x70(%rbp), %xmm2
addsd %xmm1, %xmm2
movsd -0x58(%rbp), %xmm1
addsd %xmm0, %xmm1
leaq -0x80(%rbp), %rdx
movsd %xmm2, (%rdx)
movsd %xmm1, 0x8(%rdx)
movq %r14, %rdi
movq %r15, %rsi
movsd -0x38(%rbp), %xmm0
movl $0x1, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x30f74
jmp 0x146e6
callq 0x1f5e8
movsd 0x57071(%rip), %xmm3    # 0x6b730
movq 0x8(%rbx), %rsi
movsd 0x28(%r14), %xmm0
movsd 0x30(%r14), %xmm1
movsd 0x57069(%rip), %xmm2    # 0x6b740
movq %rax, %rdi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x2157e
movl %eax, %ebx
leaq 0x70bc1(%rip), %rax     # 0x852b0
movq %rax, -0x238(%rbp)
movq -0x1d0(%rbp), %rdi
testq %rdi, %rdi
je 0x1470c
movl $0x670, %esi            # imm = 0x670
callq 0x94e0
movl %ebx, %eax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14732
jmp 0x14732
jmp 0x14732
jmp 0x14732
jmp 0x14732
jmp 0x14732
jmp 0x14732
jmp 0x14732
jmp 0x14732
movq %rax, %rbx
leaq 0x70b74(%rip), %rax     # 0x852b0
movq %rax, -0x238(%rbp)
movq -0x1d0(%rbp), %rdi
testq %rdi, %rdi
je 0x14759
movl $0x670, %esi            # imm = 0x670
callq 0x94e0
movq %rbx, %rdi
callq 0x98b0
nop