// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/esa-maxpairs.c
// Function: gt_enumeratemaxpairs_generic
int gt_enumeratemaxpairs_generic(Sequentialsuffixarrayreader *ssar,
                                 GtSainSufLcpIterator *suflcpiterator,
                                 unsigned int searchlength,
                                 GtProcessmaxpairs processmaxpairs,
                                 void *processmaxpairsinfo,
                                 GtError *err)
{
  unsigned int base;
  GtArrayGtUword *ptr;
  GtBUstate_maxpairs *state;
  bool haserr = false;

  state = gt_malloc(sizeof (*state));
  state->searchlength = searchlength;
  state->processmaxpairs = processmaxpairs;
  state->processmaxpairsinfo = processmaxpairsinfo;
  state->nextmaxfreq = 0;
  state->initialized = false;
  if (ssar != NULL)
  {
    const GtEncseq *encseq = gt_encseqSequentialsuffixarrayreader(ssar);

    state->readmode = gt_readmodeSequentialsuffixarrayreader(ssar);
    state->alphabetsize = gt_alphabet_num_of_chars(gt_encseq_alphabet(encseq));
    state->genericencseq.hasencseq = true;
    state->genericencseq.seqptr.encseq = encseq;
    state->sequence = NULL;
    state->maxfreqcollect = (const GtMaxfreqcollect *) ssar->extrainfo;
  } else
  {
    const GtBareEncseq *bare_encseq;

    gt_assert(suflcpiterator != NULL);
    bare_encseq = gt_sain_suf_lcp_iterator_bare_encseq(suflcpiterator);
    state->readmode = gt_sain_suf_lcp_iterator_readmode(suflcpiterator);
    state->alphabetsize = (unsigned int) gt_bare_encseq_numofchars(bare_encseq);
    state->genericencseq.hasencseq = false;
    state->genericencseq.seqptr.bare_encseq = bare_encseq;
    state->sequence = gt_bare_encseq_sequence(bare_encseq);
    state->maxfreqcollect = NULL;
  }
  GT_INITARRAY(&state->uniquechar,GtUword);
  state->poslist = gt_malloc(sizeof (*state->poslist) * state->alphabetsize);
  for (base = 0; base < state->alphabetsize; base++)
  {
    ptr = &state->poslist[base];
    GT_INITARRAY(ptr,GtUword);
  }
  if (gt_esa_bottomup_maxpairs(ssar, suflcpiterator,  state, err) != 0)
  {
    haserr = true;
  }
  GT_FREEARRAY(&state->uniquechar,GtUword);
  for (base = 0; base < state->alphabetsize; base++)
  {
    ptr = &state->poslist[base];
    GT_FREEARRAY(ptr,GtUword);
  }
  gt_free(state->poslist);
  gt_free(state);
  return haserr ? -1 : 0;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movl %edx, 0x54(%rsp)
movq %rcx, 0x48(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x38(%rsp)
movb $0x0, 0x1f(%rsp)
movl $0x70, %edi
leaq 0x34237e(%rip), %rsi    # 0x576d40
movl $0x1ea, %edx            # imm = 0x1EA
callq 0xe80f0
movq %rax, 0x20(%rsp)
movl 0x54(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x4(%rax)
movq 0x48(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0x40(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x68(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0x60(%rax)
movq 0x20(%rsp), %rax
movb $0x0, (%rax)
cmpq $0x0, 0x60(%rsp)
je 0x234a90
movq 0x60(%rsp), %rdi
callq 0x23bd50
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rdi
callq 0x23bda0
movl %eax, %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x48(%rax)
movq 0x10(%rsp), %rdi
callq 0xb0f00
movq %rax, %rdi
callq 0x7e8c0
movl %eax, %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x20(%rsp), %rax
movb $0x1, 0x30(%rax)
movq 0x10(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0x40(%rax)
movq 0x60(%rsp), %rax
movq 0x48(%rax), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x58(%rax)
jmp 0x234b45
jmp 0x234a92
cmpq $0x0, 0x58(%rsp)
jne 0x234ad2
movq 0x4074ff(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2e1568(%rip), %rsi    # 0x516013
leaq 0x3422a7(%rip), %rdx    # 0x576d59
leaq 0x3422b7(%rip), %rcx    # 0x576d70
leaq 0x342280(%rip), %r8     # 0x576d40
movl $0x1fe, %r9d            # imm = 0x1FE
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x234ad4
movq 0x58(%rsp), %rdi
callq 0x2d1ef0
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rdi
callq 0x2d1de0
movl %eax, %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x48(%rax)
movq 0x8(%rsp), %rdi
callq 0x203140
movl %eax, %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x20(%rsp), %rax
movb $0x0, 0x30(%rax)
movq 0x8(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x8(%rsp), %rdi
callq 0x203080
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0x58(%rax)
jmp 0x234b47
movq 0x20(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0x20(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0x18(%rax)
movq 0x20(%rsp), %rax
movl 0x8(%rax), %eax
imulq $0x18, %rax, %rdi
leaq 0x3421bf(%rip), %rsi    # 0x576d40
movl $0x208, %edx            # imm = 0x208
callq 0xe80f0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x28(%rax)
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jae 0x234bfb
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rax
movl 0x34(%rsp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq $0x0, (%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x8(%rax)
jmp 0x234bee
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x234b9f
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x38(%rsp), %rcx
callq 0x234d50
cmpl $0x0, %eax
je 0x234c1e
movb $0x1, 0x1f(%rsp)
jmp 0x234c20
movq 0x20(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x234c6d
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x342104(%rip), %rsi    # 0x576d40
movl $0x212, %edx            # imm = 0x212
callq 0xe88c0
movq 0x20(%rsp), %rax
movq $0x0, 0x18(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0x20(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0x10(%rax)
jmp 0x234c6f
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jae 0x234cfc
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rax
movl 0x34(%rsp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
je 0x234ce8
movq 0x28(%rsp), %rax
movq (%rax), %rdi
leaq 0x342088(%rip), %rsi    # 0x576d40
movl $0x216, %edx            # imm = 0x216
callq 0xe88c0
movq 0x28(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x28(%rsp), %rax
movq $0x0, (%rax)
jmp 0x234cea
jmp 0x234cec
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x234c77
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rdi
leaq 0x342034(%rip), %rsi    # 0x576d40
movl $0x218, %edx            # imm = 0x218
callq 0xe88c0
movq 0x20(%rsp), %rdi
leaq 0x34201e(%rip), %rsi    # 0x576d40
movl $0x219, %edx            # imm = 0x219
callq 0xe88c0
movb 0x1f(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)