// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/tools/gt_matstat.c
// Function: gt_matstat_arguments_check
static int gt_matstat_arguments_check(GT_UNUSED int rest_argc,
                                      void *tool_arguments, GtError *err)
{
  Gfmsubcallinfo *arguments = tool_arguments;
  int had_err = 0;
  const Optionargmodedesc msgfmsubmodedesctable[] =
  {
    {"sequence","matching sequence",SHOWSEQUENCE},
    {"querypos","position in query sequence",SHOWQUERYPOS},
    {"subjectpos","position in subject sequence",SHOWSUBJECTPOS}
  };
  const Optionargmodedesc gfmsubmodedesctable[] =
  {
    {"sequence","matching sequence",SHOWSEQUENCE},
    {"querypos","position in query sequence",SHOWQUERYPOS}
  };
  gt_error_check(err);
  gt_assert(arguments);

  if (gt_option_is_set(arguments->optionfmindex))
    {
      arguments->indextype = Fmindextype;
    } else
    {
      if (gt_option_is_set(arguments->optionesaindex))
      {
        arguments->indextype = Esaindextype;
      } else
      {
        if (gt_option_is_set(arguments->optionpckindex))
        {
          arguments->indextype = Packedindextype;
        } else
        {
          gt_error_set(err,"one of the options -esa, -pck must be used");
          return -1;
        }
      }
    }
    if (gt_option_is_set(arguments->optionmin))
    {
       arguments->minlength.defined = true;
    }
    if (gt_option_is_set(arguments->optionmax))
    {
       arguments->maxlength.defined = true;
    }
    if (!gt_option_is_set(arguments->optionmin) &&
          !gt_option_is_set(arguments->optionmax))
    {
      gt_error_set(err,"one of the options -min or -max must be set");
      return -1;
    }
    if (arguments->minlength.defined &&
        arguments->maxlength.defined)
    {
      if (arguments->maxlength.valueunsignedlong <
          arguments->minlength.valueunsignedlong)
      {
        gt_error_set(err,"minvalue must be smaller or equal than maxvalue");
        return -1;
      }
    }
    if (gt_option_is_set(arguments->optionoutput))
    {
      if (gt_str_array_size(arguments->flagsoutputoption) == 0)
      {
        gt_error_set(err,"missing arguments to option -output");
        return -1;
      } else
      {
        GtUword i;
        for (i=0; i<gt_str_array_size(arguments->flagsoutputoption); i++)
        {
          if (arguments->doms)
          {
            if (gt_optionargaddbitmask(msgfmsubmodedesctable,
                                 sizeof (msgfmsubmodedesctable)/
                                 sizeof (msgfmsubmodedesctable[0]),
                                 &arguments->showmode,
                                 "-output",
                                 gt_str_array_get(arguments->flagsoutputoption,
                                                  i),
                                 err) != 0)
            {
              return -1;
            }
          } else
          {
            if (gt_optionargaddbitmask(gfmsubmodedesctable,
                                  sizeof (gfmsubmodedesctable)/
                                  sizeof (gfmsubmodedesctable[0]),
                                  &arguments->showmode,
                                  "-output",
                                  gt_str_array_get(arguments->flagsoutputoption,
                                                   i),
                                  err) != 0)
            {
              return -1;
            }
          }
        }
      }
    }

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x403164(%rip), %rsi    # 0x4b3320
leaq 0x30(%rsp), %rdi
movl $0x9, %ecx
rep  movsq (%rsi), %es:(%rdi)
movaps 0x4031c0(%rip), %xmm0   # 0x4b3390
movaps %xmm0, 0x20(%rsp)
movaps 0x4031a4(%rip), %xmm0   # 0x4b3380
movaps %xmm0, 0x10(%rsp)
movaps 0x403188(%rip), %xmm0   # 0x4b3370
movaps %xmm0, (%rsp)
testq %rdx, %rdx
je 0xb0201
movq %rbx, %rdi
callq 0xfcc32
testb %al, %al
jne 0xb0380
testq %r14, %r14
je 0xb037b
movq 0x60(%r14), %rdi
callq 0x10ac3f
xorl %ecx, %ecx
testb %al, %al
jne 0xb0241
movq 0x68(%r14), %rdi
callq 0x10ac3f
movl $0x1, %ecx
testb %al, %al
jne 0xb0241
movq 0x70(%r14), %rdi
callq 0x10ac3f
movl $0x2, %ecx
testb %al, %al
je 0xb034b
movl %ecx, 0x40(%r14)
movq 0x48(%r14), %rdi
callq 0x10ac3f
testb %al, %al
je 0xb0256
movb $0x1, (%r14)
movq 0x50(%r14), %rdi
callq 0x10ac3f
testb %al, %al
je 0xb0268
movb $0x1, 0x10(%r14)
movq 0x48(%r14), %rdi
callq 0x10ac3f
testb %al, %al
jne 0xb0286
movq 0x50(%r14), %rdi
callq 0x10ac3f
testb %al, %al
je 0xb0342
cmpb $0x1, (%r14)
jne 0xb02a9
cmpb $0x1, 0x10(%r14)
jne 0xb02a9
movq 0x18(%r14), %rax
cmpq 0x8(%r14), %rax
jae 0xb02a9
leaq 0x2a0a04(%rip), %rsi    # 0x350ca8
jmp 0xb035b
movq 0x58(%r14), %rdi
callq 0x10ac3f
xorl %ebp, %ebp
testb %al, %al
je 0xb036a
movq 0x38(%r14), %rdi
callq 0x11c131
testq %rax, %rax
je 0xb0354
movq 0x38(%r14), %rdi
callq 0x11c131
testq %rax, %rax
je 0xb036a
leaq 0x20(%r14), %r15
xorl %r12d, %r12d
leaq 0x2a0a06(%rip), %r13    # 0x350cf4
movb 0x44(%r14), %bpl
movq 0x38(%r14), %rdi
movq %r12, %rsi
callq 0x11bfb3
cmpb $0x1, %bpl
jne 0xb0310
movl $0x3, %esi
leaq 0x30(%rsp), %rdi
jmp 0xb0318
movl $0x2, %esi
movq %rsp, %rdi
movq %r15, %rdx
movq %r13, %rcx
movq %rax, %r8
movq %rbx, %r9
callq 0x1b7e64
testl %eax, %eax
jne 0xb0365
incq %r12
movq 0x38(%r14), %rdi
callq 0x11c131
cmpq %rax, %r12
jb 0xb02ee
xorl %ebp, %ebp
jmp 0xb036a
leaq 0x2a0933(%rip), %rsi    # 0x350c7c
jmp 0xb035b
leaq 0x2a08ff(%rip), %rsi    # 0x350c51
jmp 0xb035b
leaq 0x2a097d(%rip), %rsi    # 0x350cd8
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1c68d
callq 0x1c654