// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/esa-seqread.c
// Function: gt_nextSequentiallcpvalue
int gt_nextSequentiallcpvalue(GtUword *currentlcp,
                              Sequentialsuffixarrayreader *ssar,
                              GtError *err)
{
  GtUchar tmpsmalllcpvalue;
  int retval;

  gt_assert(ssar != NULL);
  if (ssar->scanfile)
  {
    retval = gt_readnextfromstream_GtUchar(&tmpsmalllcpvalue,
                                           &ssar->suffixarray->lcptabstream);
    if (retval > 0)
    {
      if (tmpsmalllcpvalue < (GtUchar) LCPOVERFLOW)
      {
        *currentlcp = (GtUword) tmpsmalllcpvalue;
      } else
      {
        Largelcpvalue tmpexception;

        retval = gt_readnextfromstream_Largelcpvalue(&tmpexception,
                                          &ssar->suffixarray->llvtabstream);
        if (retval == 0)
        {
          gt_error_set(err,"file %s: line %d: unexpected end of file when "
                           "reading llvtab",__FILE__,__LINE__);
          return -1;
        }
        *currentlcp = tmpexception.value;
      }
    } else
    {
      return 0;
    }
  } else
  {
    if (ssar->nextlcptabindex < ssar->numberofsuffixes)
    {
      tmpsmalllcpvalue = ssar->suffixarray->lcptab[ssar->nextlcptabindex++];
      if (tmpsmalllcpvalue < (GtUchar) LCPOVERFLOW)
      {
        *currentlcp = (GtUword) tmpsmalllcpvalue;
      } else
      {
        gt_assert(ssar->suffixarray->llvtab[ssar->largelcpindex].position ==
                  ssar->nextlcptabindex-1);
        *currentlcp = ssar->suffixarray->llvtab[ssar->largelcpindex++].value;
      }
    } else
    {
      return 0;
    }
  }
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rsi, %rsi
je 0x1a5898
movq %rsi, %r15
movq %rdi, %rbx
cmpb $0x1, 0x40(%rsi)
jne 0x1a5812
movq %rdx, %r14
movq (%r15), %r13
movl 0xd4(%r13), %eax
cmpl 0xd0(%r13), %eax
jb 0x1a5764
movq 0xd8(%r13), %rdi
movq 0xe0(%r13), %rcx
movl $0x1, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x17b40
movq %rax, %r12
movl %r12d, 0xd0(%r13)
movq 0xe0(%r13), %rdi
callq 0x17f00
testl %eax, %eax
jne 0x1a589d
movl $0x0, 0xd4(%r13)
xorl %eax, %eax
testl %r12d, %r12d
je 0x1a586a
movq 0xd8(%r13), %rcx
leal 0x1(%rax), %edx
movl %edx, 0xd4(%r13)
movl %eax, %eax
movzbl (%rcx,%rax), %eax
cmpq $0xff, %rax
jne 0x1a5862
movq (%r15), %r12
movl 0xec(%r12), %eax
cmpl 0xe8(%r12), %eax
jb 0x1a57f2
movq 0xf0(%r12), %rdi
movq 0xf8(%r12), %rcx
movl $0x10, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x17b40
movq %rax, %r15
movl %r15d, 0xe8(%r12)
movq 0xf8(%r12), %rdi
callq 0x17f00
testl %eax, %eax
jne 0x1a58a7
movl $0x0, 0xec(%r12)
xorl %eax, %eax
testl %r15d, %r15d
je 0x1a5874
movq 0xf0(%r12), %rcx
leal 0x1(%rax), %edx
movl %edx, 0xec(%r12)
movl %eax, %eax
shlq $0x4, %rax
movq 0x8(%rcx,%rax), %rax
jmp 0x1a5862
movq 0x20(%r15), %rcx
xorl %eax, %eax
cmpq 0x10(%r15), %rcx
jae 0x1a586a
movq (%r15), %rax
movq 0x60(%rax), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x20(%r15)
movzbl (%rdx,%rcx), %edx
cmpq $0xff, %rdx
je 0x1a583f
movq %rdx, (%rbx)
jmp 0x1a5865
movq 0x68(%rax), %rax
movq 0x28(%r15), %rdx
movq %rdx, %rsi
shlq $0x4, %rsi
cmpq %rcx, (%rax,%rsi)
jne 0x1a58a2
addq %rsi, %rax
incq %rdx
movq %rdx, 0x28(%r15)
movq 0x8(%rax), %rax
movq %rax, (%rbx)
movl $0x1, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1b42ca(%rip), %rsi    # 0x359b45
leaq 0x1ff600(%rip), %rdx    # 0x3a4e82
movq %r14, %rdi
movl $0x62, %ecx
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1a586a
callq 0x6273a
callq 0x626ea
callq 0x626b3
callq 0x62712