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

  if (angle < ServerParam::instance().minMoment() ||
      angle > ServerParam::instance().maxMoment()) {
    return false;
  }

  //    if (mSelfState.IsGoalie() == false) //FIXME
  //    {
  //        return false;
  //    }

  if (mSelfState.GetCatchBan() > 0) {
    return false;
  }

  if (mWorldState.GetPlayMode() != PM_Play_On &&
      mWorldState.GetPlayMode() != PM_Our_Penalty_Setup &&
      mWorldState.GetPlayMode() != PM_Opp_Penalty_Setup &&
      mWorldState.GetPlayMode() != PM_Our_Penalty &&
      mWorldState.GetPlayMode() != PM_Opp_Penalty_Ready &&
      mWorldState.GetPlayMode() != PM_Our_Penalty_Taken &&
      mWorldState.GetPlayMode() != PM_Opp_Penalty_Taken &&
      mWorldState.GetPlayMode() != PM_Our_Penalty_Miss &&
      mWorldState.GetPlayMode() != PM_Opp_Penalty_Miss &&
      mWorldState.GetPlayMode() != PM_Our_Penalty_Score &&
      mWorldState.GetPlayMode() != PM_Opp_Penalty_Score) {
    return false;
  }

  /*if (mSelfState.IsBallCatchable() == false)
  {
      return false;
  }*/

  mCatch.Plan(angle);
  mCatch.Execute(mCommandQueue);
  ++mCatchCount;
  mIsCatch = true;
  mIsMutex = true;
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movb 0xe99(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
je 0xd5ad
movq -0x20(%rbp), %rax
movb 0xe90(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xd5b6
movb $0x0, -0x1(%rbp)
jmp 0xd74f
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x10f30
movsd -0x28(%rbp), %xmm1
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
ja 0xd5fe
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x10f50
movsd -0x30(%rbp), %xmm0
ucomisd (%rax), %xmm0
jbe 0xd607
movb $0x0, -0x1(%rbp)
jmp 0xd74f
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x11010
cmpl $0x0, %eax
jle 0xd622
movb $0x0, -0x1(%rbp)
jmp 0xd74f
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x1, %eax
je 0xd6fe
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0xe, %eax
je 0xd6fe
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x31, %eax
je 0xd6fe
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x18, %eax
je 0xd6fe
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x32, %eax
je 0xd6fe
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x10, %eax
je 0xd6fe
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x33, %eax
je 0xd6fe
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x12, %eax
je 0xd6fe
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x35, %eax
je 0xd6fe
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x11, %eax
je 0xd6fe
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x34, %eax
je 0xd6fe
movb $0x0, -0x1(%rbp)
jmp 0xd74f
movq -0x20(%rbp), %rdi
addq $0x440, %rdi            # imm = 0x440
movsd -0x18(%rbp), %xmm0
callq 0x15510
movq -0x20(%rbp), %rsi
movq %rsi, %rdi
addq $0x440, %rdi            # imm = 0x440
addq $0x28, %rsi
callq 0x144b0
movq -0x20(%rbp), %rax
movl 0xe60(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xe60(%rax)
movb $0x1, 0xe99(%rax)
movb $0x1, 0xe90(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)