// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/ActionEffector.cpp
// Function: ActionEffector::SetKickAction(double, double)
bool ActionEffector::SetKickAction(double power, AngleDeg angle) {
  if (mIsKick == true || mIsMutex == true) {
    return false;
  }

  power = GetNormalizeKickPower(power);
  angle = GetNormalizeMoment(angle);

  if (mWorldState.GetPlayMode() == PM_Before_Kick_Off ||
      mWorldState.GetPlayMode() == PM_Goal_Ours ||
      mWorldState.GetPlayMode() == PM_Goal_Opps ||
      mWorldState.GetPlayMode() == PM_Opp_Offside_Kick ||
      mWorldState.GetPlayMode() == PM_Our_Offside_Kick ||
      mWorldState.GetPlayMode() == PM_Our_Foul_Charge_Kick ||
      mWorldState.GetPlayMode() == PM_Opp_Foul_Charge_Kick ||
      mWorldState.GetPlayMode() == PM_Our_Back_Pass_Kick ||
      mWorldState.GetPlayMode() == PM_Opp_Back_Pass_Kick ||
      mWorldState.GetPlayMode() == PM_Our_Free_Kick_Fault_Kick ||
      mWorldState.GetPlayMode() == PM_Opp_Free_Kick_Fault_Kick ||
      mWorldState.GetPlayMode() == PM_Our_CatchFault_Kick ||
      mWorldState.GetPlayMode() == PM_Opp_CatchFault_Kick ||
      mWorldState.GetPlayMode() == PM_Time_Over) {
    return false;
  }

  if (mSelfState.IsKickable() == false) {
    return false;
  }

  if (power < 1.0) // 避免不必要的kick
  {
    return false;
  }

  if (power > ServerParam::instance().maxPower() - 1.0) {
    power = ServerParam::instance().maxPower();
  }

  mKick.Plan(power, angle);
  mKick.Execute(mCommandQueue);
  ++mKickCount;
  mIsKick = true;
  mIsMutex = true;
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movsd %xmm1, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movb 0xe96(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
je 0xcf72
movq -0x28(%rbp), %rax
movb 0xe90(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xcf7b
movb $0x0, -0x1(%rbp)
jmp 0xd18a
leaq -0x18(%rbp), %rdi
callq 0x10e80
movsd %xmm0, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x10aa0
movq -0x28(%rbp), %rax
movsd %xmm0, -0x20(%rbp)
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x16, %eax
je 0xd0ab
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x20, %eax
je 0xd0ab
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x21, %eax
je 0xd0ab
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x2c, %eax
je 0xd0ab
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x9, %eax
je 0xd0ab
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0xd, %eax
je 0xd0ab
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x30, %eax
je 0xd0ab
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0xa, %eax
je 0xd0ab
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x2e, %eax
je 0xd0ab
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0xb, %eax
je 0xd0ab
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x2d, %eax
je 0xd0ab
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0xc, %eax
je 0xd0ab
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x2f, %eax
je 0xd0ab
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x1d, %eax
jne 0xd0b4
movb $0x0, -0x1(%rbp)
jmp 0xd18a
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x10ef0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xd0d4
movb $0x0, -0x1(%rbp)
jmp 0xd18a
movsd 0xb3f34(%rip), %xmm0    # 0xc1010
ucomisd -0x18(%rbp), %xmm0
jbe 0xd0ec
movb $0x0, -0x1(%rbp)
jmp 0xd18a
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x10f10
movsd -0x30(%rbp), %xmm0
movsd (%rax), %xmm1
movsd 0xb3efc(%rip), %xmm2    # 0xc1010
subsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xd134
callq 0x855e0
movq %rax, %rdi
callq 0x10f10
movsd (%rax), %xmm0
movsd %xmm0, -0x18(%rbp)
movq -0x28(%rbp), %rdi
addq $0x2c0, %rdi            # imm = 0x2C0
movsd -0x18(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
callq 0x14e60
movq -0x28(%rbp), %rsi
movq %rsi, %rdi
addq $0x2c0, %rdi            # imm = 0x2C0
addq $0x28, %rsi
callq 0x144b0
movq -0x28(%rbp), %rax
movl 0xe54(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xe54(%rax)
movb $0x1, 0xe96(%rax)
movb $0x1, 0xe90(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)