// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-sain.c
// Function: gt_sain_suf_lcp_iterator_new
GtSainSufLcpIterator *gt_sain_suf_lcp_iterator_new(bool withlcp,
                                                   GtUchar *sequence,
                                                   GtUword len,
                                                   GtReadmode readmode,
                                                   GtUword numofchars,
                                                   GtError *err)
{
  GtSainSufLcpIterator *suflcpiterator;

  if (gt_sain_checkmaxsequencelength(len,false,err) != 0)
  {
    return NULL;
  }
  suflcpiterator = gt_malloc(sizeof *suflcpiterator);
  suflcpiterator->suftab = NULL;
  suflcpiterator->plcptab = NULL;
  suflcpiterator->currentsuftabindex = 0;
  suflcpiterator->readmode = readmode;
  suflcpiterator->bare_encseq = gt_bare_encseq_new(sequence,len,numofchars);
  gt_assert(suflcpiterator->bare_encseq != NULL);
  if (readmode != GT_READMODE_FORWARD)
  {
    bare_encseq_convert(suflcpiterator->bare_encseq,
                        GT_ISDIRREVERSE(readmode) ? false : true,
                        GT_ISDIRCOMPLEMENT(readmode) ? false : true);
  }
  suflcpiterator->suftab
    = gt_sain_bare_encseq_sortsuffixes(suflcpiterator->bare_encseq,
                                       readmode,
                                       false,
                                       false,
                                       NULL,
                                       NULL);
  if (withlcp)
  {
    GtUword maxlcp = 0,
            totallength
              = gt_bare_encseq_total_length(suflcpiterator->bare_encseq),
            partwidth
              = totallength -
                gt_bare_encseq_specialcharacters(suflcpiterator->bare_encseq);
    suflcpiterator->plcptab = gt_plain_lcp_phialgorithm(true,
                                                        &maxlcp,
                                                        sequence,
                                                        true,
                                                        partwidth,
                                                        totallength,
                                                        suflcpiterator->suftab);
  }
  return suflcpiterator;
}

// Assembly:
subq $0x88, %rsp
movb %dil, %al
andb $0x1, %al
movb %al, 0x7f(%rsp)
movq %rsi, 0x70(%rsp)
movq %rdx, 0x68(%rsp)
movl %ecx, 0x64(%rsp)
movq %r8, 0x58(%rsp)
movq %r9, 0x50(%rsp)
movq 0x68(%rsp), %rdi
movq 0x50(%rsp), %rdx
xorl %esi, %esi
callq 0x2d1af0
cmpl $0x0, %eax
je 0x2d1bbf
movq $0x0, 0x80(%rsp)
jmp 0x2d1dc4
movl $0x28, %edi
leaq 0x2ba49d(%rip), %rsi    # 0x58c068
movl $0x6bd, %edx            # imm = 0x6BD
callq 0xe80f0
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq $0x0, (%rax)
movq 0x48(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x48(%rsp), %rax
movq $0x0, 0x20(%rax)
movl 0x64(%rsp), %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x18(%rax)
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x58(%rsp), %rdx
callq 0x2025d0
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x48(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x2d1c70
movq 0x36a361(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2443ca(%rip), %rsi    # 0x516013
leaq 0x2ba48c(%rip), %rdx    # 0x58c0dc
leaq 0x2ba4a9(%rip), %rcx    # 0x58c100
leaq 0x2ba40a(%rip), %r8     # 0x58c068
movl $0x6c3, %r9d            # imm = 0x6C3
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d1c72
cmpl $0x0, 0x64(%rsp)
je 0x2d1d0b
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x20(%rsp)
movb $0x1, %al
cmpl $0x1, 0x64(%rsp)
movb %al, 0x2f(%rsp)
je 0x2d1ca4
cmpl $0x3, 0x64(%rsp)
sete %al
movb %al, 0x2f(%rsp)
movb 0x2f(%rsp), %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %al
movb %al, 0x1e(%rsp)
movb $0x1, %al
cmpl $0x2, 0x64(%rsp)
movb %al, 0x1f(%rsp)
je 0x2d1cd8
cmpl $0x3, 0x64(%rsp)
sete %al
movb %al, 0x1f(%rsp)
movq 0x20(%rsp), %rdi
movb 0x1e(%rsp), %cl
movb 0x1f(%rsp), %sil
movl $0x1, %eax
xorl %edx, %edx
testb $0x1, %sil
cmovnel %edx, %eax
cmpl $0x0, %eax
setne %al
movzbl %cl, %esi
andl $0x1, %esi
movzbl %al, %edx
andl $0x1, %edx
callq 0x203490
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
movl 0x64(%rsp), %esi
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r9d
movl %ecx, %edx
movq %r9, %r8
callq 0x2d16c0
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, (%rax)
testb $0x1, 0x7f(%rsp)
je 0x2d1db7
movq $0x0, 0x40(%rsp)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x2030f0
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x203210
movq %rax, %rcx
movq 0x10(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x30(%rsp)
movq 0x70(%rsp), %rdx
movq 0x30(%rsp), %r8
movq 0x38(%rsp), %r9
movq 0x48(%rsp), %rax
movq (%rax), %rax
movl $0x1, %ecx
leaq 0x40(%rsp), %rsi
movl %ecx, %edi
movq %rax, (%rsp)
callq 0x2c8140
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x48(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)