// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/esa-mmsearch.c
// Function: gt_constructsarrandrunmmsearch
static int gt_constructsarrandrunmmsearch(
                 const GtEncseq *dbencseq,
                 GtReadmode readmode,
                 unsigned int prefixlength,
                 unsigned int numofparts,
                 GtUword maximumspace,
                 const GtUchar *query,
                 GtUword querylen,
                 unsigned int minlength,
                 GtProcessquerymatch processquerymatch,
                 void *processquerymatchinfo,
                 GtTimer *sfxprogress,
                 bool withprogressbar,
                 GtLogger *logger,
                 GtError *err)
{
  bool haserr = false;
  Sfxiterator *sfi;
  Sfxstrategy sfxstrategy;

  defaultsfxstrategy(&sfxstrategy,
                     gt_encseq_bitwise_cmp_ok(dbencseq) ? false : true);
  sfxstrategy.outsuftabonfile = false;
  sfi = gt_Sfxiterator_new(dbencseq,
                           readmode,
                           prefixlength,
                           numofparts,
                           maximumspace,
                           &sfxstrategy, /* sfxstrategy */
                           sfxprogress,
                           withprogressbar,
                           logger, /* logger */
                           err);
  if (sfi == NULL)
  {
    haserr = true;
  } else
  {
    const GtSuffixsortspace *suffixsortspace;
    GtUword numberofsuffixes;
    GtQuerymatch *querymatchspaceptr = gt_querymatch_new();
    GtQueryrepresentation queryrep;

    queryrep.sequence = query;
    queryrep.encseq = NULL;
    queryrep.readmode = GT_READMODE_FORWARD;
    queryrep.startpos = 0;
    queryrep.seqlen = querylen;
    while (true)
    {
      suffixsortspace = gt_Sfxiterator_next(&numberofsuffixes,NULL,sfi);
      if (suffixsortspace == NULL)
      {
        break;
      }
      gt_querysubstringmatch(false,
                             dbencseq,
                             (const ESASuffixptr *)
                             gt_suffixsortspace_ulong_get(suffixsortspace),
                             readmode,
                             numberofsuffixes,
                             0,
                             &queryrep,
                             (GtUword) minlength,
                             processquerymatch,
                             processquerymatchinfo,
                             querymatchspaceptr);
    }
    gt_querymatch_delete(querymatchspaceptr);
  }
  if (gt_Sfxiterator_delete(sfi,err) != 0)
  {
    haserr = true;
  }
  return haserr ? -1 : 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xe8, %rsp
movq 0x138(%rsp), %rax
movq 0x130(%rsp), %rax
movb 0x128(%rsp), %al
movq 0x120(%rsp), %r10
movq 0x118(%rsp), %r10
movq 0x110(%rsp), %r10
movl 0x108(%rsp), %r10d
movq 0x100(%rsp), %r10
movq %rdi, 0xe0(%rsp)
movl %esi, 0xdc(%rsp)
movl %edx, 0xd8(%rsp)
movl %ecx, 0xd4(%rsp)
movq %r8, 0xc8(%rsp)
movq %r9, 0xc0(%rsp)
andb $0x1, %al
movb %al, 0xbf(%rsp)
movb $0x0, 0xbe(%rsp)
movq 0xe0(%rsp), %rdi
callq 0xaf3b0
movb %al, %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %al
movzbl %al, %esi
andl $0x1, %esi
leaq 0x78(%rsp), %rdi
callq 0x239a10
movb $0x0, 0xad(%rsp)
movq 0xe0(%rsp), %rdi
movl 0xdc(%rsp), %esi
movl 0xd8(%rsp), %edx
movl 0xd4(%rsp), %ecx
movq 0xc8(%rsp), %r8
movq 0x120(%rsp), %rbx
movb 0xbf(%rsp), %r11b
movq 0x130(%rsp), %r10
movq 0x138(%rsp), %rax
leaq 0x78(%rsp), %r9
andb $0x1, %r11b
movq %rbx, (%rsp)
movzbl %r11b, %r11d
movl %r11d, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x2e1ab0
movq %rax, 0xb0(%rsp)
cmpq $0x0, 0xb0(%rsp)
jne 0x238c2b
movb $0x1, 0xbe(%rsp)
jmp 0x238d0d
callq 0x267320
movq %rax, 0x60(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
movl $0x0, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x100(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0xb0(%rsp), %rdx
leaq 0x68(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2e1b70
movq %rax, 0x70(%rsp)
cmpq $0x0, 0x70(%rsp)
jne 0x238c8e
jmp 0x238d03
movq 0xe0(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x70(%rsp), %rdi
callq 0x2ea7c0
movq 0x30(%rsp), %rsi
movq %rax, %rdx
movl 0xdc(%rsp), %ecx
movq 0x68(%rsp), %r8
movl 0x108(%rsp), %eax
movl %eax, %ebx
movq 0x110(%rsp), %r11
movq 0x118(%rsp), %r10
movq 0x60(%rsp), %rax
xorl %edi, %edi
xorl %r9d, %r9d
leaq 0x38(%rsp), %r14
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x239af0
jmp 0x238c69
movq 0x60(%rsp), %rdi
callq 0x267b60
movq 0xb0(%rsp), %rdi
movq 0x138(%rsp), %rsi
callq 0x2dd930
cmpl $0x0, %eax
je 0x238d2f
movb $0x1, 0xbe(%rsp)
movb 0xbe(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r14
retq
nop