// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_sfxmap.c
// Function: gt_sfxmap_pck
static int gt_sfxmap_pck(const Sfxmapoptions *arguments,GtLogger *logger,
                         GtError *err)
{
  bool haserr = false;
  FMindex *fmindex;
  GtUword totallength = 0;
  unsigned int numofchars = 0;
  GtEncseqMetadata *encseqmetadata = NULL;
  Sequentialsuffixarrayreader *ssar = NULL;

  gt_error_check(err);
  gt_assert(gt_str_length(arguments->pckindexname) > 0);
  fmindex = gt_loadvoidBWTSeqForSA(gt_str_get(arguments->pckindexname),false,
                                   err);
  if (fmindex == NULL)
  {
    haserr = true;
  }
  if (!haserr)
  {
    encseqmetadata = gt_encseq_metadata_new(gt_str_get(arguments->pckindexname),
                                            err);
    if (encseqmetadata == NULL)
    {
      haserr = true;
    }
  }
  if (!haserr)
  {
    if (gt_str_length(arguments->esaindexname) > 0 &&
        (arguments->cmpsuf || arguments->cmplcp))
    {
      ssar = gt_newSequentialsuffixarrayreaderfromfile(
                                          gt_str_get(arguments->esaindexname),
                                          arguments->cmpsuf ? SARR_SUFTAB
                                                            : SARR_LCPTAB,
                                          true,
                                          logger,
                                          err);
      if (ssar == NULL)
      {
        haserr = true;
      }
    }
  }
  if (!haserr)
  {
    GtUword idx, pos, numofnonspecials;
    GT_UNUSED GtUword currentsuffix = 0;
    GtSpecialcharinfo specialcharinfo;
    Bwtseqpositioniterator *bspi;

    gt_assert(encseqmetadata != NULL);
    totallength = gt_encseq_metadata_total_length(encseqmetadata);
    specialcharinfo = gt_encseq_metadata_specialcharinfo(encseqmetadata);
    gt_assert(totallength >= specialcharinfo.specialcharacters);
    numofnonspecials = totallength - specialcharinfo.specialcharacters;
    bspi = gt_Bwtseqpositioniterator_new(fmindex,0,totallength);
    gt_logger_log(logger, "iterate over all suftab values");
    for (idx = 0; idx < numofnonspecials; idx++)
    {
      if (!gt_Bwtseqpositioniterator_next(&pos,bspi))
      {
        gt_error_set(err,"cannot decode enough symbols");
        haserr = true;
        break;
      }
      if (arguments->cmpsuf && ssar != NULL)
      {
        SSAR_NEXTSEQUENTIALSUFTABVALUE(currentsuffix,ssar);
        gt_assert(pos == currentsuffix);
      }
      /*printf(""GT_WU": pos = "GT_WU"\n",idx,pos);*/
    }
    gt_assert(idx == numofnonspecials);
    gt_Bwtseqpositioniterator_delete(bspi);
  }
  if (!haserr)
  {
    GtAlphabet *alphabet;

    alphabet = gt_encseq_metadata_alphabet(encseqmetadata);
    if (alphabet == NULL)
    {
      haserr = true;
    }
    numofchars = gt_alphabet_num_of_chars(alphabet);
  }
  if (!haserr)
  {
    if (arguments->cmplcp && ssar != NULL)
    {
      gt_logger_log(logger,"perform dfs traversal");
      if (gt_fmindex_dfstraverse(fmindex,
                                 numofchars,
                                 totallength,
                                 gt_sfxmap_comparelcpvalue,
                                 (void *) ssar,
                                 err) != 0)
      {
        haserr = true;
      }
    }
  }
  gt_deletevoidBWTSeq(fmindex);
  if (ssar != NULL)
  {
    gt_freeSequentialsuffixarrayreader(&ssar);
  }
  gt_encseq_metadata_delete(encseqmetadata);
  return haserr ? -1 : 0;
}

// Assembly:
subq $0x168, %rsp            # imm = 0x168
movq %rdi, 0x160(%rsp)
movq %rsi, 0x158(%rsp)
movq %rdx, 0x150(%rsp)
movb $0x0, 0x14f(%rsp)
movq $0x0, 0x138(%rsp)
movl $0x0, 0x134(%rsp)
movq $0x0, 0x128(%rsp)
movq $0x0, 0x120(%rsp)
cmpq $0x0, 0x150(%rsp)
je 0x6aeec
movq 0x150(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x6aeb4
jmp 0x6aeec
movq 0x5d10e5(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4ab14e(%rip), %rsi    # 0x516013
leaq 0x4ab2f3(%rip), %rdx    # 0x5161bf
leaq 0x4c01d8(%rip), %rcx    # 0x52b0ab
leaq 0x4bf710(%rip), %r8     # 0x52a5ea
movl $0x437, %r9d            # imm = 0x437
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x6aeee
jmp 0x6aef0
movq 0x160(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x11dfa0
cmpq $0x0, %rax
ja 0x6af3f
movq 0x5d1092(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4ab0fb(%rip), %rsi    # 0x516013
leaq 0x4c019a(%rip), %rdx    # 0x52b0b9
leaq 0x4c0185(%rip), %rcx    # 0x52b0ab
leaq 0x4bf6bd(%rip), %r8     # 0x52a5ea
movl $0x438, %r9d            # imm = 0x438
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x6af41
movq 0x160(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x150(%rsp), %rdx
xorl %esi, %esi
callq 0x22fa90
movq %rax, 0x140(%rsp)
cmpq $0x0, 0x140(%rsp)
jne 0x6af7f
movb $0x1, 0x14f(%rsp)
testb $0x1, 0x14f(%rsp)
jne 0x6afc7
movq 0x160(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x150(%rsp), %rsi
callq 0xd4e10
movq %rax, 0x128(%rsp)
cmpq $0x0, 0x128(%rsp)
jne 0x6afc5
movb $0x1, 0x14f(%rsp)
jmp 0x6afc7
testb $0x1, 0x14f(%rsp)
jne 0x6b074
movq 0x160(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x11dfa0
cmpq $0x0, %rax
jbe 0x6b072
movq 0x160(%rsp), %rax
testb $0x1, 0x3(%rax)
jne 0x6b00c
movq 0x160(%rsp), %rax
testb $0x1, 0x4(%rax)
je 0x6b072
movq 0x160(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x160(%rsp), %rax
movb 0x3(%rax), %cl
movl $0x4, %esi
movl $0x2, %eax
testb $0x1, %cl
cmovnel %eax, %esi
movq 0x158(%rsp), %rcx
movq 0x150(%rsp), %r8
movl $0x1, %edx
callq 0x23b3e0
movq %rax, 0x120(%rsp)
cmpq $0x0, 0x120(%rsp)
jne 0x6b070
movb $0x1, 0x14f(%rsp)
jmp 0x6b072
jmp 0x6b074
testb $0x1, 0x14f(%rsp)
jne 0x6b53a
movq $0x0, 0x100(%rsp)
cmpq $0x0, 0x128(%rsp)
jne 0x6b0d1
movq 0x5d0f00(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4aaf69(%rip), %rsi    # 0x516013
leaq 0x4c0033(%rip), %rdx    # 0x52b0e4
leaq 0x4bfff3(%rip), %rcx    # 0x52b0ab
leaq 0x4bf52b(%rip), %r8     # 0x52a5ea
movl $0x461, %r9d            # imm = 0x461
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x6b0d3
movq 0x128(%rsp), %rdi
callq 0xd66d0
movq %rax, 0x138(%rsp)
movq 0x128(%rsp), %rsi
leaq 0x18(%rsp), %rdi
callq 0xd6a60
leaq 0x90(%rsp), %rdi
leaq 0x18(%rsp), %rsi
movl $0x70, %edx
callq 0x19610
movq 0x138(%rsp), %rax
cmpq 0x90(%rsp), %rax
jae 0x6b15b
movq 0x5d0e76(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4aaedf(%rip), %rsi    # 0x516013
leaq 0x4bffc0(%rip), %rdx    # 0x52b0fb
leaq 0x4bff69(%rip), %rcx    # 0x52b0ab
leaq 0x4bf4a1(%rip), %r8     # 0x52a5ea
movl $0x464, %r9d            # imm = 0x464
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x6b15d
movq 0x138(%rsp), %rax
subq 0x90(%rsp), %rax
movq %rax, 0x108(%rsp)
movq 0x140(%rsp), %rdi
movq 0x138(%rsp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x22f3a0
movq %rax, 0x88(%rsp)
movq 0x158(%rsp), %rdi
leaq 0x4bff87(%rip), %rsi    # 0x52b12c
movb $0x0, %al
callq 0xe7cd0
movq $0x0, 0x118(%rsp)
movq 0x118(%rsp), %rax
cmpq 0x108(%rsp), %rax
jae 0x6b4df
movq 0x88(%rsp), %rsi
leaq 0x110(%rsp), %rdi
callq 0x22f410
testb $0x1, %al
jne 0x6b20a
movq 0x150(%rsp), %rdi
leaq 0x4bff55(%rip), %rsi    # 0x52b14b
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x14f(%rsp)
jmp 0x6b4df
movq 0x160(%rsp), %rax
testb $0x1, 0x3(%rax)
je 0x6b4c4
cmpq $0x0, 0x120(%rsp)
je 0x6b4c4
movq 0x120(%rsp), %rax
testb $0x1, 0x40(%rax)
je 0x6b442
movq 0x120(%rsp), %rax
movq (%rax), %rax
cmpq $0x0, 0xb0(%rax)
je 0x6b34e
movq 0x120(%rsp), %rax
movq (%rax), %rax
addq $0xa0, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movl 0x4(%rax), %eax
movq 0x10(%rsp), %rcx
cmpl (%rcx), %eax
jb 0x6b322
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rcx
movl $0x8, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x19a70
movl %eax, %ecx
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x19e10
cmpl $0x0, %eax
je 0x6b2e5
movq 0x150(%rsp), %rdi
leaq 0x4bfa47(%rip), %rsi    # 0x52ad14
leaq 0x54cd3b(%rip), %rdx    # 0x5b800f
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x14f(%rsp)
jmp 0x6b320
movq 0x10(%rsp), %rax
movl $0x0, 0x4(%rax)
movq 0x10(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x6b31e
movq 0x150(%rsp), %rdi
leaq 0x4bfe5e(%rip), %rsi    # 0x52b168
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x14f(%rsp)
jmp 0x6b4df
jmp 0x6b320
jmp 0x6b322
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rsp), %rdx
movl 0x4(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x4(%rdx)
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x100(%rsp)
jmp 0x6b440
movq 0x120(%rsp), %rax
movq (%rax), %rax
addq $0x88, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movl 0x4(%rax), %eax
movq 0x8(%rsp), %rcx
cmpl (%rcx), %eax
jb 0x6b41a
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rcx
movl $0x4, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x19a70
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, (%rax)
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x19e10
cmpl $0x0, %eax
je 0x6b3dd
movq 0x150(%rsp), %rdi
leaq 0x4bf94f(%rip), %rsi    # 0x52ad14
leaq 0x4bfdb4(%rip), %rdx    # 0x52b180
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x14f(%rsp)
jmp 0x6b418
movq 0x8(%rsp), %rax
movl $0x0, 0x4(%rax)
movq 0x8(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x6b416
movq 0x150(%rsp), %rdi
leaq 0x4bfd66(%rip), %rsi    # 0x52b168
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x14f(%rsp)
jmp 0x6b4df
jmp 0x6b418
jmp 0x6b41a
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rsp), %rdx
movl 0x4(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x4(%rdx)
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movq %rax, 0x100(%rsp)
jmp 0x6b474
movq 0x120(%rsp), %rax
movq (%rax), %rax
movq 0x58(%rax), %rax
movq 0x120(%rsp), %rdx
movq 0x18(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x18(%rdx)
movq (%rax,%rcx,8), %rax
movq %rax, 0x100(%rsp)
jmp 0x6b476
movq 0x110(%rsp), %rax
cmpq 0x100(%rsp), %rax
je 0x6b4c0
movq 0x5d0b11(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4aab7a(%rip), %rsi    # 0x516013
leaq 0x4bfce9(%rip), %rdx    # 0x52b189
leaq 0x4bfc04(%rip), %rcx    # 0x52b0ab
leaq 0x4bf13c(%rip), %r8     # 0x52a5ea
movl $0x473, %r9d            # imm = 0x473
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x6b4c2
jmp 0x6b4c4
jmp 0x6b4c6
movq 0x118(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x118(%rsp)
jmp 0x6b1b8
jmp 0x6b4e1
movq 0x118(%rsp), %rax
cmpq 0x108(%rsp), %rax
je 0x6b52b
movq 0x5d0aa6(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4aab0f(%rip), %rsi    # 0x516013
leaq 0x4bfc93(%rip), %rdx    # 0x52b19e
leaq 0x4bfb99(%rip), %rcx    # 0x52b0ab
leaq 0x4bf0d1(%rip), %r8     # 0x52a5ea
movl $0x477, %r9d            # imm = 0x477
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x6b52d
movq 0x88(%rsp), %rdi
callq 0x22f5e0
testb $0x1, 0x14f(%rsp)
jne 0x6b574
movq 0x128(%rsp), %rdi
callq 0xd6680
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x6b564
movb $0x1, 0x14f(%rsp)
movq (%rsp), %rdi
callq 0x7e8c0
movl %eax, 0x134(%rsp)
testb $0x1, 0x14f(%rsp)
jne 0x6b5f1
movq 0x160(%rsp), %rax
testb $0x1, 0x4(%rax)
je 0x6b5ef
cmpq $0x0, 0x120(%rsp)
je 0x6b5ef
movq 0x158(%rsp), %rdi
leaq 0x4bfc10(%rip), %rsi    # 0x52b1b6
movb $0x0, %al
callq 0xe7cd0
movq 0x140(%rsp), %rdi
movl 0x134(%rsp), %esi
movq 0x138(%rsp), %rdx
movq 0x120(%rsp), %r8
movq 0x150(%rsp), %r9
leaq 0x1b85(%rip), %rcx      # 0x6d160
callq 0x2628b0
cmpl $0x0, %eax
je 0x6b5ed
movb $0x1, 0x14f(%rsp)
jmp 0x6b5ef
jmp 0x6b5f1
movq 0x140(%rsp), %rdi
callq 0x22fd20
cmpq $0x0, 0x120(%rsp)
je 0x6b616
leaq 0x120(%rsp), %rdi
callq 0x23b5e0
movq 0x128(%rsp), %rdi
callq 0xd6ae0
movb 0x14f(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x168, %rsp            # imm = 0x168
retq
nop