// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/sfx-linlcp.c
// Function: gt_lcptab_lightweightcheck
int gt_lcptab_lightweightcheck(const char *esaindexname,
                               const GtEncseq *encseq,
                               GtReadmode readmode,
                               const ESASuffixptr *suftab,
                               GtLogger *logger,
                               GtError *err)
{
  bool haserr = false;
  Sequentialsuffixarrayreader *ssar;
  GtUword partwidth, totallength = gt_encseq_total_length(encseq),
                idx, specials = gt_encseq_specialcharacters(encseq);
  GtCompactUlongStore *lcptab = NULL;

  gt_assert(specials <= totallength);
  partwidth = totallength - specials;
  if (partwidth > 0)
  {
    lcptab = gt_ENCSEQ_lcp9_manzini(NULL,
                                    encseq,
                                    readmode,
                                    partwidth,
                                    totallength,
                                    suftab);
    gt_logger_log(logger,
                  "computed reference lcp table with manzini algorithm");
  }
  ssar = gt_newSequentialsuffixarrayreaderfromfile(esaindexname,
                                                   SARR_LCPTAB,
                                                   true,
                                                   logger,
                                                   err);
  if (ssar == NULL)
  {
    haserr = true;
  }
  for (idx = 1UL; /* Nothing */; idx++)
  {
    GtUword mlcpvalue, lcpvalue;
    int retval = gt_nextSequentiallcpvalue(&lcpvalue, ssar, err);

    if (retval < 0)
    {
      haserr = true;
      break;
    }
    if (retval == 0)
    {
      break;
    }
    if (idx < partwidth)
    {
      mlcpvalue = gt_compact_ulong_store_get(lcptab, idx);
    } else
    {
      mlcpvalue = 0;
    }
    if (mlcpvalue != lcpvalue)
    {
      fprintf(stderr, ""GT_WU": mlcpvalue = "GT_WU" != "GT_WU" = lcpvalue\n",
                       idx, mlcpvalue, lcpvalue);
      exit(GT_EXIT_PROGRAMMING_ERROR);
    }
  }
  gt_logger_log(logger, "compare lcp-values against reference");
  if (ssar != NULL)
  {
    gt_freeSequentialsuffixarrayreader(&ssar);
  }
  gt_compact_ulong_store_delete(lcptab);
  return haserr ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r14
movq %r8, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
movl %edx, %ebp
movq %rsi, %r13
movq %rdi, %rbx
movq %rsi, %rdi
callq 0xe7b9c
movq %rax, %r15
movq %r13, %rdi
callq 0xec58b
cmpq %rax, %r15
jb 0x1eddc1
movq %r15, %r12
subq %rax, %r12
jne 0x1edc93
xorl %r15d, %r15d
movq 0x8(%rsp), %rbp
jmp 0x1edcc3
xorl %edi, %edi
movq %r13, %rsi
movl %ebp, %edx
movq %r12, %rcx
movq %r15, %r8
movq 0x10(%rsp), %r9
callq 0x1ed50c
movq %rax, %r15
leaq 0x1ca078(%rip), %rsi    # 0x3b7d2c
movq 0x8(%rsp), %rbp
movq %rbp, %rdi
xorl %eax, %eax
callq 0x103fe1
movq %rbx, %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbp, %rcx
movq %r14, %r8
callq 0x1a5580
movq %rax, %r13
movq %rax, 0x20(%rsp)
cmpq $0x1, %rax
movl $0x0, %ebx
sbbl %ebx, %ebx
leaq 0x18(%rsp), %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x1a56db
testl %eax, %eax
js 0x1edd4d
movq %rbx, 0x10(%rsp)
movl $0x1, %ebx
leaq 0x18(%rsp), %rbp
testl %eax, %eax
je 0x1edd54
cmpq %r12, %rbx
jae 0x1edd27
movq %r15, %rdi
movq %rbx, %rsi
callq 0xe3c2c
jmp 0x1edd29
xorl %eax, %eax
movq 0x18(%rsp), %r8
cmpq %r8, %rax
jne 0x1edd99
incq %rbx
movq %rbp, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x1a56db
testl %eax, %eax
jns 0x1edd11
movq 0x8(%rsp), %rbp
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x1edd60
movq 0x10(%rsp), %rax
movl %eax, %ebx
movq 0x8(%rsp), %rbp
leaq 0x1ca021(%rip), %rsi    # 0x3b7d88
movq %rbp, %rdi
xorl %eax, %eax
callq 0x103fe1
testq %r13, %r13
je 0x1edd80
leaq 0x20(%rsp), %rdi
callq 0x1a5698
movq %r15, %rdi
callq 0xe3bf1
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2cb1e0(%rip), %rcx    # 0x4b8f80
movq (%rcx), %rdi
leaq 0x1c9fb6(%rip), %rsi    # 0x3b7d60
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x17ab0
movl $0x2, %edi
callq 0x17940
callq 0x78fd4
nop