// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/eis-bwtseq-extinfo.c
// Function: locBitsUpperBounds
static bool
locBitsUpperBounds(void *cbState, struct segmentDesc *desc,
                   size_t numSegmentDesc, struct varBitsEstimate *result)
{
  struct addLocateInfoState *state = cbState;
  gt_assert(cbState);
  if (state->featureToggles & (BWTLocateCount | BWTLocateBitmap))
  {
    unsigned maxBitsPerPos = bitsPerPosUpperBound(state);
    result->maxBitsPerPos = maxBitsPerPos;
    if (desc)
    {
      size_t i, maxSegLen = 0;
      BitOffset maxBitsTotal = 0;
      GT_UNUSED GtUword numSegmentsTotal = 0;
      unsigned bitsPerOrigRank = state->bitsPerOrigRank;
      for (i = 0; i < numSegmentDesc; ++i)
      {
        size_t len = desc[i].len;
        maxSegLen = GT_MAX(len, maxSegLen);
        if (state->featureToggles & BWTLocateCount)
          maxBitsTotal += requiredUlongBits(len) * desc[i].repeatCount;
        numSegmentsTotal += desc[i].repeatCount;
      }
      maxBitsTotal +=
        (state->seqLen / state->locateInterval + state->extraLocMarksUpperBound)
        * (((state->featureToggles & BWTLocateCount) ?
            requiredUlongBits(maxSegLen) : 0)
           + state->bitsPerOrigPos);
      if (bitsPerOrigRank)
      {
        GtUword maxRank = specialsRank(state->sprTable, state->seqLen);
        /* rank values stored */
        maxBitsTotal += maxRank * bitsPerOrigRank;
      }
      result->maxBitsPerBucket =
        /* locate marks and rank sorts */
        maxSegLen * bitsPerPosUpperBoundWithoutSegmentAggregates(state)
        /* count of locate marks */
        + ((state->featureToggles & BWTLocateCount) ?
           requiredUlongBits(maxSegLen) : 0);
      result->maxBitsTotal = maxBitsTotal;
      return true;
    }
    else
      return false;
  }
  else
  {
    result->maxBitsTotal = result->maxBitsPerBucket
      = result->maxBitsPerPos = 0;
    return false;
  }
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0x98(%rsp)
movq %rsi, 0x90(%rsp)
movq %rdx, 0x88(%rsp)
movq %rcx, 0x80(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x78(%rsp)
cmpq $0x0, 0x98(%rsp)
jne 0x222b97
movq 0x41943a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2f34a3(%rip), %rsi    # 0x516013
leaq 0x35242e(%rip), %rdx    # 0x574fa5
leaq 0x35246c(%rip), %rcx    # 0x574fea
leaq 0x35210f(%rip), %r8     # 0x574c94
movl $0xca, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x222b99
movq 0x78(%rsp), %rax
movl 0x58(%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x222e0b
movq 0x78(%rsp), %rdi
callq 0x2246d0
movl %eax, 0x74(%rsp)
movl 0x74(%rsp), %eax
movl %eax, %ecx
movq 0x80(%rsp), %rax
movq %rcx, (%rax)
cmpq $0x0, 0x90(%rsp)
je 0x222e01
movq $0x0, 0x60(%rsp)
movq $0x0, 0x58(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x78(%rsp), %rax
movl 0x4c(%rax), %eax
movl %eax, 0x4c(%rsp)
movq $0x0, 0x68(%rsp)
movq 0x68(%rsp), %rax
cmpq 0x88(%rsp), %rax
jae 0x222cd9
movq 0x90(%rsp), %rax
movq 0x68(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
cmpq 0x60(%rsp), %rax
jbe 0x222c53
movq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x222c5d
movq 0x60(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x78(%rsp), %rax
movl 0x58(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x222ca5
movq 0x40(%rsp), %rdi
callq 0x46ec80
cltq
movq 0x90(%rsp), %rcx
movq 0x68(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
imulq (%rcx), %rax
addq 0x58(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x90(%rsp), %rax
movq 0x68(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
addq 0x50(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x68(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x68(%rsp)
jmp 0x222c0b
movq 0x78(%rsp), %rax
movq (%rax), %rax
movq 0x78(%rsp), %rcx
movl 0x40(%rcx), %ecx
xorl %edx, %edx
divq %rcx
movq 0x78(%rsp), %rcx
addq 0x8(%rcx), %rax
movq %rax, 0x28(%rsp)
movq 0x78(%rsp), %rax
movl 0x58(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x222d1c
movq 0x60(%rsp), %rdi
callq 0x46ec80
movl %eax, 0x24(%rsp)
jmp 0x222d24
xorl %eax, %eax
movl %eax, 0x24(%rsp)
jmp 0x222d24
movq 0x28(%rsp), %rax
movl 0x24(%rsp), %ecx
movq 0x78(%rsp), %rdx
addl 0x44(%rdx), %ecx
movl %ecx, %ecx
imulq %rcx, %rax
addq 0x58(%rsp), %rax
movq %rax, 0x58(%rsp)
cmpl $0x0, 0x4c(%rsp)
je 0x222d7e
movq 0x78(%rsp), %rax
movq 0x50(%rax), %rdi
movq 0x78(%rsp), %rax
movq (%rax), %rsi
callq 0x221e70
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movl 0x4c(%rsp), %ecx
imulq %rcx, %rax
addq 0x58(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x78(%rsp), %rdi
callq 0x224710
movl %eax, %ecx
movq 0x10(%rsp), %rax
movl %ecx, %ecx
imulq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x78(%rsp), %rax
movl 0x58(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x222dc4
movq 0x60(%rsp), %rdi
callq 0x46ec80
movl %eax, 0xc(%rsp)
jmp 0x222dcc
xorl %eax, %eax
movl %eax, 0xc(%rsp)
jmp 0x222dcc
movq 0x18(%rsp), %rcx
movl 0xc(%rsp), %eax
cltq
addq %rax, %rcx
movq 0x80(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x58(%rsp), %rcx
movq 0x80(%rsp), %rax
movq %rcx, 0x10(%rax)
movb $0x1, 0xa7(%rsp)
jmp 0x222e42
movb $0x0, 0xa7(%rsp)
jmp 0x222e42
movq 0x80(%rsp), %rax
movq $0x0, (%rax)
movq 0x80(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x80(%rsp), %rax
movq $0x0, 0x10(%rax)
movb $0x0, 0xa7(%rsp)
movb 0xa7(%rsp), %al
andb $0x1, %al
addq $0xa8, %rsp
retq
nopw %cs:(%rax,%rax)