// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/encseq2offset.c
// Function: gt_encseqtable2sequenceoffsets
GtUword *gt_encseqtable2sequenceoffsets(
                                    GtUword *totallength,
                                    GtSpecialcharinfo *specialcharinfo,
                                    const Suffixarray *suffixarraytable,
                                    unsigned int numofindexes)
{
  unsigned int idx;
  GtUchar lastofprevious, firstofcurrent;
  GtUword tmplength, GT_UNUSED numofsequences = 0, *sequenceoffsettable;
  uint64_t tmpspecialcharacters,
           tmpwildcards,
           tmpspecialranges,
           tmpwildcardranges,
           tmprealspecialranges,
           tmprealwildcardranges,
           tmpoffset;

  gt_assert(numofindexes > 0);
  sequenceoffsettable = gt_malloc(sizeof (*sequenceoffsettable) * numofindexes);
  tmpspecialcharacters = (uint64_t) (numofindexes-1);
  tmpwildcards = 0;
  tmpspecialranges = 0;
  tmpwildcardranges = 0;
  tmprealspecialranges = 0;
  tmprealwildcardranges = 0;
  for (idx=0; idx<numofindexes; idx++)
  {
    if (idx == 0)
    {
      tmplength = 0;
      sequenceoffsettable[idx] = 0;
    } else
    {
      tmplength = gt_encseq_total_length(suffixarraytable[idx - 1].encseq);
      sequenceoffsettable[idx] = sequenceoffsettable[idx-1] + tmplength + 1UL;
    }
    numofsequences += gt_encseq_num_of_sequences(suffixarraytable[idx].encseq);
    tmpspecialcharacters
      += (uint64_t) gt_encseq_specialcharacters(suffixarraytable[idx].encseq);
    tmpwildcards
      += (uint64_t) gt_encseq_wildcards(suffixarraytable[idx].encseq);
    tmpspecialranges
      += (uint64_t) gt_encseq_specialranges(suffixarraytable[idx].encseq);
    tmpwildcardranges
      += (uint64_t) gt_encseq_wildcardranges(suffixarraytable[idx].encseq);
    tmprealspecialranges
      += (uint64_t) gt_encseq_realspecialranges(suffixarraytable[idx].encseq);
    tmprealwildcardranges
      += (uint64_t) gt_encseq_realwildcardranges(suffixarraytable[idx].encseq);
    if (idx > 0)
    {
      /* Random access */
      lastofprevious
        = gt_encseq_get_encoded_char(suffixarraytable[idx-1].encseq,
                                     tmplength-1,
                                     suffixarraytable[idx - 1].readmode);
      /* Random access */
      firstofcurrent
        = gt_encseq_get_encoded_char(suffixarraytable[idx].encseq,
                                     0,
                                     suffixarraytable[idx].readmode);
      if (GT_ISSPECIAL(lastofprevious))
      {
        if (GT_ISSPECIAL(firstofcurrent))
        {
          tmpspecialranges--;
          tmprealspecialranges--;
        }
      } else
      {
        if (GT_ISNOTSPECIAL(firstofcurrent))
        {
          tmpspecialranges++;
          tmprealspecialranges++;
        }
      }
    }
    tmpoffset = (uint64_t) sequenceoffsettable[idx] +
       (uint64_t) gt_encseq_total_length(suffixarraytable[idx].encseq);
    (void) CALLCASTFUNC(uint64_t,unsigned_long,tmpoffset);
    (void) CALLCASTFUNC(uint64_t,unsigned_long,tmpspecialcharacters);
    (void) CALLCASTFUNC(uint64_t,unsigned_long,tmpwildcards);
    (void) CALLCASTFUNC(uint64_t,unsigned_long,tmpspecialranges);
    (void) CALLCASTFUNC(uint64_t,unsigned_long,tmpwildcardranges);
    (void) CALLCASTFUNC(uint64_t,unsigned_long,tmprealspecialranges);
    (void) CALLCASTFUNC(uint64_t,unsigned_long,tmprealwildcardranges);
    printf("# seqlen[%u] = "GT_WU"\n",
           idx,
           gt_encseq_total_length(suffixarraytable[idx].encseq));
  }
  tmplength = gt_encseq_total_length(suffixarraytable[numofindexes -1].encseq);
  *totallength = sequenceoffsettable[numofindexes-1] + tmplength;
  specialcharinfo->specialcharacters = (GtUword) tmpspecialcharacters;
  specialcharinfo->wildcards = (GtUword) tmpwildcards;
  specialcharinfo->specialranges = (GtUword) tmpspecialranges;
  specialcharinfo->wildcardranges = (GtUword) tmpwildcardranges;
  specialcharinfo->realspecialranges = (GtUword) tmprealspecialranges;
  specialcharinfo->realwildcardranges = (GtUword) tmprealwildcardranges;
  specialcharinfo->lengthofspecialprefix
    = gt_encseq_lengthofspecialprefix(suffixarraytable[0].encseq);
  specialcharinfo->lengthofwildcardprefix
    = gt_encseq_lengthofwildcardprefix(suffixarraytable[0].encseq);
  specialcharinfo->lengthofspecialsuffix
    = gt_encseq_lengthofspecialsuffix(suffixarraytable[idx-1].encseq);
  specialcharinfo->lengthofwildcardsuffix
    = gt_encseq_lengthofwildcardsuffix(suffixarraytable[idx-1].encseq);
  gt_assert(numofsequences > 0);
#ifndef NDEBUG
  gt_GtSpecialcharinfo_check(specialcharinfo,numofsequences - 1);
#endif
  return sequenceoffsettable;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movl %ecx, 0x6c(%rsp)
movq $0x0, 0x50(%rsp)
cmpl $0x0, 0x6c(%rsp)
ja 0x4b2915
movq 0x1896bc(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x63725(%rip), %rsi     # 0x516013
leaq 0x104aa7(%rip), %rdx    # 0x5b739c
leaq 0x104ab1(%rip), %rcx    # 0x5b73ad
leaq 0x104ac9(%rip), %r8     # 0x5b73cc
movl $0x28, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4b2917
movl 0x6c(%rsp), %eax
movl %eax, %edi
shlq $0x3, %rdi
leaq 0x104aa4(%rip), %rsi    # 0x5b73cc
movl $0x29, %edx
callq 0xe80f0
movq %rax, 0x48(%rsp)
movl 0x6c(%rsp), %eax
subl $0x1, %eax
movl %eax, %eax
movq %rax, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x0, 0x68(%rsp)
movl 0x68(%rsp), %eax
cmpl 0x6c(%rsp), %eax
jae 0x4b2cdc
cmpl $0x0, 0x68(%rsp)
jne 0x4b29ab
movq $0x0, 0x58(%rsp)
movq 0x48(%rsp), %rax
movl 0x68(%rsp), %ecx
movq $0x0, (%rax,%rcx,8)
jmp 0x4b29f5
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0xa9d00
movq %rax, 0x58(%rsp)
movq 0x48(%rsp), %rax
movl 0x68(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rdx
addq 0x58(%rsp), %rdx
addq $0x1, %rdx
movq 0x48(%rsp), %rax
movl 0x68(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0xa9d50
addq 0x50(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0xb2530
addq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0xb2880
addq 0x38(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0xb2580
addq 0x30(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0xb28c0
addq 0x28(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0xb27b0
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0xb2900
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x68(%rsp)
jbe 0x4b2bc5
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq 0x58(%rsp), %rsi
subq $0x1, %rsi
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movl 0x48(%rax), %edx
callq 0xa9da0
movb %al, 0x67(%rsp)
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movl 0x48(%rax), %edx
xorl %eax, %eax
movl %eax, %esi
callq 0xa9da0
movb %al, 0x66(%rsp)
movzbl 0x67(%rsp), %eax
cmpl $0xfe, %eax
jl 0x4b2b99
movzbl 0x66(%rsp), %eax
cmpl $0xfe, %eax
jl 0x4b2b97
movq 0x30(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x30(%rsp)
movq 0x20(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x4b2bc3
movzbl 0x66(%rsp), %eax
cmpl $0xfe, %eax
jge 0x4b2bc1
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x4b2bc3
jmp 0x4b2bc5
movq 0x48(%rsp), %rax
movl 0x68(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, (%rsp)
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0xa9d00
movq %rax, %rcx
movq (%rsp), %rax
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdx
leaq 0x1047c3(%rip), %rdi    # 0x5b73cc
movl $0x66, %esi
callq 0x4b2e60
movq 0x40(%rsp), %rdx
leaq 0x1047ad(%rip), %rdi    # 0x5b73cc
movl $0x67, %esi
callq 0x4b2e60
movq 0x38(%rsp), %rdx
leaq 0x104797(%rip), %rdi    # 0x5b73cc
movl $0x68, %esi
callq 0x4b2e60
movq 0x30(%rsp), %rdx
leaq 0x104781(%rip), %rdi    # 0x5b73cc
movl $0x69, %esi
callq 0x4b2e60
movq 0x28(%rsp), %rdx
leaq 0x10476b(%rip), %rdi    # 0x5b73cc
movl $0x6a, %esi
callq 0x4b2e60
movq 0x20(%rsp), %rdx
leaq 0x104755(%rip), %rdi    # 0x5b73cc
movl $0x6b, %esi
callq 0x4b2e60
movq 0x18(%rsp), %rdx
leaq 0x10473f(%rip), %rdi    # 0x5b73cc
movl $0x6c, %esi
callq 0x4b2e60
movl 0x68(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0xa9d00
movl 0xc(%rsp), %esi
movq %rax, %rdx
leaq 0x104721(%rip), %rdi    # 0x5b73e6
movb $0x0, %al
callq 0x19070
movl 0x68(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x68(%rsp)
jmp 0x4b297a
movq 0x70(%rsp), %rax
movl 0x6c(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0xa9d00
movq %rax, 0x58(%rsp)
movq 0x48(%rsp), %rax
movl 0x6c(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rcx
addq 0x58(%rsp), %rcx
movq 0x80(%rsp), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, (%rax)
movq 0x38(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x30(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x28(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x20(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x70(%rsp), %rax
movq (%rax), %rdi
callq 0xb2840
movq %rax, %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x70(%rsp), %rax
movq (%rax), %rdi
callq 0xb2940
movq %rax, %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0xb2860
movq %rax, %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0xb2960
movq %rax, %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x48(%rax)
cmpq $0x0, 0x50(%rsp)
ja 0x4b2e37
movq 0x18919a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x63203(%rip), %rsi     # 0x516013
leaq 0xc5600(%rip), %rdx     # 0x578417
leaq 0x10458f(%rip), %rcx    # 0x5b73ad
leaq 0x1045a7(%rip), %r8     # 0x5b73cc
movl $0x81, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4b2e39
movq 0x78(%rsp), %rdi
movq 0x50(%rsp), %rsi
subq $0x1, %rsi
callq 0xb2eb0
movq 0x48(%rsp), %rax
addq $0x88, %rsp
retq
nopl (%rax)