// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/sfx-linlcp.c
// Function: gt_ENCSEQ_lcp9_manzini
GtCompactUlongStore *gt_ENCSEQ_lcp9_manzini(GtCompactUlongStore *spacefortab,
                                            const GtEncseq *encseq,
                                            GtReadmode readmode,
                                            GtUword partwidth,
                                            GtUword totallength,
                                            const ESASuffixptr *suftab)
{
  GtUword pos, previousstart, nextfillpos = 0, fillpos, lcpvalue = 0,
                previouscc1pos, previouscc2pos;
  GtCompactUlongStore *lcptab, *ranknext, *rightposinverse;
  GtUchar cc1, cc2;
  GtEncseqReader *esr1, *esr2;

  if (spacefortab == NULL)
  {
    unsigned int bitsperentry = gt_determinebitspervalue(totallength);
    rightposinverse = ranknext
                    = gt_compact_ulong_store_new(totallength+1, bitsperentry);
    gt_compact_ulong_store_update(ranknext, totallength, totallength);
    gt_ENCSEQ_set_relevant_from_inversetab(rightposinverse, encseq, readmode,
                                           suftab, partwidth);
  } else
  {
    rightposinverse = ranknext = spacefortab;
  }
  gt_ENCSEQ_inversesuffixarray2specialranknext(rightposinverse, ranknext,
                                               encseq,
                                               readmode,
                                               partwidth,
                                               totallength);
  fillpos = gt_ENCSEQ_sa2ranknext(ranknext, encseq, readmode, partwidth,
                                  totallength, suftab);
  lcptab = ranknext;
  /* now ranknext and lcptab point to the same memory area. After reading
     ranknext at position fillpos, the same cell is used for storing
     the determined lcp-value */
  /* exploit the fact, that pos + lcpvalue is monotone */
  esr1 = gt_encseq_create_reader_with_readmode(encseq, readmode,0);
  cc1 = gt_encseq_reader_next_encoded_char(esr1);
  previouscc1pos = 0;
  esr2 = gt_encseq_create_reader_with_readmode(encseq, readmode, 0);
  previouscc2pos = totallength;
  cc2 = 0;
  for (pos = 0; pos < totallength; pos++)
  {
    if (pos < totallength - 1)
    {
      nextfillpos = gt_compact_ulong_store_get(ranknext, fillpos);
    }
    if (fillpos > 0 && fillpos - 1 < partwidth)
    {
      previousstart = ESASUFFIXPTRGET(suftab, fillpos-1);
      while (pos+lcpvalue < totallength &&
             previousstart+lcpvalue < totallength)
      {
        gt_assert(pos + lcpvalue >= previouscc1pos);
        while (previouscc1pos < pos + lcpvalue)
        {
          previouscc1pos++;
          cc1 = gt_encseq_reader_next_encoded_char(esr1);
        }
        if (GT_ISSPECIAL(cc1))
        {
          break;
        }
        if (previousstart+lcpvalue < previouscc2pos ||
            previousstart+lcpvalue > previouscc2pos+1)
        {
          previouscc2pos = previousstart+lcpvalue;
          gt_encseq_reader_reinit_with_readmode(esr2, encseq, readmode,
                                                previouscc2pos);
          cc2 = gt_encseq_reader_next_encoded_char(esr2);
        } else
        {
          if (previousstart+lcpvalue == previouscc2pos+1)
          {
            previouscc2pos++;
            cc2 = gt_encseq_reader_next_encoded_char(esr2);
          } else
          {
            gt_assert(previousstart+lcpvalue == previouscc2pos);
          }
        }
        if (cc1 != cc2)
        {
          break;
        }
        lcpvalue++;
      }
      gt_compact_ulong_store_update(lcptab, fillpos, lcpvalue);
      if (lcpvalue > 0)
      {
        lcpvalue--;
      }
    }
    fillpos = nextfillpos;
  }
  gt_encseq_reader_delete(esr1);
  gt_encseq_reader_delete(esr2);
  return lcptab;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r8, %r13
movq %rcx, 0x18(%rsp)
movl %edx, 0xc(%rsp)
movq %rsi, %r12
movq %rdi, 0x10(%rsp)
testq %rdi, %rdi
movq %r9, 0x40(%rsp)
jne 0x19ddc5
movq %r9, %r14
movq %r13, %rdi
callq 0x9580f
leaq 0x1(%r13), %rdi
movl %eax, %esi
callq 0x6ba08
movq %rax, 0x10(%rsp)
movq %rax, %rdi
movq %r13, %rsi
movq %r13, %rdx
callq 0x6bc0a
movq %r12, %rdi
callq 0x740a6
testb %al, %al
je 0x19ddc5
xorl %ebx, %ebx
cmpq %rbx, 0x18(%rsp)
je 0x19ddc5
movq (%r14,%rbx,8), %r15
testq %r15, %r15
je 0x19ddbb
leaq -0x1(%r15), %rsi
movq %r12, %rdi
movl 0xc(%rsp), %edx
callq 0x705e4
cmpb $-0x2, %al
jb 0x19ddbb
movq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x6bc0a
incq %rbx
movq 0x40(%rsp), %r14
jmp 0x19dd87
movq %r12, %rdi
callq 0x740a6
testb %al, %al
movq %r13, 0x38(%rsp)
movq %r12, 0x28(%rsp)
je 0x19dfdd
movq %r12, %rdi
callq 0x76238
movq %rax, %r15
movl 0xc(%rsp), %ebx
andl $-0x3, %ebx
xorl %esi, %esi
cmpl $0x1, %ebx
setne %sil
movq %r12, %rdi
callq 0x741f0
movq %rax, %r12
movq $0x0, 0x20(%rsp)
leaq 0x48(%rsp), %rbp
xorl %r14d, %r14d
leaq (,%r15,8), %r13
movq %r12, %rdi
movq %rbp, %rsi
callq 0x7428b
testb %al, %al
je 0x19dea5
cmpl $0x1, %ebx
jne 0x19de3f
movq 0x38(%rsp), %rdi
movq %rbp, %rsi
callq 0x81e2f
movq 0x18(%rsp), %rax
cmpq %rax, 0x50(%rsp)
jae 0x19de5b
subq $0x1, %r15
jb 0x19e4f6
addq $-0x8, %r13
jmp 0x19de1e
cmpq $0x0, 0x20(%rsp)
jne 0x19de7c
movq %r13, %rdi
leaq 0x1ba204(%rip), %rsi    # 0x358071
movl $0x12d, %edx            # imm = 0x12D
callq 0x93160
movq %rax, 0x20(%rsp)
cmpq %r15, %r14
jae 0x19e61c
movq 0x50(%rsp), %rsi
movq 0x10(%rsp), %rdi
callq 0x6bb8d
movq 0x20(%rsp), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
jmp 0x19de16
xorl %ebp, %ebp
cmpl $0x1, %ebx
setne %bpl
movq %r12, %rdi
callq 0x74a09
movq 0x28(%rsp), %r12
movq %r12, %rdi
movl %ebp, %esi
callq 0x741f0
movq %rax, %r15
xorl %r14d, %r14d
movq 0x18(%rsp), %rbp
movq 0x38(%rsp), %r13
movq %r15, %rdi
leaq 0x48(%rsp), %rsi
callq 0x7428b
testb %al, %al
je 0x19dfb6
cmpl $0x1, %ebx
jne 0x19defc
movq %r13, %rdi
leaq 0x48(%rsp), %rsi
callq 0x81e2f
movq 0x50(%rsp), %rsi
cmpq %r13, %rsi
ja 0x19e494
movq 0x48(%rsp), %r12
leaq -0x1(%rsi), %rax
cmpq %rax, %r12
jae 0x19df47
cmpq %r13, %rbp
jae 0x19e400
leaq 0x1(%rbp), %r13
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x6bc0a
incq %r12
movq 0x50(%rsp), %rsi
movq %r13, %rbp
movq 0x38(%rsp), %r13
jmp 0x19df0f
cmpq %r13, %rbp
jae 0x19e4c5
cmpq 0x18(%rsp), %rsi
movq 0x28(%rsp), %r12
jae 0x19df95
movq %r14, 0x58(%rsp)
movl %ebx, %r14d
movq %r12, %rbx
movq %r15, %r12
movq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x6bb8d
movq %r15, %rdi
movq %r12, %r15
movq %rbx, %r12
movl %r14d, %ebx
movq 0x58(%rsp), %r14
movq %rbp, %rsi
movq %rax, %rdx
callq 0x6bc0a
jmp 0x19dfae
movq 0x20(%rsp), %rax
movq (%rax,%r14,8), %rdx
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x6bc0a
incq %r14
incq %rbp
jmp 0x19ded5
leaq 0x1ba0b4(%rip), %rsi    # 0x358071
movq 0x20(%rsp), %rdi
movl $0x16c, %edx            # imm = 0x16C
callq 0x936f9
cmpq %r13, %rbp
jne 0x19e5eb
movq %r15, %rdi
callq 0x74a09
cmpq $0x0, 0x18(%rsp)
je 0x19e5ba
movq %r12, %rdi
callq 0x754dd
movq %rax, %rdi
callq 0x56c8e
movl %eax, %ebx
leaq (,%rbx,8), %rdi
leaq 0x1ba067(%rip), %rsi    # 0x358071
movl $0xd9, %edx
callq 0x93160
movq %rax, %rbp
andq $0x0, (%rax)
movl 0xc(%rsp), %r14d
andl $-0x2, %r14d
pushq $0x1
popq %r15
movb $0x3, %r12b
cmpq %rbx, %r15
jae 0x19e062
leal -0x1(%r15), %eax
cmpl $0x2, %r14d
movzbl %r12b, %r12d
movzbl %al, %eax
cmovel %r12d, %eax
movzbl %al, %esi
movq 0x28(%rsp), %rdi
callq 0x754fd
addq -0x8(%rbp,%r15,8), %rax
movq %rax, (%rbp,%r15,8)
incq %r15
decb %r12b
jmp 0x19e02b
xorl %r14d, %r14d
xorl %ebx, %ebx
movq 0x40(%rsp), %r15
movq 0x28(%rsp), %r12
cmpq %rbx, 0x18(%rsp)
je 0x19e0db
movq (%r15,%rbx,8), %rsi
movq %rbx, %rax
testq %rsi, %rsi
je 0x19e0d3
decq %rsi
movq %r12, %rdi
movl 0xc(%rsp), %edx
callq 0x705e4
cmpb $-0x3, %al
ja 0x19e0d0
movq %r12, %r15
movq %r14, %r12
movzbl %al, %r14d
movq (%rbp,%r14,8), %rsi
cmpq 0x18(%rsp), %rsi
jae 0x19e527
movq 0x10(%rsp), %rdi
movq %rbx, %rdx
callq 0x6bc0a
incq (%rbp,%r14,8)
movq %r12, %rax
movq %r15, %r12
movq 0x40(%rsp), %r15
jmp 0x19e0d3
movq %r14, %rax
incq %rbx
movq %rax, %r14
jmp 0x19e071
movq %r12, %rdi
callq 0x740a6
testb %al, %al
movq %r14, 0x30(%rsp)
je 0x19e1fb
movl 0xc(%rsp), %r14d
andl $-0x3, %r14d
xorl %esi, %esi
cmpl $0x1, %r14d
setne %sil
movq %r12, %rdi
callq 0x741f0
movq %rax, %rbx
leaq 0x48(%rsp), %r15
movq 0x18(%rsp), %r12
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7428b
testb %al, %al
je 0x19e1b6
cmpl $0x1, %r14d
jne 0x19e13c
movq %r13, %rdi
movq %r15, %rsi
callq 0x81e2f
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
jae 0x19e466
movq 0x18(%rsp), %rax
testq %rsi, %rsi
je 0x19e1a2
decq %rsi
movq 0x28(%rsp), %rdi
movl 0xc(%rsp), %edx
callq 0x705e4
cmpb $-0x3, %al
ja 0x19e19d
movzbl %al, %r13d
movq (%rbp,%r13,8), %rsi
cmpq 0x18(%rsp), %rsi
jae 0x19e589
movq 0x10(%rsp), %rdi
movq %r12, %rdx
callq 0x6bc0a
incq (%rbp,%r13,8)
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %r13
jmp 0x19e1a2
movq 0x30(%rsp), %rax
addq 0x50(%rsp), %r12
subq 0x48(%rsp), %r12
movq %rax, 0x30(%rsp)
jmp 0x19e118
cmpl $0x1, %r14d
je 0x19e1cb
movq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x76283
jmp 0x19e1d8
movq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x7627b
testq %rax, %rax
movq 0x40(%rsp), %r15
je 0x19e1f3
leaq -0x1(%r13), %rsi
movq 0x10(%rsp), %rdi
movq %r13, %rdx
callq 0x6bc0a
movq %rbx, %rdi
callq 0x74a09
leaq 0x1b9e6f(%rip), %rsi    # 0x358071
movq %rbp, %rdi
movl $0x1ba, %edx            # imm = 0x1BA
callq 0x936f9
xorl %r14d, %r14d
movq %r12, %rdi
movl 0xc(%rsp), %ebx
movl %ebx, %esi
xorl %edx, %edx
callq 0x72260
movq %rax, %rbp
movq %rax, %rdi
callq 0x70f55
movq %r12, %rdi
movl %eax, %r12d
movl %ebx, %esi
xorl %edx, %edx
callq 0x72260
movq %rax, 0x60(%rsp)
leaq -0x1(%r13), %rax
movq %rax, 0x78(%rsp)
movq %r13, 0x58(%rsp)
xorl %ebx, %ebx
movq $0x0, 0x68(%rsp)
xorl %eax, %eax
xorl %edx, %edx
cmpq %r13, %rdx
je 0x19e3d7
cmpq 0x78(%rsp), %rdx
movq %rdx, 0x20(%rsp)
jae 0x19e287
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x6bb8d
movq 0x20(%rsp), %rdx
movq 0x30(%rsp), %rcx
testq %rcx, %rcx
je 0x19e3ca
movq %rax, 0x70(%rsp)
leaq -0x1(%rcx), %rax
cmpq 0x18(%rsp), %rax
jae 0x19e3c5
movq -0x8(%r15,%rcx,8), %rax
movq %rax, 0x80(%rsp)
leaq (%rbx,%rdx), %rax
movq %rax, %r15
leaq (%rbx,%rdx), %rax
cmpq %r13, %rax
jae 0x19e39c
movq %r13, %rcx
movq 0x80(%rsp), %rdx
leaq (%rbx,%rdx), %r13
cmpq %rcx, %r13
jae 0x19e38d
cmpq %r14, %rax
jae 0x19e2fa
jmp 0x19e438
incq %r14
movq %rbp, %rdi
callq 0x70f55
movl %eax, %r12d
cmpq %r14, %r15
jne 0x19e2ec
cmpb $-0x3, %r12b
ja 0x19e38a
movq 0x58(%rsp), %rax
cmpq %rax, %r13
jb 0x19e31b
incq %rax
cmpq %rax, %r13
jbe 0x19e36a
movq 0x60(%rsp), %r14
movq %r14, %rdi
movq 0x28(%rsp), %rsi
movl 0xc(%rsp), %edx
movq %r13, %rcx
callq 0x71f38
movq %r14, %rdi
callq 0x70f55
movq %r13, %rcx
movq 0x20(%rsp), %rdx
movq %rcx, 0x58(%rsp)
cmpb %al, %r12b
movq 0x38(%rsp), %r13
jne 0x19e394
incq %rbx
leaq 0x1(%r15), %rax
movq %r15, %r14
movl %r12d, %ecx
movq %rcx, 0x68(%rsp)
jmp 0x19e2ba
movq 0x60(%rsp), %r14
je 0x19e334
movq 0x58(%rsp), %rcx
cmpq %rcx, %r13
movq 0x20(%rsp), %rdx
movq 0x68(%rsp), %rax
je 0x19e344
jmp 0x19e558
movq %r15, %r14
movq 0x38(%rsp), %r13
jmp 0x19e39c
movq %rax, 0x68(%rsp)
movq %r15, %r14
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq %rbx, %rdx
callq 0x6bc0a
subq $0x1, %rbx
movl $0x0, %eax
cmovbq %rax, %rbx
movq 0x40(%rsp), %r15
movq 0x20(%rsp), %rdx
movq 0x70(%rsp), %rax
incq %rdx
movq %rax, 0x30(%rsp)
jmp 0x19e25e
movq %rbp, %rdi
callq 0x722ae
movq 0x60(%rsp), %rdi
callq 0x722ae
movq 0x10(%rsp), %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x299b61(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x146c02(%rip), %rsi    # 0x2e5013
leaq 0x1b9e3b(%rip), %rdx    # 0x358253
leaq 0x1b9e07(%rip), %rcx    # 0x358226
leaq 0x1b9c4b(%rip), %r8     # 0x358071
movl $0x159, %r9d            # imm = 0x159
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x299b29(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x146bca(%rip), %rsi    # 0x2e5013
leaq 0x1b9ca8(%rip), %rdx    # 0x3580f8
leaq 0x1b9cc2(%rip), %rcx    # 0x358119
leaq 0x1b9c13(%rip), %r8     # 0x358071
movl $0x1f5, %r9d            # imm = 0x1F5
jmp 0x19e42c
movq 0x299afb(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x146b9c(%rip), %rsi    # 0x2e5013
leaq 0x1b9eb7(%rip), %rdx    # 0x358335
leaq 0x1b9e82(%rip), %rcx    # 0x358307
leaq 0x1b9be5(%rip), %r8     # 0x358071
movl $0x1a0, %r9d            # imm = 0x1A0
jmp 0x19e42c
movq 0x299acd(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x146b6e(%rip), %rsi    # 0x2e5013
leaq 0x1b9d61(%rip), %rdx    # 0x35820d
leaq 0x1b9d73(%rip), %rcx    # 0x358226
leaq 0x1b9bb7(%rip), %r8     # 0x358071
movl $0x156, %r9d            # imm = 0x156
jmp 0x19e42c
movq 0x299a9c(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x146b3d(%rip), %rsi    # 0x2e5013
leaq 0x1b9d76(%rip), %rdx    # 0x358253
leaq 0x1b9d42(%rip), %rcx    # 0x358226
leaq 0x1b9b86(%rip), %r8     # 0x358071
movl $0x15e, %r9d            # imm = 0x15E
jmp 0x19e42c
movq 0x299a6b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x146b0c(%rip), %rsi    # 0x2e5013
leaq 0x1b9d8c(%rip), %rdx    # 0x35829a
leaq 0x1b9d9a(%rip), %rcx    # 0x3582af
leaq 0x1b9b55(%rip), %r8     # 0x358071
movl $0x126, %r9d            # imm = 0x126
jmp 0x19e42c
movq 0x299a3a(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x146adb(%rip), %rsi    # 0x2e5013
leaq 0x1b9dde(%rip), %rdx    # 0x35831d
leaq 0x1b9dc1(%rip), %rcx    # 0x358307
leaq 0x1b9b24(%rip), %r8     # 0x358071
movl $0x187, %r9d            # imm = 0x187
jmp 0x19e42c
movq 0x299a09(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x146aaa(%rip), %rsi    # 0x2e5013
leaq 0x1b9bc0(%rip), %rdx    # 0x358130
leaq 0x1b9ba2(%rip), %rcx    # 0x358119
leaq 0x1b9af3(%rip), %r8     # 0x358071
movl $0x20e, %r9d            # imm = 0x20E
jmp 0x19e42c
movq 0x2999d8(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x146a79(%rip), %rsi    # 0x2e5013
leaq 0x1b9d7c(%rip), %rdx    # 0x35831d
leaq 0x1b9d5f(%rip), %rcx    # 0x358307
leaq 0x1b9ac2(%rip), %r8     # 0x358071
movl $0x1a7, %r9d            # imm = 0x1A7
jmp 0x19e42c
movq 0x2999a7(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x146a48(%rip), %rsi    # 0x2e5013
leaq 0x1b9d27(%rip), %rdx    # 0x3582f9
leaq 0x1b9d2e(%rip), %rcx    # 0x358307
leaq 0x1b9a91(%rip), %r8     # 0x358071
movl $0x17b, %r9d            # imm = 0x17B
jmp 0x19e42c
movq 0x299976(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x146a17(%rip), %rsi    # 0x2e5013
leaq 0x1b9c73(%rip), %rdx    # 0x358276
leaq 0x1b9c1c(%rip), %rcx    # 0x358226
leaq 0x1b9a60(%rip), %r8     # 0x358071
movl $0x16d, %r9d            # imm = 0x16D
jmp 0x19e42c
movq 0x299945(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1469e6(%rip), %rsi    # 0x2e5013
leaq 0x1b9c9d(%rip), %rdx    # 0x3582d1
leaq 0x1b9c74(%rip), %rcx    # 0x3582af
leaq 0x1b9a2f(%rip), %r8     # 0x358071
movl $0x12f, %r9d            # imm = 0x12F
jmp 0x19e42c