// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/esa-maxpairs.c
// Function: gt_callenummaxpairs
int gt_callenummaxpairs(const char *indexname,
                        unsigned int userdefinedleastlength,
                        GtUword maxfreq,
                        bool scanfile,
                        GtProcessmaxpairs processmaxpairs,
                        void *processmaxpairsinfo,
                        GtLogger *logger,
                        GtError *err)
{
  bool haserr = false;
  Sequentialsuffixarrayreader *ssar = NULL;
  GtMaxfreqcollect maxfreqcollect;

  gt_error_check(err);
  GT_INITARRAY(&maxfreqcollect.arr,Lcpinterval);
  if (maxfreq > 0)
  {
    maxfreqcollect.userdefinedleastlength = userdefinedleastlength;
    maxfreqcollect.maxfreq = maxfreq;
    if (gt_runenumlcpvalues_process(indexname,
                                    collectmaxfreqintervals,
                                    &maxfreqcollect,
                                    logger,
                                    err) != 0)
    {
      haserr = true;
    }
    sortLcpintervals(maxfreqcollect.arr.spaceLcpinterval,
                     maxfreqcollect.arr.nextfreeLcpinterval);
    /*showcollectedintervals(maxfreqcollect.arr.spaceLcpinterval,
                           maxfreqcollect.arr.nextfreeLcpinterval);*/
  }
  if (!haserr)
  {
    ssar = gt_newSequentialsuffixarrayreaderfromfile(indexname,
                                                     SARR_LCPTAB |
                                                     SARR_SUFTAB |
                                                     SARR_ESQTAB |
                                                     SARR_SSPTAB,
                                                     scanfile,
                                                     logger,
                                                     err);
    if (ssar == NULL)
    {
      haserr = true;
    }
  }
  if (!haserr)
  {
    if (maxfreq > 0)
    {
      gt_assert(ssar != NULL);
      ssar->extrainfo = &maxfreqcollect;
    }
    if (gt_enumeratemaxpairs(ssar,
                             userdefinedleastlength,
                             processmaxpairs,
                             processmaxpairsinfo,
                             err) != 0)
    {
      haserr = true;
    }
  }
  GT_FREEARRAY(&maxfreqcollect.arr,Lcpinterval);
  if (ssar != NULL)
  {
    gt_freeSequentialsuffixarrayreader(&ssar);
  }
  return haserr ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, %rbp
movq %r8, %r15
movl %ecx, 0xc(%rsp)
movq %rdx, %r12
movl %esi, 0x8(%rsp)
movq %rdi, 0x10(%rsp)
movq 0x88(%rsp), %rbx
andq $0x0, 0x18(%rsp)
testq %rbx, %rbx
je 0x14ec58
movq %rbx, %rdi
callq 0x89eb7
testb %al, %al
jne 0x14ed91
andq $0x0, 0x40(%rsp)
movq 0x80(%rsp), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rsp)
testq %r12, %r12
je 0x14ecd7
leaq 0x20(%rsp), %r14
movl 0x8(%rsp), %eax
movl %eax, (%r14)
movq %r12, 0x8(%r14)
leaq 0x16d(%rip), %rsi       # 0x14edf7
movq 0x10(%rsp), %rdi
movq %r14, %rdx
movq %rcx, %r13
movq %rbx, %r8
callq 0x14ca88
movq %r15, %rbx
movq %rbp, %r15
movl %eax, %ebp
movq 0x10(%r14), %rdi
movq 0x20(%r14), %rsi
leaq 0xaf8(%rip), %rcx       # 0x14f7ac
pushq $0x18
popq %rdx
callq 0x17ed0
movq %r13, %rcx
movb $0x1, %r13b
movb $0x1, %r14b
testl %ebp, %ebp
movq %r15, %rbp
movq %rbx, %r15
movq 0x88(%rsp), %rbx
jne 0x14ed42
movzbl 0xc(%rsp), %edx
movq 0x10(%rsp), %rdi
movl $0x87, %esi
movq %rbx, %r13
movq %rbx, %r8
callq 0x1516ac
movq %rax, 0x18(%rsp)
xorl %ebx, %ebx
testq %rax, %rax
sete %r14b
je 0x14ed3f
testq %r12, %r12
je 0x14ed18
testq %rax, %rax
je 0x14edbf
leaq 0x20(%rsp), %rcx
movq %rcx, 0x48(%rax)
movq %rax, %rdi
movl 0x8(%rsp), %esi
movq %r15, %rdx
movq %rbp, %rcx
movq %r13, %r8
callq 0x14eb32
testl %eax, %eax
movb %r14b, %bl
pushq $0x1
popq %r14
cmovel %ebx, %r14d
xorl %r13d, %r13d
jmp 0x14ed42
movb $0x1, %r13b
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x14ed6d
leaq 0x30(%rsp), %rbx
leaq 0x1f5b93(%rip), %rsi    # 0x3448eb
movl $0x2b7, %edx            # imm = 0x2B7
callq 0x936f9
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
testb %r13b, %r13b
jne 0x14ed7c
leaq 0x18(%rsp), %rdi
callq 0x1517e5
movzbl %r14b, %eax
negl %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2e91d0(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x196271(%rip), %rsi    # 0x2e5013
leaq 0x196416(%rip), %rdx    # 0x2e51bf
leaq 0x1f5bd3(%rip), %rcx    # 0x344983
leaq 0x1f5b34(%rip), %r8     # 0x3448eb
movl $0x285, %r9d            # imm = 0x285
jmp 0x14edeb
movq 0x2e91a2(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x196243(%rip), %rsi    # 0x2e5013
leaq 0x1f5b61(%rip), %rdx    # 0x344938
leaq 0x1f5ba5(%rip), %rcx    # 0x344983
leaq 0x1f5b06(%rip), %r8     # 0x3448eb
movl $0x2ab, %r9d            # imm = 0x2AB
xorl %eax, %eax
callq 0x17a50
callq 0x17390