// File: /workspace/github_c_makefile_star2_O2/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 0x3fee22(%rip), %rsi    # 0x432330
pushq $0x9
popq %rcx
leaq 0x30(%rsp), %rdi
rep  movsq (%rsi), %es:(%rdi)
movaps 0x3fee80(%rip), %xmm0   # 0x4323a0
movaps %xmm0, 0x20(%rsp)
movaps 0x3fee64(%rip), %xmm0   # 0x432390
movaps %xmm0, 0x10(%rsp)
movaps 0x3fee48(%rip), %xmm0   # 0x432380
movaps %xmm0, (%rsp)
testq %rdx, %rdx
je 0x33551
movq %rbx, %rdi
callq 0x89eb7
testb %al, %al
jne 0x336e1
testq %r14, %r14
je 0x336b3
movq 0x60(%r14), %rdi
callq 0x9b4cb
xorl %ecx, %ecx
testb %al, %al
jne 0x3358e
movq 0x68(%r14), %rdi
callq 0x9b4cb
testb %al, %al
je 0x3357a
pushq $0x1
jmp 0x3358d
movq 0x70(%r14), %rdi
callq 0x9b4cb
testb %al, %al
je 0x3367b
pushq $0x2
popq %rcx
movl %ecx, 0x40(%r14)
movq 0x48(%r14), %rdi
callq 0x9b4cb
testb %al, %al
je 0x335a3
movb $0x1, (%r14)
movq 0x50(%r14), %rdi
callq 0x9b4cb
testb %al, %al
je 0x335b5
movb $0x1, 0x10(%r14)
movq 0x48(%r14), %rdi
callq 0x9b4cb
testb %al, %al
jne 0x335d3
movq 0x50(%r14), %rdi
callq 0x9b4cb
testb %al, %al
je 0x33672
cmpb $0x1, (%r14)
jne 0x335f6
cmpb $0x1, 0x10(%r14)
jne 0x335f6
movq 0x18(%r14), %rax
cmpq 0x8(%r14), %rax
jae 0x335f6
leaq 0x2bd6ca(%rip), %rsi    # 0x2f0cbb
jmp 0x3368b
movq 0x58(%r14), %rdi
callq 0x9b4cb
xorl %r15d, %r15d
testb %al, %al
je 0x33699
movq 0x38(%r14), %rdi
callq 0xae61c
testq %rax, %rax
je 0x33684
leaq 0x20(%r14), %r12
xorl %r15d, %r15d
xorl %ebp, %ebp
movq 0x38(%r14), %rdi
callq 0xae61c
cmpq %rax, %rbp
jae 0x33699
movb 0x44(%r14), %r13b
movq 0x38(%r14), %rdi
movq %rbp, %rsi
callq 0xae386
cmpb $0x1, %r13b
jne 0x3364e
leaq 0x30(%rsp), %rdi
pushq $0x3
jmp 0x33653
movq %rsp, %rdi
pushq $0x2
popq %rsi
movq %r12, %rdx
leaq 0x2bd6a9(%rip), %rcx    # 0x2f0d07
movq %rax, %r8
movq %rbx, %r9
callq 0x166988
testl %eax, %eax
jne 0x336ab
incq %rbp
jmp 0x33621
leaq 0x2bd616(%rip), %rsi    # 0x2f0c8f
jmp 0x3368b
leaq 0x2bd5e2(%rip), %rsi    # 0x2f0c64
jmp 0x3368b
leaq 0x2bd660(%rip), %rsi    # 0x2f0ceb
movq %rbx, %rdi
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r15
movl %r15d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rax
movl %eax, %r15d
jmp 0x33699
movq 0x4048ae(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2b194f(%rip), %rsi    # 0x2e5013
leaq 0x314f88(%rip), %rdx    # 0x348653
leaq 0x2bd577(%rip), %rcx    # 0x2f0c49
leaq 0x2bd367(%rip), %r8     # 0x2f0a40
movl $0xbd, %r9d
jmp 0x3370d
movq 0x404880(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2b1921(%rip), %rsi    # 0x2e5013
leaq 0x2b1ac6(%rip), %rdx    # 0x2e51bf
leaq 0x2bd549(%rip), %rcx    # 0x2f0c49
leaq 0x2bd339(%rip), %r8     # 0x2f0a40
movl $0xbc, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390