// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/sfx-lcpvalues.c
// Function: gt_Outlcpinfo_check_lcpvalues
void gt_Outlcpinfo_check_lcpvalues(const GtEncseq *encseq,
                                   GtReadmode readmode,
                                   const GtSuffixsortspace *sortedsample,
                                   GtUword effectivesamplesize,
                                   const GtOutlcpinfo *outlcpinfosample,
                                   bool checkequality)
{
  GT_UNUSED int cmp;
  GtUword idx, reallcp, startpos1, startpos2, currentlcp,
                GT_UNUSED totalcmpmissing = 0;

  if (effectivesamplesize == 0)
  {
    return;
  }
  startpos1 = gt_suffixsortspace_getdirect(sortedsample,0);
  for (idx=1UL; idx<effectivesamplesize; idx++)
  {
    startpos2 = gt_suffixsortspace_getdirect(sortedsample,idx);
    cmp = gt_encseq_check_comparetwosuffixes(encseq,
                                             readmode,
                                             &reallcp,
                                             false,
                                             false,
                                             0,
                                             startpos1,
                                             startpos2,
                                             NULL,
                                             NULL);
    gt_assert(cmp <= 0);
    gt_assert(GT_ISIBITSET(outlcpinfosample->lcpsubtab.tableoflcpvalues
                                                      .isset,idx));
    currentlcp = (GtUword) outlcpinfosample->lcpsubtab.tableoflcpvalues.
                                 bucketoflcpvalues[idx];
    if ((checkequality && currentlcp != reallcp) ||
        (!checkequality && currentlcp > reallcp))
    {
      fprintf(stderr,"idx="GT_WU",suffixpair="GT_WU","GT_WU": "
                     "currentlcp = "GT_WU" %s "GT_WU" = reallcp\n",
                      idx,startpos1,startpos2,currentlcp,
                      checkequality ? "!=" : ">",reallcp);
      gt_encseq_showatstartposwithdepth(stderr,encseq,readmode,startpos1,50UL);
      fprintf(stderr,"\n");
      gt_encseq_showatstartposwithdepth(stderr,encseq,readmode,startpos2,50UL);
      fprintf(stderr,"\n");
      exit(GT_EXIT_PROGRAMMING_ERROR);
    } else
    {
      totalcmpmissing += (reallcp - currentlcp);
    }
    startpos1 = startpos2;
  }
  /*printf("totalcmpmissing = "GT_WU"(avg=%.2f)\n",
         totalcmpmissing,(double) totalcmpmissing/effectivesamplesize);*/
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, 0x20(%rsp)
movl %esi, 0x24(%rsp)
movq %rdi, 0x28(%rsp)
testq %rcx, %rcx
je 0x19ce96
movq %r8, %r13
movq %rcx, %r14
movq %rdx, %rbp
movq %rdx, %rdi
xorl %esi, %esi
callq 0x1af5f2
movq %rax, %r15
pushq $0x1
popq %rbx
cmpq %rbx, %r14
je 0x19ce96
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x1af5f2
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movq %rax, 0x8(%rsp)
movq %r15, (%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
leaq 0x30(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x77ebd
testl %eax, %eax
jg 0x19cf6c
movq 0x40(%r13), %rax
movq %rbx, %rcx
shrq $0x6, %rcx
movq (%rax,%rcx,8), %rax
movl %ebx, %ecx
shlq %cl, %rax
shrq $0x3f, %rax
je 0x19cea5
movq 0x48(%r13), %rax
movl (%rax,%rbx,4), %r9d
movq 0x30(%rsp), %rax
xorl %ecx, %ecx
xorl %edx, %edx
cmpq %r9, %rax
setne %cl
setb %dl
cmpb $0x0, 0x20(%rsp)
cmovnel %ecx, %edx
cmpb $0x1, %dl
je 0x19ced6
incq %rbx
movq %r12, %r15
jmp 0x19cdff
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x29b0bc(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x14815d(%rip), %rsi    # 0x2e5013
leaq 0x1baf75(%rip), %rdx    # 0x357e32
leaq 0x1baf50(%rip), %rcx    # 0x357e14
leaq 0x1bae77(%rip), %r8     # 0x357d42
movl $0x218, %r9d            # imm = 0x218
jmp 0x19cf98
movq 0x29b08b(%rip), %r14    # 0x437f68
movq (%r14), %rdi
leaq 0x1bafd0(%rip), %rcx    # 0x357eb7
leaq 0x1c5a43(%rip), %rdx    # 0x362931
cmpb $0x0, 0x20(%rsp)
cmovneq %rcx, %rdx
movq %rax, 0x8(%rsp)
movq %rdx, (%rsp)
leaq 0x1baf71(%rip), %rsi    # 0x357e78
movq %rbx, %rdx
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x17a50
movq (%r14), %rdi
pushq $0x32
popq %r8
movq 0x28(%rsp), %rbx
movq %rbx, %rsi
movl 0x24(%rsp), %r13d
movl %r13d, %edx
movq %r15, %rcx
movq %r8, %r15
callq 0x77abf
movq (%r14), %rsi
pushq $0xa
popq %rbp
movl %ebp, %edi
callq 0x17930
movq (%r14), %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r12, %rcx
movq %r15, %r8
callq 0x77abf
movq (%r14), %rsi
movl %ebp, %edi
callq 0x17930
pushq $0x2
popq %rdi
callq 0x178f0
movq 0x29aff5(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x148096(%rip), %rsi    # 0x2e5013
leaq 0x1a98e5(%rip), %rdx    # 0x346869
leaq 0x1bae89(%rip), %rcx    # 0x357e14
leaq 0x1badb0(%rip), %r8     # 0x357d42
movl $0x216, %r9d            # imm = 0x216
xorl %eax, %eax
callq 0x17a50
callq 0x17390