// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_patternmatch.c
// Function: callpatternmatcher
static int callpatternmatcher(const Pmatchoptions *pmopt, GtError *err)
{
  Suffixarray suffixarray;
  GtUword totallength = 0;
  bool haserr = false;
  const GtUchar *pptr;
  GtUword patternlen;
  unsigned int demand = SARR_SUFTAB | SARR_ESQTAB;

  if (pmopt->usebcktab)
  {
    demand |= SARR_BCKTAB;
  }
  if (gt_mapsuffixarray(&suffixarray,
                     demand,
                     gt_str_get(pmopt->indexname),
                     NULL,
                     err) != 0)
  {
    haserr = true;
  } else
  {
    totallength = gt_encseq_total_length(suffixarray.encseq);
  }
  if (!haserr)
  {
    GtUword trial;
    GtUword dbstart;
    Enumpatterniterator *epi;
    GT_UNUSED unsigned int firstspecial;
    GtMMsearchiterator *mmsibck = NULL, *mmsiimm = NULL;
    GtBucketspecification bucketspec;
    Bucketenumerator *bucketenumerator;
    Lcpinterval itv;
    GtUword refstart;
    GtEncseqReader *esr1, *esr2;
    GT_UNUSED int retval;
    GtUword idx, maxlcp;
    GtCodetype code = 0;
    const GtCodetype **multimappower;
    const GtAlphabet *alpha;

    if (pmopt->usebcktab)
    {
      multimappower = gt_bcktab_multimappower(suffixarray.bcktab);
    } else
    {
      multimappower = NULL;
    }
    epi = gt_newenumpatterniterator(pmopt->minpatternlen,
                                    pmopt->maxpatternlen,
                                    suffixarray.encseq,
                                    err);
    esr1 = gt_encseq_create_reader_with_readmode(suffixarray.encseq,
                                                 suffixarray.readmode, 0);
    esr2 = gt_encseq_create_reader_with_readmode(suffixarray.encseq,
                                                 suffixarray.readmode, 0);
    alpha = gt_encseq_alphabet(suffixarray.encseq);
    for (trial = 0; trial < pmopt->numofsamples; trial++)
    {
      pptr = gt_nextEnumpatterniterator(&patternlen,epi);
      if (pmopt->showpatt)
      {
        gt_alphabet_decode_seq_to_fp(alpha,stdout,pptr,patternlen);
        printf("\n");
      }
      if (pmopt->usebcktab)
      {
        if (patternlen < (GtUword) suffixarray.prefixlength)
        {
          mmsibck = NULL;
          bucketenumerator
            = gt_newbucketenumerator(suffixarray.bcktab,
                                  suffixarray.prefixlength,
                                  pptr,
                                  (unsigned int) patternlen);
          refstart = UNDEFREFSTART;
          while (gt_nextbucketenumerator(&itv,bucketenumerator))
          {
            if (refstart == UNDEFREFSTART)
            {
              refstart = ESASUFFIXPTRGET(suffixarray.suftab,itv.left);
            } else
            {
              for (idx=itv.left; idx<=itv.right; idx++)
              {
                retval = gt_encseq_check_comparetwosuffixes(
                                        suffixarray.encseq,
                                        suffixarray.readmode,
                                        &maxlcp,
                                        false,
                                        false,
                                        patternlen,
                                        refstart,
                                        ESASUFFIXPTRGET(suffixarray.suftab,idx),
                                        esr1,
                                        esr2);
                gt_assert(retval == 0 && maxlcp == patternlen);
              }
            }
          }
          gt_freebucketenumerator(bucketenumerator);
        } else
        {
          firstspecial = qgram2code(&code,
                                    multimappower,
                                    suffixarray.prefixlength,
                                    pptr);
          gt_assert(firstspecial == suffixarray.prefixlength);
          gt_bcktab_calcboundaries(&bucketspec,
                                   suffixarray.bcktab,
                                   code);
          if (bucketspec.nonspecialsinbucket == 0)
          {
            mmsibck = NULL;
          } else
          {
            mmsibck
              = gt_mmsearchiterator_new_complete_plain(
                                       suffixarray.encseq,
                                       suffixarray.suftab,
                                       bucketspec.left,
                                       bucketspec.left +
                                         bucketspec.nonspecialsinbucket-1,
                                       (GtUword) suffixarray.prefixlength,
                                       suffixarray.readmode,
                                       pptr,
                                       patternlen);
          }
        }
      }
      if (pmopt->immediate)
      {
        mmsiimm = gt_mmsearchiterator_new_complete_plain(
                                            suffixarray.encseq,
                                            suffixarray.suftab,
                                            0,  /* leftbound */
                                            totallength, /* rightbound */
                                            0, /* offset */
                                            suffixarray.readmode,
                                            pptr,
                                            patternlen);
      }
      if (pmopt->immediate && pmopt->usebcktab)
      {
        comparemmsis(mmsibck,mmsiimm);
      }
      if (pmopt->usebcktab && mmsibck != NULL)
      {
        while (gt_mmsearchiterator_next(&dbstart,mmsibck))
        {
          /* Nothing */;
        }
        gt_mmsearchiterator_delete(mmsibck);
        mmsibck = NULL;
      }
      if (pmopt->immediate)
      {
        while (gt_mmsearchiterator_next(&dbstart,mmsiimm))
        {
          /* Nothing */;
        }
        gt_mmsearchiterator_delete(mmsiimm);
        mmsiimm = NULL;
      }
    }
    gt_encseq_reader_delete(esr1);
    gt_encseq_reader_delete(esr2);
    if (pmopt->showpatt)
    {
      gt_showPatterndistribution(epi);
    }
    gt_freeEnumpatterniterator(epi);
  }
  gt_freesuffixarray(&suffixarray);
  return haserr ? -1 : 0;
}

// Assembly:
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdi, 0x208(%rsp)
movq %rsi, 0x200(%rsp)
movq $0x0, 0xf8(%rsp)
movb $0x0, 0xf7(%rsp)
movl $0x3, 0xdc(%rsp)
movq 0x208(%rsp), %rax
testb $0x1, 0x19(%rax)
je 0x4b636
movl 0xdc(%rsp), %eax
orl $0x40, %eax
movl %eax, 0xdc(%rsp)
movl 0xdc(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x208(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x11dee0
movl 0x24(%rsp), %esi
movq %rax, %rdx
movq 0x200(%rsp), %r8
leaq 0x100(%rsp), %rdi
xorl %eax, %eax
movl %eax, %ecx
callq 0x233e00
cmpl $0x0, %eax
je 0x4b681
movb $0x1, 0xf7(%rsp)
jmp 0x4b696
movq 0x100(%rsp), %rdi
callq 0xa9d00
movq %rax, 0xf8(%rsp)
testb $0x1, 0xf7(%rsp)
jne 0x4bc27
movq $0x0, 0xb0(%rsp)
movq $0x0, 0xa8(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x208(%rsp), %rax
testb $0x1, 0x19(%rax)
je 0x4b6e7
movq 0x180(%rsp), %rdi
callq 0x2065c0
movq %rax, 0x30(%rsp)
jmp 0x4b6f0
movq $0x0, 0x30(%rsp)
movq 0x208(%rsp), %rax
movq (%rax), %rdi
movq 0x208(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x100(%rsp), %rdx
movq 0x200(%rsp), %rcx
callq 0x231d50
movq %rax, 0xc0(%rsp)
movq 0x100(%rsp), %rdi
movl 0x148(%rsp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xac380
movq %rax, 0x60(%rsp)
movq 0x100(%rsp), %rdi
movl 0x148(%rsp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xac380
movq %rax, 0x58(%rsp)
movq 0x100(%rsp), %rdi
callq 0xb0f00
movq %rax, 0x28(%rsp)
movq $0x0, 0xd0(%rsp)
movq 0xd0(%rsp), %rax
movq 0x208(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x4bbeb
movq 0xc0(%rsp), %rsi
leaq 0xe0(%rsp), %rdi
callq 0x231f30
movq %rax, 0xe8(%rsp)
movq 0x208(%rsp), %rax
testb $0x1, 0x18(%rax)
je 0x4b7f3
movq 0x28(%rsp), %rdi
movq 0x5f076b(%rip), %rax    # 0x63bf38
movq (%rax), %rsi
movq 0xe8(%rsp), %rdx
movq 0xe0(%rsp), %rcx
callq 0x7ed90
leaq 0x547a87(%rip), %rdi    # 0x593273
movb $0x0, %al
callq 0x19070
movq 0x208(%rsp), %rax
testb $0x1, 0x19(%rax)
je 0x4baac
movq 0xe0(%rsp), %rax
movl 0x178(%rsp), %ecx
cmpq %rcx, %rax
jae 0x4b9a2
movq $0x0, 0xb0(%rsp)
movq 0x180(%rsp), %rdi
movl 0x178(%rsp), %esi
movq 0xe8(%rsp), %rdx
movq 0xe0(%rsp), %rax
movl %eax, %ecx
callq 0x20b850
movq %rax, 0x88(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x88(%rsp), %rsi
leaq 0x70(%rsp), %rdi
callq 0x20ba90
testb $0x1, %al
jne 0x4b87f
jmp 0x4b990
movq 0x68(%rsp), %rax
cmpq 0xf8(%rsp), %rax
jne 0x4b8a9
movq 0x158(%rsp), %rax
movq 0x78(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x68(%rsp)
jmp 0x4b98b
movq 0x78(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x80(%rsp), %rax
ja 0x4b989
movq 0x100(%rsp), %rdi
movl 0x148(%rsp), %esi
movq 0xe0(%rsp), %r9
movq 0x68(%rsp), %rbx
movq 0x158(%rsp), %rax
movq 0x48(%rsp), %rcx
movq (%rax,%rcx,8), %r11
movq 0x60(%rsp), %r10
movq 0x58(%rsp), %rax
leaq 0x40(%rsp), %rdx
xorl %r8d, %r8d
movl %r8d, %ecx
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0xb5f40
movl %eax, 0x54(%rsp)
cmpl $0x0, 0x54(%rsp)
jne 0x4b93a
movq 0x40(%rsp), %rax
cmpq 0xe0(%rsp), %rax
je 0x4b972
movq 0x5f065f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4ca6c8(%rip), %rsi    # 0x516013
leaq 0x4d7ac4(%rip), %rdx    # 0x523416
leaq 0x4d7ae1(%rip), %rcx    # 0x52343a
leaq 0x4d79a2(%rip), %r8     # 0x523302
movl $0xa4, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4b974
jmp 0x4b976
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x4b8b3
jmp 0x4b98b
jmp 0x4b864
movq 0x88(%rsp), %rdi
callq 0x20bb50
jmp 0x4baaa
movq 0x30(%rsp), %rsi
movl 0x178(%rsp), %edx
movq 0xe8(%rsp), %rcx
leaq 0x38(%rsp), %rdi
callq 0x4bc60
movl %eax, 0xbc(%rsp)
movl 0xbc(%rsp), %eax
cmpl 0x178(%rsp), %eax
je 0x4ba0f
movq 0x5f05c2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4ca62b(%rip), %rsi    # 0x516013
leaq 0x4d7a5e(%rip), %rdx    # 0x52344d
leaq 0x4d7a44(%rip), %rcx    # 0x52343a
leaq 0x4d7905(%rip), %r8     # 0x523302
movl $0xaf, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4ba11
movq 0x180(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x90(%rsp), %rdi
callq 0x205b80
cmpq $0x0, 0x98(%rsp)
jne 0x4ba44
movq $0x0, 0xb0(%rsp)
jmp 0x4baa8
movq 0x100(%rsp), %rdi
movq 0x158(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq 0x90(%rsp), %rcx
addq 0x98(%rsp), %rcx
subq $0x1, %rcx
movl 0x178(%rsp), %eax
movl %eax, %r8d
movl 0x148(%rsp), %r9d
movq 0xe8(%rsp), %r10
movq 0xe0(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x238170
movq %rax, 0xb0(%rsp)
jmp 0x4baaa
jmp 0x4baac
movq 0x208(%rsp), %rax
testb $0x1, 0x1a(%rax)
je 0x4bb08
movq 0x100(%rsp), %rdi
movq 0x158(%rsp), %rsi
movq 0xf8(%rsp), %rcx
movl 0x148(%rsp), %r9d
movq 0xe8(%rsp), %r10
movq 0xe0(%rsp), %rax
xorl %edx, %edx
movl %edx, %r8d
movq %r8, %rdx
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x238170
movq %rax, 0xa8(%rsp)
movq 0x208(%rsp), %rax
testb $0x1, 0x1a(%rax)
je 0x4bb39
movq 0x208(%rsp), %rax
testb $0x1, 0x19(%rax)
je 0x4bb39
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
callq 0x4bd00
movq 0x208(%rsp), %rax
testb $0x1, 0x19(%rax)
je 0x4bb8a
cmpq $0x0, 0xb0(%rsp)
je 0x4bb8a
jmp 0x4bb54
movq 0xb0(%rsp), %rsi
leaq 0xc8(%rsp), %rdi
callq 0x238350
testb $0x1, %al
jne 0x4bb6f
jmp 0x4bb71
jmp 0x4bb54
movq 0xb0(%rsp), %rdi
callq 0x2384d0
movq $0x0, 0xb0(%rsp)
movq 0x208(%rsp), %rax
testb $0x1, 0x1a(%rax)
je 0x4bbd0
jmp 0x4bb9a
movq 0xa8(%rsp), %rsi
leaq 0xc8(%rsp), %rdi
callq 0x238350
testb $0x1, %al
jne 0x4bbb5
jmp 0x4bbb7
jmp 0x4bb9a
movq 0xa8(%rsp), %rdi
callq 0x2384d0
movq $0x0, 0xa8(%rsp)
jmp 0x4bbd2
movq 0xd0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xd0(%rsp)
jmp 0x4b77c
movq 0x60(%rsp), %rdi
callq 0xac3f0
movq 0x58(%rsp), %rdi
callq 0xac3f0
movq 0x208(%rsp), %rax
testb $0x1, 0x18(%rax)
je 0x4bc1a
movq 0xc0(%rsp), %rdi
callq 0x2321d0
movq 0xc0(%rsp), %rdi
callq 0x2322f0
leaq 0x100(%rsp), %rdi
callq 0x233320
movb 0xf7(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbx
retq
nopw %cs:(%rax,%rax)