// File: /workspace/github_cpp_makefile_star2_O1/trapexit[P]bbf/src/options.cpp
// Function: Options::validate() const
AppError
Options::validate(void) const
{
  switch(instruction)
    {
    case Options::_INVALID:
      return AppError::argument_invalid("instruction is invalid");
    case Options::FILETHRASH:
      break;
    case Options::FSTHRASH:
      break;
    case Options::BURNIN:
      if(captcha.empty())
        return AppError::argument_required("captcha");
    case Options::SCAN:
      break;
    case Options::FIX:
    case Options::FIX_FILE:
    case Options::WRITE_PSEUDO_UNCORRECTABLE_WL:
    case Options::WRITE_PSEUDO_UNCORRECTABLE_WOL:
    case Options::WRITE_FLAGGED_UNCORRECTABLE_WL:
    case Options::WRITE_FLAGGED_UNCORRECTABLE_WOL:
      if(captcha.empty())
        return AppError::argument_required("captcha");
      break;
    case Options::FIND_FILES:
      break;
    case Options::SECURITY_ERASE:
    case Options::ENHANCED_SECURITY_ERASE:
      if(captcha.empty())
        return AppError::argument_required("captcha");
      break;
    case Options::DUMP_FILES:
    case Options::INFO:
    case Options::CAPTCHA:
      break;
    default:
      break;
    }

  if(start_block >= end_block)
    return AppError::argument_invalid("start block >= end block");

  return AppError::success();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl (%rsi), %eax
incl %eax
cmpl $0x11, %eax
ja 0xfda0
leaq 0x6e56(%rip), %rcx      # 0x16b38
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x0, 0xa0(%rsi)
jne 0xfda0
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x6f59(%rip), %rsi      # 0x16c62
leaq 0x6f59(%rip), %rdx      # 0x16c69
leaq 0x8(%rsp), %rdi
callq 0x75e0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xddf8
jmp 0xfde2
cmpq $0x0, 0xa0(%rsi)
jne 0xfda0
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x6f1c(%rip), %rsi      # 0x16c62
leaq 0x6f1c(%rip), %rdx      # 0x16c69
leaq 0x8(%rsp), %rdi
callq 0x75e0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xddf8
jmp 0xfde2
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x7031(%rip), %rsi      # 0x16da7
leaq 0x7040(%rip), %rdx      # 0x16dbd
leaq 0x8(%rsp), %rdi
callq 0x75e0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xde92
jmp 0xfde2
cmpq $0x0, 0xa0(%rsi)
je 0xfe04
movq 0x38(%rsi), %rax
cmpq 0x40(%rsi), %rax
jae 0xfdb4
movq %rbx, %rdi
callq 0xdd7c
jmp 0xfdf9
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x6ffa(%rip), %rsi      # 0x16dbe
leaq 0x700b(%rip), %rdx      # 0x16dd6
leaq 0x8(%rsp), %rdi
callq 0x75e0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xde92
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xfdf9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x44b0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x6e4e(%rip), %rsi      # 0x16c62
leaq 0x6e4e(%rip), %rdx      # 0x16c69
leaq 0x8(%rsp), %rdi
callq 0x75e0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xddf8
jmp 0xfde2
jmp 0xfe44
jmp 0xfe60
jmp 0xfe44
jmp 0xfe60
jmp 0xfe44
jmp 0xfe60
jmp 0xfe44
jmp 0xfe60
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xfe63
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x44b0
jmp 0xfe63
movq %rax, %rbx
movq %rbx, %rdi
callq 0x46f0
nop