// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r15d
movq %rdx, %r12
movabsq $0x7ffffffffffffffe, %rcx # imm = 0x7FFFFFFFFFFFFFFE
leaq 0x1(%rcx), %rax
cmpq %rax, %rdx
jae 0x1fcd69
movq %r8, %r13
movq %rsi, %r14
movl %edi, %ebp
leaq 0x1c5a72(%rip), %rsi    # 0x3c2708
movl $0x28, %edi
movl $0x6bd, %edx            # imm = 0x6BD
callq 0x1092b2
movq %rax, %rbx
movq $0x0, 0x20(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl %r15d, 0x18(%rax)
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x192db6
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x1fcd91
testl %r15d, %r15d
je 0x1fccff
movl %r15d, %ecx
andl $-0x3, %ecx
xorl %esi, %esi
cmpl $0x1, %ecx
setne %sil
movl %r15d, %ecx
andl $-0x2, %ecx
xorl %edx, %edx
cmpl $0x2, %ecx
setne %dl
movq %rax, %rdi
callq 0x19338c
movq 0x10(%rbx), %rdi
movl %r15d, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1fc9dd
movq %rax, (%rbx)
testb %bpl, %bpl
je 0x1fcd7f
leaq 0x10(%rsp), %r15
movq $0x0, (%r15)
movq 0x10(%rbx), %rdi
callq 0x19326b
movq %rax, %r12
movq 0x10(%rbx), %rdi
callq 0x1932a9
movq %r12, %r8
subq %rax, %r8
movq (%rbx), %rax
movq %rax, (%rsp)
movl $0x1, %edi
movq %r15, %rsi
movq %r14, %rdx
movl $0x1, %ecx
movq %r12, %r9
callq 0x1f6aec
movq %rax, 0x8(%rbx)
jmp 0x1fcd7f
leaq 0x1c59ad(%rip), %rsi    # 0x3c271d
xorl %ebx, %ebx
movq %r9, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1019cf
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x7c85b