// File: /workspace/github_cpp_makefile_star2_O3/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 0xfcb2
leaq 0x6f44(%rip), %rcx      # 0x16b38
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x0, 0xa0(%rsi)
jne 0xfcb2
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x7047(%rip), %rsi      # 0x16c62
leaq 0x7047(%rip), %rdx      # 0x16c69
leaq 0x8(%rsp), %rdi
callq 0x7618
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xdd60
jmp 0xfcf4
cmpq $0x0, 0xa0(%rsi)
jne 0xfcb2
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x700a(%rip), %rsi      # 0x16c62
leaq 0x700a(%rip), %rdx      # 0x16c69
leaq 0x8(%rsp), %rdi
callq 0x7618
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xdd60
jmp 0xfcf4
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x711f(%rip), %rsi      # 0x16da7
leaq 0x712e(%rip), %rdx      # 0x16dbd
leaq 0x8(%rsp), %rdi
callq 0x7618
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xddfa
jmp 0xfcf4
cmpq $0x0, 0xa0(%rsi)
je 0xfd16
movq 0x38(%rsi), %rax
cmpq 0x40(%rsi), %rax
jae 0xfcc6
movq %rbx, %rdi
callq 0xdce4
jmp 0xfd0b
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x70e8(%rip), %rsi      # 0x16dbe
leaq 0x70f9(%rip), %rdx      # 0x16dd6
leaq 0x8(%rsp), %rdi
callq 0x7618
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xddfa
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xfd0b
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 0x6f3c(%rip), %rsi      # 0x16c62
leaq 0x6f3c(%rip), %rdx      # 0x16c69
leaq 0x8(%rsp), %rdi
callq 0x7618
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xdd60
jmp 0xfcf4
jmp 0xfd56
jmp 0xfd72
jmp 0xfd56
jmp 0xfd72
jmp 0xfd56
jmp 0xfd72
jmp 0xfd56
jmp 0xfd72
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xfd75
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x44b0
jmp 0xfd75
movq %rax, %rbx
movq %rbx, %rdi
callq 0x46f0
nop