// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-lwcheck.c
// Function: gt_suftab_lightweightcheck
void gt_suftab_lightweightcheck(LW_accesschar accesschar,
                                LW_charcount charcount,
                                const void *encseq,
                                GtReadmode readmode,
                                GtUword totallength,
                                unsigned int numofchars,
                                const void *suftab,
                                size_t unitsize,
                                GtLogger *logger)
{
  GtUword idx, countbitsset = 0, previouspos = 0,
                firstspecial = totallength, rangestart = 0;
  unsigned int charidx, rangeidx = 0, numofranges;
  GtBitsequence *startposoccurs;
  GtUchar previouscc = 0;
  GtRangewithchar *rangestore;
  const bool skcheck = true;

#ifdef _WIN32
  gt_assert(unitsize == (size_t) 4);
#else
  gt_assert(unitsize == (size_t) 4 || unitsize == (size_t) 8);
#endif
  GT_INITBITTAB(startposoccurs, totallength+1);
  rangestore = gt_malloc(sizeof(*rangestore) * numofchars);
  for (idx = 0; idx < totallength; idx++)
  {
    GtUword position = GEN_ESASUFFIXPTRGET(suftab, idx);
    GtUchar cc;

    if (GT_ISIBITSET(startposoccurs, position))
    {
      fprintf(stderr, "ERROR: suffix with startpos "GT_WU" already occurs\n",
              GEN_ESASUFFIXPTRGET(suftab, idx));
      exit(GT_EXIT_PROGRAMMING_ERROR);
    }
    GT_SETIBIT(startposoccurs, position);
    countbitsset++;
    cc = accesschar(encseq,position,readmode);
    if (idx > 0)
    {
      if (GT_ISSPECIAL(cc))
      {
        if (firstspecial == totallength)
        {
          firstspecial = idx;
          gt_assert(rangeidx < numofchars);
          rangestore[rangeidx].start = rangestart;
          rangestore[rangeidx].end = idx-1;
          rangestore[rangeidx++].firstchar = previouscc;
        }
        if (GT_ISSPECIAL(previouscc))
        {
          if (previouspos > position)
          {
            fprintf(stderr, "incorrect order: " GT_WU " = " GT_WU "=SPECIAL > "
                    "SPECIAL="GT_WU"  = "GT_WU"\n",
                    idx-1, position, previouspos, idx);
            exit(GT_EXIT_PROGRAMMING_ERROR);
          }
        }
      } else
      {
        if (GT_ISSPECIAL(previouscc))
        {
          fprintf(stderr, "incorrect order: "GT_WU"="GT_WU"=SPECIAL > "
                  "%u="GT_WU"="GT_WU"\n", idx-1, position, (unsigned int) cc,
                  previouspos, idx);
          exit(GT_EXIT_PROGRAMMING_ERROR);
        } else
        {
          if (previouscc > cc)
          {
            fprintf(stderr, "incorrect order: "GT_WU" = "GT_WU"=%u > "
                    "%u="GT_WU"="GT_WU"\n", idx-1, position, (unsigned int)
                    previouscc, (unsigned int) cc, previouspos, idx);
            exit(GT_EXIT_PROGRAMMING_ERROR);
          } else
          {
            if (previouscc < cc)
            {
              gt_assert(rangeidx < numofchars);
              rangestore[rangeidx].start = rangestart;
              rangestore[rangeidx].end = idx-1;
              rangestore[rangeidx++].firstchar = previouscc;
              rangestart = idx;
            }
          }
        }
      }
    } else
    {
      if (GT_ISSPECIAL(cc))
      {
        firstspecial = 0;
      }
    }
    previouscc = cc;
    previouspos = position;
  }
  if (countbitsset != totallength)
  {
    fprintf(stderr, "ERROR: only "GT_WU" of "GT_WU" suffixes occur\n",
            countbitsset, totallength);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }
  gt_free(startposoccurs);
  if (firstspecial == totallength)
  {
    gt_assert(firstspecial > 0 && rangeidx < numofchars);
    rangestore[rangeidx].start = rangestart;
    rangestore[rangeidx].end = firstspecial-1;
    rangestore[rangeidx++].firstchar = previouscc;
  }
  numofranges = rangeidx;
  for (charidx = 0, rangeidx = 0; charidx < numofchars; charidx++)
  {
    GtUword count;
    GtUchar thisidx = GT_ISDIRCOMPLEMENT(readmode)
                        ? (GtUchar) GT_COMPLEMENTBASE(charidx)
                        : (GtUchar) charidx;

    count = charcount(encseq,thisidx);
    if (count != 0)
    {
      gt_assert(rangeidx < numofranges &&
                rangestore[rangeidx].firstchar == (GtUchar) charidx);
      gt_assert(rangestore[rangeidx].end - rangestore[rangeidx].start + 1
                == count);
      rangeidx++;
    }
  }
  gt_logger_log(logger, "suftab-check, first phase done");
  if (skcheck)
  {
    gt_suftab_sk_suffixorder(totallength,
                             numofchars,
                             suftab,
                             unitsize,
                             rangestore,
                             numofranges);
    gt_logger_log(logger, "suftab-check, second phase (sk-method) done");
  } else
  {
    gt_suftab_bk_suffixorder(accesschar,
                             encseq,
                             readmode,
                             totallength,
                             numofchars,
                             suftab,
                             unitsize,
                             rangestore,
                             numofranges);
    gt_logger_log(logger, "suftab-check, second phase (bk-method) done");
  }
  gt_free(rangestore);
}

// Assembly:
subq $0xe8, %rsp
movq 0x100(%rsp), %rax
movq 0xf8(%rsp), %rax
movq 0xf0(%rsp), %rax
movq %rdi, 0xe0(%rsp)
movq %rsi, 0xd8(%rsp)
movq %rdx, 0xd0(%rsp)
movl %ecx, 0xcc(%rsp)
movq %r8, 0xc0(%rsp)
movl %r9d, 0xbc(%rsp)
movq $0x0, 0xa8(%rsp)
movq $0x0, 0xa0(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x98(%rsp)
movq $0x0, 0x90(%rsp)
movl $0x0, 0x88(%rsp)
movb $0x0, 0x77(%rsp)
movb $0x1, 0x67(%rsp)
cmpq $0x4, 0xf8(%rsp)
je 0x2c97a5
cmpq $0x8, 0xf8(%rsp)
je 0x2c97a5
movq 0x37282c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24c895(%rip), %rsi    # 0x516013
leaq 0x2c16d9(%rip), %rdx    # 0x58ae5e
leaq 0x2c1703(%rip), %rcx    # 0x58ae8f
leaq 0x2c1717(%rip), %r8     # 0x58aeaa
movl $0xca, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2c97a7
movq 0xc0(%rsp), %rax
addq $0x1, %rax
shrq $0x6, %rax
cmpq $0x0, %rax
jne 0x2c97c9
movl $0x1, %eax
movq %rax, 0x30(%rsp)
jmp 0x2c97e6
movq 0xc0(%rsp), %rax
addq $0x1, %rax
subq $0x1, %rax
shrq $0x6, %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rsi
shlq $0x3, %rsi
xorl %eax, %eax
movl %eax, %edi
leaq 0x2c16a6(%rip), %rdx    # 0x58aeaa
movl $0xcc, %ecx
callq 0xe8540
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rdi
movq 0x58(%rsp), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x19360
movl 0xbc(%rsp), %eax
imulq $0x18, %rax, %rdi
leaq 0x2c1670(%rip), %rsi    # 0x58aeaa
movl $0xcd, %edx
callq 0xe80f0
movq %rax, 0x68(%rsp)
movq $0x0, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
cmpq 0xc0(%rsp), %rax
jae 0x2c9cfb
cmpq $0x4, 0xf8(%rsp)
jne 0x2c9890
movq 0xf0(%rsp), %rax
movq 0xb0(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq %rax, 0x28(%rsp)
jmp 0x2c98a9
movq 0xf0(%rsp), %rax
movq 0xb0(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x78(%rsp), %rax
movq 0x50(%rsp), %rcx
shrq $0x6, %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rsp), %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x2c9956
movq 0x3726b2(%rip), %rax    # 0x63bfa0
movq (%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x4, 0xf8(%rsp)
jne 0x2c991b
movq 0xf0(%rsp), %rax
movq 0xb0(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq %rax, 0x18(%rsp)
jmp 0x2c9934
movq 0xf0(%rsp), %rax
movq 0xb0(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rdx
leaq 0x26157a(%rip), %rsi    # 0x52aebf
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
movq 0x50(%rsp), %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq 0x78(%rsp), %rax
movq 0x50(%rsp), %rcx
shrq $0x6, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq 0xa8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xa8(%rsp)
movq 0xe0(%rsp), %rax
movq 0xd0(%rsp), %rdi
movq 0x50(%rsp), %rsi
movl 0xcc(%rsp), %edx
callq *%rax
movb %al, 0x4f(%rsp)
cmpq $0x0, 0xb0(%rsp)
jbe 0x2c9cb3
movzbl 0x4f(%rsp), %eax
cmpl $0xfe, %eax
jl 0x2c9b15
movq 0x98(%rsp), %rax
cmpq 0xc0(%rsp), %rax
jne 0x2c9ab0
movq 0xb0(%rsp), %rax
movq %rax, 0x98(%rsp)
movl 0x88(%rsp), %eax
cmpl 0xbc(%rsp), %eax
jb 0x2c9a45
movq 0x37258c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24c5f5(%rip), %rsi    # 0x516013
leaq 0x2c156c(%rip), %rdx    # 0x58af91
leaq 0x2c1463(%rip), %rcx    # 0x58ae8f
leaq 0x2c1477(%rip), %r8     # 0x58aeaa
movl $0xe3, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2c9a47
movq 0x90(%rsp), %rcx
movq 0x68(%rsp), %rax
movl 0x88(%rsp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq 0xb0(%rsp), %rcx
subq $0x1, %rcx
movq 0x68(%rsp), %rax
movl 0x88(%rsp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movb 0x77(%rsp), %cl
movq 0x68(%rsp), %rax
movl 0x88(%rsp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, 0x88(%rsp)
movl %edx, %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x10(%rax)
movzbl 0x77(%rsp), %eax
cmpl $0xfe, %eax
jl 0x2c9b10
movq 0xa0(%rsp), %rax
cmpq 0x50(%rsp), %rax
jbe 0x2c9b0e
movq 0x3724ce(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0xb0(%rsp), %rdx
subq $0x1, %rdx
movq 0x50(%rsp), %rcx
movq 0xa0(%rsp), %r8
movq 0xb0(%rsp), %r9
leaq 0x2c13c5(%rip), %rsi    # 0x58aec2
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
jmp 0x2c9b10
jmp 0x2c9cb1
movzbl 0x77(%rsp), %eax
cmpl $0xfe, %eax
jl 0x2c9b6e
movq 0x372478(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0xb0(%rsp), %rdx
subq $0x1, %rdx
movq 0x50(%rsp), %rcx
movzbl 0x4f(%rsp), %r8d
movq 0xa0(%rsp), %r9
movq 0xb0(%rsp), %rax
leaq 0x2c13a2(%rip), %rsi    # 0x58aefb
movq %rax, (%rsp)
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
movzbl 0x77(%rsp), %eax
movzbl 0x4f(%rsp), %ecx
cmpl %ecx, %eax
jle 0x2c9bd4
movq 0x37241d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0xb0(%rsp), %rdx
subq $0x1, %rdx
movq 0x50(%rsp), %rcx
movzbl 0x77(%rsp), %r8d
movzbl 0x4f(%rsp), %r9d
movq 0xa0(%rsp), %r10
movq 0xb0(%rsp), %rax
leaq 0x2c1370(%rip), %rsi    # 0x58af2a
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
movzbl 0x77(%rsp), %eax
movzbl 0x4f(%rsp), %ecx
cmpl %ecx, %eax
jge 0x2c9cab
jmp 0x2c9be8
movl 0x88(%rsp), %eax
cmpl 0xbc(%rsp), %eax
jb 0x2c9c30
movq 0x3723a1(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24c40a(%rip), %rsi    # 0x516013
leaq 0x2c1381(%rip), %rdx    # 0x58af91
leaq 0x2c1278(%rip), %rcx    # 0x58ae8f
leaq 0x2c128c(%rip), %r8     # 0x58aeaa
movl $0x106, %r9d            # imm = 0x106
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2c9c32
movq 0x90(%rsp), %rcx
movq 0x68(%rsp), %rax
movl 0x88(%rsp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq 0xb0(%rsp), %rcx
subq $0x1, %rcx
movq 0x68(%rsp), %rax
movl 0x88(%rsp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movb 0x77(%rsp), %cl
movq 0x68(%rsp), %rax
movl 0x88(%rsp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, 0x88(%rsp)
movl %edx, %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x10(%rax)
movq 0xb0(%rsp), %rax
movq %rax, 0x90(%rsp)
jmp 0x2c9cad
jmp 0x2c9caf
jmp 0x2c9cb1
jmp 0x2c9ccd
movzbl 0x4f(%rsp), %eax
cmpl $0xfe, %eax
jl 0x2c9ccb
movq $0x0, 0x98(%rsp)
jmp 0x2c9ccd
movb 0x4f(%rsp), %al
movb %al, 0x77(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xb0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xb0(%rsp)
jmp 0x2c9855
movq 0xa8(%rsp), %rax
cmpq 0xc0(%rsp), %rax
je 0x2c9d3f
movq 0x37228c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0xa8(%rsp), %rdx
movq 0xc0(%rsp), %rcx
leaq 0x2c1228(%rip), %rsi    # 0x58af56
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
movq 0x78(%rsp), %rdi
leaq 0x2c115f(%rip), %rsi    # 0x58aeaa
movl $0x11f, %edx            # imm = 0x11F
callq 0xe88c0
movq 0x98(%rsp), %rax
cmpq 0xc0(%rsp), %rax
jne 0x2c9e2b
jmp 0x2c9d6d
cmpq $0x0, 0x98(%rsp)
jbe 0x2c9d88
movl 0x88(%rsp), %eax
cmpl 0xbc(%rsp), %eax
jb 0x2c9dc0
movq 0x372211(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24c27a(%rip), %rsi    # 0x516013
leaq 0x2c11dd(%rip), %rdx    # 0x58af7d
leaq 0x2c10e8(%rip), %rcx    # 0x58ae8f
leaq 0x2c10fc(%rip), %r8     # 0x58aeaa
movl $0x122, %r9d            # imm = 0x122
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2c9dc2
movq 0x90(%rsp), %rcx
movq 0x68(%rsp), %rax
movl 0x88(%rsp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq 0x98(%rsp), %rcx
subq $0x1, %rcx
movq 0x68(%rsp), %rax
movl 0x88(%rsp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movb 0x77(%rsp), %cl
movq 0x68(%rsp), %rax
movl 0x88(%rsp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, 0x88(%rsp)
movl %edx, %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x10(%rax)
movl 0x88(%rsp), %eax
movl %eax, 0x84(%rsp)
movl $0x0, 0x8c(%rsp)
movl $0x0, 0x88(%rsp)
movl 0x8c(%rsp), %eax
cmpl 0xbc(%rsp), %eax
jae 0x2c9fd8
cmpl $0x2, 0xcc(%rsp)
je 0x2c9e77
cmpl $0x3, 0xcc(%rsp)
jne 0x2c9e8c
movl $0x3, %eax
subl 0x8c(%rsp), %eax
movzbl %al, %eax
movl %eax, 0x14(%rsp)
jmp 0x2c9e9a
movl 0x8c(%rsp), %eax
movzbl %al, %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
movb %al, 0x3f(%rsp)
movq 0xd8(%rsp), %rax
movq 0xd0(%rsp), %rdi
movzbl 0x3f(%rsp), %esi
callq *%rax
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x2c9fc0
jmp 0x2c9ecc
movl 0x88(%rsp), %eax
cmpl 0x84(%rsp), %eax
jae 0x2c9f01
movq 0x68(%rsp), %rax
movl 0x88(%rsp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzbl 0x10(%rax), %eax
movl 0x8c(%rsp), %ecx
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x2c9f39
movq 0x372098(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24c101(%rip), %rsi    # 0x516013
leaq 0x2c108e(%rip), %rdx    # 0x58afa7
leaq 0x2c0f6f(%rip), %rcx    # 0x58ae8f
leaq 0x2c0f83(%rip), %r8     # 0x58aeaa
movl $0x133, %r9d            # imm = 0x133
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2c9f3b
jmp 0x2c9f3d
movq 0x68(%rsp), %rax
movl 0x88(%rsp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq 0x68(%rsp), %rcx
movl 0x88(%rsp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
subq (%rcx), %rax
addq $0x1, %rax
cmpq 0x40(%rsp), %rax
je 0x2c9fad
movq 0x372024(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24c08d(%rip), %rsi    # 0x516013
leaq 0x2c1068(%rip), %rdx    # 0x58aff5
leaq 0x2c0efb(%rip), %rcx    # 0x58ae8f
leaq 0x2c0f0f(%rip), %r8     # 0x58aeaa
movl $0x135, %r9d            # imm = 0x135
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2c9faf
movl 0x88(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x88(%rsp)
jmp 0x2c9fc2
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
jmp 0x2c9e4f
movq 0x100(%rsp), %rdi
leaq 0x2c1051(%rip), %rsi    # 0x58b038
movb $0x0, %al
callq 0xe7cd0
movq 0xc0(%rsp), %rdi
movl 0xbc(%rsp), %esi
movq 0xf0(%rsp), %rdx
movq 0xf8(%rsp), %rcx
movq 0x68(%rsp), %r8
movl 0x84(%rsp), %r9d
callq 0x2ca060
movq 0x100(%rsp), %rdi
leaq 0x2c1029(%rip), %rsi    # 0x58b057
movb $0x0, %al
callq 0xe7cd0
movq 0x68(%rsp), %rdi
leaq 0x2c0e69(%rip), %rsi    # 0x58aeaa
movl $0x150, %edx            # imm = 0x150
callq 0xe88c0
addq $0xe8, %rsp
retq
nopw %cs:(%rax,%rax)