// File: /workspace/github_c_makefile_star2_O1/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, %r15
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, 0x18(%rsp)
movq %rsi, %rdi
callq 0xec1d8
movq %rax, %r13
movq %rbx, %rdi
callq 0xf0b87
cmpq %rax, %r13
jb 0x1f7576
movq %r13, %r12
subq %rax, %r12
jne 0x1f7467
xorl %r15d, %r15d
movq 0x8(%rsp), %rbx
jmp 0x1f7495
xorl %edi, %edi
movq %rbx, %rsi
movl %ebp, %edx
movq %r12, %rcx
movq %r13, %r8
movq %r15, %r9
callq 0x1f6ca4
movq %rax, %r15
leaq 0x1c9eff(%rip), %rsi    # 0x3c1385
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10906e
movq 0x18(%rsp), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
movq %r14, %r8
callq 0x1ae094
movq %rax, 0x10(%rsp)
testq %rax, %rax
sete %bl
movl $0x1, %r13d
leaq 0x20(%rsp), %rbp
movq 0x10(%rsp), %rsi
movq %rbp, %rdi
movq %r14, %rdx
callq 0x1ae1ec
testl %eax, %eax
js 0x1f74ed
je 0x1f74ef
cmpq %r12, %r13
jae 0x1f74f3
movq %r15, %rdi
movq %r13, %rsi
callq 0xe80ec
jmp 0x1f74f5
movb $0x1, %bl
xorl %ecx, %ecx
jmp 0x1f7501
xorl %eax, %eax
movq 0x20(%rsp), %r8
movb $0x1, %cl
cmpq %r8, %rax
jne 0x1f754e
testb %cl, %cl
je 0x1f750a
incq %r13
jmp 0x1f74c5
leaq 0x1c9ed0(%rip), %rsi    # 0x3c13e1
movq 0x8(%rsp), %rdi
xorl %eax, %eax
callq 0x10906e
cmpq $0x0, 0x10(%rsp)
je 0x1f752f
leaq 0x10(%rsp), %rdi
callq 0x1ae1ac
movq %r15, %rdi
callq 0xe80b1
andb $0x1, %bl
movzbl %bl, %eax
negl %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2cca2b(%rip), %rcx    # 0x4c3f80
movq (%rcx), %rdi
leaq 0x1c9e5a(%rip), %rsi    # 0x3c13b9
movq %r13, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x17ab0
movl $0x2, %edi
callq 0x17940
callq 0x7acd3
nop