// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_matstat.c
// Function: gt_matstat_runner
static int gt_matstat_runner(GT_UNUSED int argc, GT_UNUSED const char **argv,
                             GT_UNUSED int parsed_args,
                             void *tool_arguments, GtError *err)
{
  Gfmsubcallinfo *arguments = tool_arguments;
  Fmindex fmindex;
  Suffixarray suffixarray;
  void *packedindex = NULL;
  GtLogger *logger = NULL;
  bool haserr = false;
  const GtAlphabet *alphabet = NULL;
#ifdef WITHBCKTAB
  unsigned int prefixlength = 0;
#endif
  GtUword totallength;
  bool gt_mapfmindexfail = false;
  gt_error_check(err);
  gt_assert(arguments);

  logger = gt_logger_new(false, GT_LOGGER_DEFLT_PREFIX, stdout);
  if (arguments->indextype == Fmindextype)
  {
    if (gt_mapfmindex(&fmindex,gt_str_get(arguments->indexname),
                      logger, err) != 0)
    {
      haserr = true;
      gt_mapfmindexfail = true;
    } else
    {
      alphabet = fmindex.alphabet;
    }
    totallength = fmindex.bwtlength-1;
  } else
  {
    unsigned int mappedbits;

    if (arguments->indextype == Esaindextype)
    {
      mappedbits = SARR_ESQTAB | SARR_SUFTAB
#undef WITHBCKTAB
#ifdef WITHBCKTAB
                   | SARR_BCKTAB
#endif
                   ;
    } else
    {
      if (dotestsequence(arguments))
      {
        mappedbits = SARR_ESQTAB;
      } else
      {
        mappedbits = 0;
      }
    }
    if (gt_mapsuffixarray(&suffixarray,
                       mappedbits,
                       gt_str_get(arguments->indexname),
                       logger,
                       err) != 0)
    {
      haserr = true;
      totallength = 0;
    } else
    {
      alphabet = gt_encseq_alphabet(suffixarray.encseq);
#ifdef WITHBCKTAB
      prefixlength = suffixarray.prefixlength;
#endif
      totallength = gt_encseq_total_length(suffixarray.encseq);
    }
    if (!haserr)
    {
      if (arguments->indextype == Packedindextype)
      {
        packedindex =
          gt_loadvoidBWTSeqForSA(gt_str_get(arguments->indexname),
                                 false,
                                 err);
        if (packedindex == NULL)
        {
          haserr = true;
        }
      }
    }
  }
  if (!haserr)
  {
    const void *theindex;
    Greedygmatchforwardfunction gmatchforwardfunction;

    if (arguments->indextype == Fmindextype)
    {
      theindex = (const void *) &fmindex;
      if (arguments->doms)
      {
        gmatchforwardfunction = gt_skfmmstats;
      } else
      {
        gmatchforwardfunction = gt_skfmuniqueforward;
      }
    } else
    {
      if (arguments->indextype == Esaindextype)
      {
        theindex = (const void *) &suffixarray;
        if (arguments->doms)
        {
          gmatchforwardfunction = gt_suffixarraymstats;
        } else
        {
          gmatchforwardfunction = gt_suffixarrayuniqueforward;
        }
      } else
      {
        gt_assert(arguments->indextype == Packedindextype);
        theindex = (const void *) packedindex;
        if (arguments->doms)
        {
          gmatchforwardfunction = gt_voidpackedindexmstatsforward;
        } else
        {
          gmatchforwardfunction = gt_voidpackedindexuniqueforward;
        }
      }
    }
    if (!haserr)
    {
#ifdef WITHBCKTAB
      if (prefixlength > 0 &&
          arguments->indextype == Esaindextype &&
          runsubstringiteration(gmatchforwardfunction,
                                theindex,
                                totallength,
                                suffixarray.bcktab,
                                suffixarray.countspecialcodes,
                                alphabet,
                                prefixlength,
                                arguments->queryfilenames,
                                err) != 0)

      {
        haserr = true;
      }
#endif
      if (!haserr &&
          gt_findsubquerygmatchforward(dotestsequence(arguments)
                                      ? suffixarray.encseq
                                      : NULL,
                                      theindex,
                                      totallength,
                                      gmatchforwardfunction,
                                      alphabet,
                                      arguments->queryfilenames,
                                      arguments->minlength,
                                      arguments->maxlength,
                                      (arguments->showmode & SHOWSEQUENCE)
                                             ? true : false,
                                      (arguments->showmode & SHOWQUERYPOS)
                                             ? true : false,
                                      (arguments->showmode & SHOWSUBJECTPOS)
                                             ? true : false,
                                      err) != 0)
      {
        haserr = true;
      }
    }
  }
  if (arguments->indextype == Fmindextype)
  {
    if (!gt_mapfmindexfail)
    {
      gt_freefmindex(&fmindex);
    }
  } else
  {
    if (arguments->indextype == Packedindextype && packedindex != NULL)
    {
      gt_deletevoidBWTSeq(packedindex);
    }
    gt_freesuffixarray(&suffixarray);
  }
  gt_logger_delete(logger);

  return haserr ? -1 : 0;;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movl %edi, 0x294(%rsp)
movq %rsi, 0x288(%rsp)
movl %edx, 0x284(%rsp)
movq %rcx, 0x278(%rsp)
movq %r8, 0x270(%rsp)
movq 0x278(%rsp), %rax
movq %rax, 0x268(%rsp)
movq $0x0, 0x90(%rsp)
movq $0x0, 0x88(%rsp)
movb $0x0, 0x87(%rsp)
movq $0x0, 0x78(%rsp)
movb $0x0, 0x6f(%rsp)
cmpq $0x0, 0x270(%rsp)
je 0x45697
movq 0x270(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x4565f
jmp 0x45697
movq 0x5f693a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4d09a3(%rip), %rsi    # 0x516013
leaq 0x4d0b48(%rip), %rdx    # 0x5161bf
leaq 0x4dc6fc(%rip), %rcx    # 0x521d7a
leaq 0x4dc426(%rip), %r8     # 0x521aab
movl $0x133, %r9d            # imm = 0x133
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x45699
jmp 0x4569b
cmpq $0x0, 0x268(%rsp)
jne 0x456de
movq 0x5f68f3(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4d095c(%rip), %rsi    # 0x516013
leaq 0x5354a1(%rip), %rdx    # 0x57ab5f
leaq 0x4dc6b5(%rip), %rcx    # 0x521d7a
leaq 0x4dc3df(%rip), %r8     # 0x521aab
movl $0x134, %r9d            # imm = 0x134
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x456e0
movq 0x5f6851(%rip), %rax    # 0x63bf38
movq (%rax), %rdx
xorl %edi, %edi
leaq 0x4d21f9(%rip), %rsi    # 0x5178ec
callq 0xe7870
movq %rax, 0x88(%rsp)
movq 0x268(%rsp), %rax
cmpl $0x0, 0x40(%rax)
jne 0x45776
movq 0x268(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x11dee0
movq %rax, %rsi
movq 0x88(%rsp), %rdx
movq 0x270(%rsp), %rcx
leaq 0x198(%rsp), %rdi
callq 0x24c5b0
cmpl $0x0, %eax
je 0x45753
movb $0x1, 0x87(%rsp)
movb $0x1, 0x6f(%rsp)
jmp 0x45760
movq 0x200(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x1a8(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x70(%rsp)
jmp 0x4588a
movq 0x268(%rsp), %rax
cmpl $0x1, 0x40(%rax)
jne 0x4578e
movl $0x3, 0x68(%rsp)
jmp 0x457b5
movq 0x268(%rsp), %rdi
callq 0x45c60
testb $0x1, %al
jne 0x457a1
jmp 0x457ab
movl $0x1, 0x68(%rsp)
jmp 0x457b3
movl $0x0, 0x68(%rsp)
jmp 0x457b5
movl 0x68(%rsp), %eax
movl %eax, 0x54(%rsp)
movq 0x268(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x11dee0
movl 0x54(%rsp), %esi
movq %rax, %rdx
movq 0x88(%rsp), %rcx
movq 0x270(%rsp), %r8
leaq 0x98(%rsp), %rdi
callq 0x233e00
cmpl $0x0, %eax
je 0x4580a
movb $0x1, 0x87(%rsp)
movq $0x0, 0x70(%rsp)
jmp 0x4582e
movq 0x98(%rsp), %rdi
callq 0xb0f00
movq %rax, 0x78(%rsp)
movq 0x98(%rsp), %rdi
callq 0xa9d00
movq %rax, 0x70(%rsp)
testb $0x1, 0x87(%rsp)
jne 0x45888
movq 0x268(%rsp), %rax
cmpl $0x2, 0x40(%rax)
jne 0x45886
movq 0x268(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x270(%rsp), %rdx
xorl %esi, %esi
callq 0x22fa90
movq %rax, 0x90(%rsp)
cmpq $0x0, 0x90(%rsp)
jne 0x45884
movb $0x1, 0x87(%rsp)
jmp 0x45886
jmp 0x45888
jmp 0x4588a
testb $0x1, 0x87(%rsp)
jne 0x45af0
movq 0x268(%rsp), %rax
cmpl $0x0, 0x40(%rax)
jne 0x458e0
leaq 0x198(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x268(%rsp), %rax
testb $0x1, 0x44(%rax)
je 0x458cf
leaq 0x2060c8(%rip), %rax    # 0x24b990
movq %rax, 0x58(%rsp)
jmp 0x458db
leaq 0x20590a(%rip), %rax    # 0x24b1e0
movq %rax, 0x58(%rsp)
jmp 0x459ab
movq 0x268(%rsp), %rax
cmpl $0x1, 0x40(%rax)
jne 0x45928
leaq 0x98(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x268(%rsp), %rax
testb $0x1, 0x44(%rax)
je 0x45917
leaq 0x1f23a0(%rip), %rax    # 0x237cb0
movq %rax, 0x58(%rsp)
jmp 0x45923
leaq 0x1f2262(%rip), %rax    # 0x237b80
movq %rax, 0x58(%rsp)
jmp 0x459a9
jmp 0x4592a
movq 0x268(%rsp), %rax
cmpl $0x2, 0x40(%rax)
je 0x45970
movq 0x5f6661(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4d06ca(%rip), %rsi    # 0x516013
leaq 0x4dc43c(%rip), %rdx    # 0x521d8c
leaq 0x4dc423(%rip), %rcx    # 0x521d7a
leaq 0x4dc14d(%rip), %r8     # 0x521aab
movl $0x195, %r9d            # imm = 0x195
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x45972
movq 0x90(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x268(%rsp), %rax
testb $0x1, 0x44(%rax)
je 0x4599b
leaq 0x1eb01c(%rip), %rax    # 0x2309b0
movq %rax, 0x58(%rsp)
jmp 0x459a7
leaq 0x1eaf1e(%rip), %rax    # 0x2308c0
movq %rax, 0x58(%rsp)
jmp 0x459a9
jmp 0x459ab
testb $0x1, 0x87(%rsp)
jne 0x45aee
testb $0x1, 0x87(%rsp)
jne 0x45aec
movq 0x268(%rsp), %rdi
callq 0x45c60
testb $0x1, %al
jne 0x459da
jmp 0x459e9
movq 0x98(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0x459f2
xorl %eax, %eax
movq %rax, 0x48(%rsp)
jmp 0x459f2
movq 0x48(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0x58(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0x268(%rsp), %rax
movq 0x30(%rax), %r9
movq 0x268(%rsp), %r15
movq 0x268(%rsp), %rax
addq $0x10, %rax
movq 0x268(%rsp), %r10
movl 0x20(%r10), %ebx
andl $0x1, %ebx
xorl %r10d, %r10d
movl $0x1, %r11d
cmpl $0x0, %ebx
cmovnel %r11d, %r10d
cmpl $0x0, %r10d
setne %r10b
movq 0x268(%rsp), %r11
movl 0x20(%r11), %ebp
andl $0x2, %ebp
xorl %r11d, %r11d
movl $0x1, %ebx
cmpl $0x0, %ebp
cmovnel %ebx, %r11d
cmpl $0x0, %r11d
setne %r11b
movq 0x268(%rsp), %rbx
movl 0x20(%rbx), %r14d
andl $0x4, %r14d
xorl %ebx, %ebx
movl $0x1, %ebp
cmpl $0x0, %r14d
cmovnel %ebp, %ebx
cmpl $0x0, %ebx
setne %bl
movq 0x270(%rsp), %r14
movups (%rax), %xmm0
movq %rsp, %rax
movups %xmm0, 0x10(%rax)
movups (%r15), %xmm0
movups %xmm0, (%rax)
movq %r14, 0x38(%rax)
movzbl %bl, %ebx
andl $0x1, %ebx
movl %ebx, 0x30(%rax)
movzbl %r11b, %r11d
andl $0x1, %r11d
movl %r11d, 0x28(%rax)
movzbl %r10b, %r10d
andl $0x1, %r10d
movl %r10d, 0x20(%rax)
callq 0x2541c0
cmpl $0x0, %eax
je 0x45aec
movb $0x1, 0x87(%rsp)
jmp 0x45aee
jmp 0x45af0
movq 0x268(%rsp), %rax
cmpl $0x0, 0x40(%rax)
jne 0x45b14
testb $0x1, 0x6f(%rsp)
jne 0x45b12
leaq 0x198(%rsp), %rdi
callq 0x24c560
jmp 0x45b47
movq 0x268(%rsp), %rax
cmpl $0x2, 0x40(%rax)
jne 0x45b3a
cmpq $0x0, 0x90(%rsp)
je 0x45b3a
movq 0x90(%rsp), %rdi
callq 0x22fd20
leaq 0x98(%rsp), %rdi
callq 0x233320
movq 0x88(%rsp), %rdi
callq 0xe7ed0
movb 0x87(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)