// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/eis-bwtseq-extinfo.c
// Function: initAddLocateInfoState
static void
initAddLocateInfoState(struct addLocateInfoState *state,
                       RandomSeqAccessor origSeqAccess,
                       SeqDataReader readUlong,
                       const MRAEnc *alphabet, const struct seqStats *stats,
                       const enum rangeSortMode *rangeSort,
                       GtUword srcLen, const struct bwtParam *params,
                       const SpecialsRankLookup *sprTable,
                       unsigned bitsPerOrigRank,
                       BWTSeqContextRetrieverFactory *ctxFactory)
{
  GtUword lastPos;
  unsigned aggregationExpVal;
  unsigned locateInterval;
  gt_assert(state);
  state->alphabet = alphabet;
  state->seqLen = srcLen;
  state->rangeSort = rangeSort;
  state->readUlong = readUlong;
  state->origSeqAccess = origSeqAccess;
  state->featureToggles = params->featureToggles;
  aggregationExpVal = gt_estimateSegmentSize(&params->seqParams);
  locateInterval = params->locateInterval;
  lastPos = srcLen - 1;
  state->locateInterval = locateInterval;
  state->bitsPerUlong = requiredUlongBits(lastPos);
  state->bitsPerOrigRank = bitsPerOrigRank;
  state->sprTable = sprTable;
  if (locateInterval)
  {
    if (params->featureToggles & BWTReversiblySorted)
      state->bitsPerOrigPos = requiredUlongBits(lastPos/locateInterval);
    else
      state->bitsPerOrigPos = requiredUlongBits(lastPos);
    state->origRanksQueueSize = state->revMapQueueSize =aggregationExpVal;
    state->revMapQueue = gt_malloc(sizeof (state->revMapQueue[0])
                                   * state->revMapQueueSize);
    state->origRanksQueue = gt_malloc(sizeof (state->origRanksQueue[0])
                                      * state->origRanksQueueSize);
    state->bitsPerOrigRank = bitsPerOrigRank;
    /* if there are rank sorted symbols, but no rank sorting is
     * available, extra locate marks will be inserted, at most every
     * second position can be marked this way because for every
     * SORTMODE_VALUE -> SORTMODE_{RANk|UNDEF} transition there must be one
     * inverse transition */
    if (!(params->featureToggles & BWTReversiblySorted)
        && locateInterval > 1)
    {
      GtUword stdLocMarks = srcLen / locateInterval,
        extraLocMarksUpperBound = GT_MIN(srcLen/2, srcLen - stdLocMarks);
      if (stats)
      {
        GtUword nonValSortSyms = 0;
        unsigned i;
        for (i = 0; i <= UINT8_MAX; ++i)
          if (MRAEncSymbolHasValidMapping(alphabet, i)
              && !gt_MRAEncSymbolIsInSelectedRanges(
                alphabet, MRAEncMapSymbol(alphabet, i),
                SORTMODE_VALUE, (int *)rangeSort))
            nonValSortSyms += stats->symbolDistributionTable[i];
        extraLocMarksUpperBound = GT_MIN3(extraLocMarksUpperBound,
                                          nonValSortSyms,
                                          srcLen - nonValSortSyms);
      }
      state->extraLocMarksUpperBound = extraLocMarksUpperBound;
    }
    else
    {
      state->extraLocMarksUpperBound = 0;
    }
  }
  else
  {
    state->extraLocMarksUpperBound = 0;
    state->bitsPerOrigPos = state->bitsPerOrigRank = 0;
    state->origRanksQueueSize = state->revMapQueueSize = 0;
    state->origRanksQueue = NULL;
    state->revMapQueue = NULL;
  }
  state->ctxFactory = ctxFactory;
}

// Assembly:
subq $0x88, %rsp
movq 0xc0(%rsp), %rax
movl 0xb8(%rsp), %eax
movq 0xb0(%rsp), %rax
movq 0xa8(%rsp), %rax
movq 0xa0(%rsp), %rax
movq 0x98(%rsp), %rax
movq 0x90(%rsp), %rax
movq %rsi, 0x78(%rsp)
movq %rdx, 0x80(%rsp)
movq %rcx, 0x68(%rsp)
movq %r8, 0x70(%rsp)
movq %rdi, 0x60(%rsp)
movq %r9, 0x58(%rsp)
cmpq $0x0, 0x60(%rsp)
jne 0x221fbf
movq 0x41a012(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2f407b(%rip), %rsi    # 0x516013
leaq 0x34402f(%rip), %rdx    # 0x565fce
leaq 0x352fdd(%rip), %rcx    # 0x574f83
leaq 0x352ce7(%rip), %r8     # 0x574c94
movl $0x10a, %r9d            # imm = 0x10A
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x221fc1
movq 0x58(%rsp), %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0xa0(%rsp), %rcx
movq 0x60(%rsp), %rax
movq %rcx, (%rax)
movq 0x98(%rsp), %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
movq %rcx, 0x20(%rax)
movq 0x70(%rsp), %rcx
movq %rcx, 0x28(%rax)
movq 0x60(%rsp), %rax
movq 0x78(%rsp), %rcx
movq %rcx, 0x30(%rax)
movq 0x80(%rsp), %rcx
movq %rcx, 0x38(%rax)
movq 0xa8(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x60(%rsp), %rax
movl %ecx, 0x58(%rax)
movq 0xa8(%rsp), %rdi
callq 0x22a750
movl %eax, 0x4c(%rsp)
movq 0xa8(%rsp), %rax
movl 0x14(%rax), %eax
movl %eax, 0x48(%rsp)
movq 0xa0(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x50(%rsp)
movl 0x48(%rsp), %ecx
movq 0x60(%rsp), %rax
movl %ecx, 0x40(%rax)
movq 0x50(%rsp), %rdi
callq 0x46ec80
movl %eax, %ecx
movq 0x60(%rsp), %rax
movl %ecx, 0x48(%rax)
movl 0xb8(%rsp), %ecx
movq 0x60(%rsp), %rax
movl %ecx, 0x4c(%rax)
movq 0xb0(%rsp), %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x50(%rax)
cmpl $0x0, 0x48(%rsp)
je 0x22234f
movq 0xa8(%rsp), %rax
movl 0x10(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x2220e5
movq 0x50(%rsp), %rax
movl 0x48(%rsp), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, %rdi
callq 0x46ec80
movl %eax, %ecx
movq 0x60(%rsp), %rax
movl %ecx, 0x44(%rax)
jmp 0x2220f9
movq 0x50(%rsp), %rdi
callq 0x46ec80
movl %eax, %ecx
movq 0x60(%rsp), %rax
movl %ecx, 0x44(%rax)
movl 0x4c(%rsp), %eax
movl %eax, %ecx
movq 0x60(%rsp), %rax
movq %rcx, 0x60(%rax)
movq 0x60(%rsp), %rax
movq %rcx, 0x70(%rax)
movq 0x60(%rsp), %rax
movq 0x60(%rax), %rdi
shlq $0x4, %rdi
leaq 0x352b6f(%rip), %rsi    # 0x574c94
movl $0x120, %edx            # imm = 0x120
callq 0xe80f0
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x68(%rax)
movq 0x60(%rsp), %rax
movq 0x70(%rax), %rdi
shlq $0x3, %rdi
leaq 0x352b45(%rip), %rsi    # 0x574c94
movl $0x122, %edx            # imm = 0x122
callq 0xe80f0
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x78(%rax)
movl 0xb8(%rsp), %ecx
movq 0x60(%rsp), %rax
movl %ecx, 0x4c(%rax)
movq 0xa8(%rsp), %rax
movl 0x10(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x222340
cmpl $0x1, 0x48(%rsp)
jbe 0x222340
movq 0xa0(%rsp), %rax
movl 0x48(%rsp), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, 0x40(%rsp)
movq 0xa0(%rsp), %rax
shrq %rax
movq 0xa0(%rsp), %rcx
subq 0x40(%rsp), %rcx
cmpq %rcx, %rax
jae 0x2221db
movq 0xa0(%rsp), %rax
shrq %rax
movq %rax, 0x20(%rsp)
jmp 0x2221ed
movq 0xa0(%rsp), %rax
subq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x90(%rsp)
je 0x222330
movq $0x0, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
cmpl $0xff, 0x2c(%rsp)
ja 0x22229d
movq 0x58(%rsp), %rdi
movl 0x2c(%rsp), %eax
movzbl %al, %esi
callq 0x224130
cmpl $0x0, %eax
je 0x22228b
movq 0x58(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rdi
movl 0x2c(%rsp), %eax
movzbl %al, %esi
callq 0x2241b0
movq 0x18(%rsp), %rdi
movq 0x98(%rsp), %rcx
xorl %edx, %edx
movzbl %al, %esi
callq 0x22b530
cmpl $0x0, %eax
jne 0x22228b
movq 0x90(%rsp), %rax
movq (%rax), %rax
movl 0x2c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
addq 0x30(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x22228d
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x222217
movq 0x38(%rsp), %rax
cmpq 0x30(%rsp), %rax
jae 0x2222ea
movq 0x38(%rsp), %rax
movq 0xa0(%rsp), %rcx
subq 0x30(%rsp), %rcx
cmpq %rcx, %rax
jae 0x2222cc
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x2222de
movq 0xa0(%rsp), %rax
subq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x222326
movq 0x30(%rsp), %rax
movq 0xa0(%rsp), %rcx
subq 0x30(%rsp), %rcx
cmpq %rcx, %rax
jae 0x22230c
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
jmp 0x22231d
movq 0xa0(%rsp), %rax
subq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x22234d
movq 0x60(%rsp), %rax
movq $0x0, 0x8(%rax)
jmp 0x2223a8
movq 0x60(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0x4c(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0x44(%rax)
movq 0x60(%rsp), %rax
movq $0x0, 0x60(%rax)
movq 0x60(%rsp), %rax
movq $0x0, 0x70(%rax)
movq 0x60(%rsp), %rax
movq $0x0, 0x78(%rax)
movq 0x60(%rsp), %rax
movq $0x0, 0x68(%rax)
movq 0xc0(%rsp), %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x80(%rax)
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)