// File: /workspace/github_c_makefile_star2_O1/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 0x40be18(%rip), %rsi    # 0x4be330
leaq 0x30(%rsp), %rdi
movl $0x9, %ecx
rep  movsq (%rsi), %es:(%rdi)
movaps 0x40be74(%rip), %xmm0   # 0x4be3a0
movaps %xmm0, 0x20(%rsp)
movaps 0x40be58(%rip), %xmm0   # 0x4be390
movaps %xmm0, 0x10(%rsp)
movaps 0x40be3c(%rip), %xmm0   # 0x4be380
movaps %xmm0, (%rsp)
testq %rdx, %rdx
je 0xb255d
movq %rbx, %rdi
callq 0x101a9a
testb %al, %al
jne 0xb26dc
testq %r14, %r14
je 0xb26d7
movq 0x60(%r14), %rdi
callq 0x10fe52
xorl %ecx, %ecx
testb %al, %al
jne 0xb259d
movq 0x68(%r14), %rdi
callq 0x10fe52
movl $0x1, %ecx
testb %al, %al
jne 0xb259d
movq 0x70(%r14), %rdi
callq 0x10fe52
movl $0x2, %ecx
testb %al, %al
je 0xb26a7
movl %ecx, 0x40(%r14)
movq 0x48(%r14), %rdi
callq 0x10fe52
testb %al, %al
je 0xb25b2
movb $0x1, (%r14)
movq 0x50(%r14), %rdi
callq 0x10fe52
testb %al, %al
je 0xb25c4
movb $0x1, 0x10(%r14)
movq 0x48(%r14), %rdi
callq 0x10fe52
testb %al, %al
jne 0xb25e2
movq 0x50(%r14), %rdi
callq 0x10fe52
testb %al, %al
je 0xb269e
cmpb $0x1, (%r14)
jne 0xb2605
cmpb $0x1, 0x10(%r14)
jne 0xb2605
movq 0x18(%r14), %rax
cmpq 0x8(%r14), %rax
jae 0xb2605
leaq 0x2a76e3(%rip), %rsi    # 0x359ce3
jmp 0xb26b7
movq 0x58(%r14), %rdi
callq 0x10fe52
xorl %ebp, %ebp
testb %al, %al
je 0xb26c6
movq 0x38(%r14), %rdi
callq 0x121e78
testq %rax, %rax
je 0xb26b0
movq 0x38(%r14), %rdi
callq 0x121e78
testq %rax, %rax
je 0xb26c6
leaq 0x20(%r14), %r15
xorl %r12d, %r12d
leaq 0x2a76e5(%rip), %r13    # 0x359d2f
movb 0x44(%r14), %bpl
movq 0x38(%r14), %rdi
movq %r12, %rsi
callq 0x121cfa
cmpb $0x1, %bpl
jne 0xb266c
movl $0x3, %esi
leaq 0x30(%rsp), %rdi
jmp 0xb2674
movl $0x2, %esi
movq %rsp, %rdi
movq %r15, %rdx
movq %r13, %rcx
movq %rax, %r8
movq %rbx, %r9
callq 0x1c094c
testl %eax, %eax
jne 0xb26c1
incq %r12
movq 0x38(%r14), %rdi
callq 0x121e78
cmpq %rax, %r12
jb 0xb264a
xorl %ebp, %ebp
jmp 0xb26c6
leaq 0x2a7612(%rip), %rsi    # 0x359cb7
jmp 0xb26b7
leaq 0x2a75de(%rip), %rsi    # 0x359c8c
jmp 0xb26b7
leaq 0x2a765c(%rip), %rsi    # 0x359d13
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1019cf
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 0x1c7c2
callq 0x1c789