// File: /workspace/github_c_makefile_star2_O3/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
cmpq %rcx, %rdx
jbe 0x1f3545
leaq 0x1c5b7c(%rip), %rsi    # 0x3b90ad
xorl %ebx, %ebx
movq %r9, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xfcb67
jmp 0x1f362c
movq %r8, %r13
movq %rsi, %r14
movl %edi, %ebp
leaq 0x1c5b44(%rip), %rsi    # 0x3b9098
movl $0x28, %edi
movl $0x6bd, %edx            # imm = 0x6BD
callq 0x104226
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 0x18a786
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x1f363e
testl %r15d, %r15d
je 0x1f35c6
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 0x18ad23
movq 0x10(%rbx), %rdi
movl %r15d, %esi
jmp 0x1f35cb
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1f3288
movq %rax, (%rbx)
testb %bpl, %bpl
je 0x1f362c
leaq 0x10(%rsp), %r15
movq $0x0, (%r15)
movq 0x10(%rbx), %rdi
callq 0x18ac02
movq %rax, %r12
movq 0x10(%rbx), %rdi
callq 0x18ac40
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 0x1ed31a
movq %rax, 0x8(%rbx)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x7aafc