// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/bitpackstringop.c
// Function: gt_bsCompare
int gt_bsCompare(constBitString a, BitOffset offsetA, BitOffset numBitsA,
                 constBitString b, BitOffset offsetB, BitOffset numBitsB)
{
  BitOffset totalBitsLeftA = numBitsA, totalBitsLeftB = numBitsB;
  size_t elemStartA = offsetA/bitElemBits, elemStartB = offsetB/bitElemBits;
  unsigned bitTopA = offsetA%bitElemBits, bitTopB = offsetB%bitElemBits;
  const BitElem *pA = a + elemStartA, *pB = b + elemStartB;
  GtUword accumA = 0, accumB = 0;
  unsigned bitsInAccumA, bitsInAccumB;
  gt_assert(a && b);
  /* user requested zero length comparison, treat as equality */
  if (!numBitsA && !numBitsB)
  {
    return 0;
  }
  if (numBitsA > numBitsB)
    return -1 * gt_bsCompare(b, offsetB, numBitsB, a, offsetA, numBitsA);
  if (numBitsB > numBitsA)
  {
    /* B is longer and thus compared with virtual zeros prepended to A */
    unsigned comparePreBits = numBitsB - numBitsA;
    do {
      bitsInAccumB = 0;
      if (bitTopB)
      {
        GtUword mask; /*< all of the bits we want to get from *pB */
        unsigned bits2Read = GT_MIN(bitElemBits - bitTopB, comparePreBits);
        unsigned unreadRightBits = (bitElemBits - bitTopB - bits2Read);
        mask = (~((~(GtUword)0) << bits2Read)) << unreadRightBits;
        accumB = ((*pB++) & mask) >> unreadRightBits;
        bitsInAccumB += bits2Read;
        totalBitsLeftB -= bits2Read;
        comparePreBits -= bits2Read;
      }
      while (bitsInAccumB < CHAR_BIT * sizeof (accumB) && comparePreBits)
      {
        unsigned bits2Read,
          bitsFree = (CHAR_BIT * sizeof (accumA)) - bitsInAccumB;
        GtUword mask;
        bits2Read = GT_MIN3(bitsFree, bitElemBits, comparePreBits);
        mask = ~((~(GtUword)0) << bits2Read);
        accumB = accumB << bits2Read
          | (((*pB) >> (bitElemBits - bits2Read)) & mask);
        bitsInAccumB += bits2Read;
        totalBitsLeftB -= bits2Read;
        comparePreBits -= bits2Read;
        /* all of *pB consumed? */
        if (bits2Read == bitElemBits)
          ++pB, bitTopB = 0;
        else
          bitTopB = bits2Read;
      }
    } while (accumB == 0 && comparePreBits);
    if (accumB > 0)
      return -1;
  }
  do {
    bitsInAccumB = bitsInAccumA = 0;
    /* get bits of first element if not aligned */
    if (bitTopA)
    {
      GtUword mask; /*< all of the bits we want to get from *pA */
      unsigned bits2Read = GT_MIN(bitElemBits - bitTopA, totalBitsLeftA);
      unsigned unreadRightBits = (bitElemBits - bitTopA - bits2Read);
      mask = (~((~(GtUword)0) << bits2Read)) << unreadRightBits;
      accumA = ((*pA++) & mask) >> unreadRightBits;
      bitsInAccumA += bits2Read;
      totalBitsLeftA -= bits2Read;
    }
    else
      accumA = 0;
    /* get bits of first element if not aligned */
    if (bitTopB)
    {
      GtUword mask; /*< all of the bits we want to get from *pB */
      unsigned bits2Read = GT_MIN(bitElemBits - bitTopB, totalBitsLeftB);
      unsigned unreadRightBits = (bitElemBits - bitTopB - bits2Read);
      mask = (~((~(GtUword)0) << bits2Read)) << unreadRightBits;
      accumB = ((*pB++) & mask) >> unreadRightBits;
      bitsInAccumB += bits2Read;
      totalBitsLeftB -= bits2Read;
    }
    else
      accumB = 0;
    while (bitsInAccumA < (CHAR_BIT * sizeof (accumA)) && totalBitsLeftA)
    {
      unsigned bits2Read,
               bitsFree = (CHAR_BIT * sizeof (accumA)) - bitsInAccumA;
      GtUword mask;
      bits2Read = GT_MIN3(bitsFree, bitElemBits, totalBitsLeftA);
      mask = (~((~(GtUword)0) << bits2Read));
      accumA = accumA << bits2Read
        | (((*pA) >> (bitElemBits - bits2Read)) & mask);
      bitsInAccumA += bits2Read;
      totalBitsLeftA -= bits2Read;
      /* all of *pA consumed? */
      if (bits2Read == bitElemBits)
        ++pA, bitTopA = 0;
      else
        bitTopA = bits2Read;
    }
    while (bitsInAccumB < (CHAR_BIT * sizeof (accumA)) && totalBitsLeftB)
    {
      unsigned bits2Read,
        bitsFree = (CHAR_BIT * sizeof (accumA)) - bitsInAccumB;
      GtUword mask;
      bits2Read = GT_MIN3(bitsFree, bitElemBits, totalBitsLeftB);
      mask = (~((~(GtUword)0) << bits2Read));
      accumB = accumB << bits2Read
        | (((*pB) >> (bitElemBits - bits2Read)) & mask);
      bitsInAccumB += bits2Read;
      totalBitsLeftB -= bits2Read;
      /* all of *pB consumed? */
      if (bits2Read == bitElemBits)
        ++pB, bitTopB = 0;
      else
        bitTopB = bits2Read;
    }
  } while (accumA == accumB && totalBitsLeftA);
  return accumA > accumB?1:(accumA < accumB?-1:0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x28ac61
testq %rcx, %rcx
je 0x28ac61
movq %rdx, %rax
movq %r9, %rdx
orq %rax, %rdx
je 0x28aa08
movq %rsi, %r10
movq %rdi, %r11
movq %rsi, %rbx
shrq $0x3, %rbx
movq %r8, %r14
shrq $0x3, %r14
movl %r10d, %edx
andl $0x7, %edx
movl %r8d, %esi
andl $0x7, %esi
addq %rdi, %rbx
addq %rcx, %r14
cmpq %rax, %r9
jae 0x28aa0f
movq %rcx, %rdi
movq %r8, %rsi
movq %r9, %rdx
movq %r11, %rcx
movq %r10, %r8
movq %rax, %r9
callq 0x28a997
negl %eax
jmp 0x28ac52
xorl %eax, %eax
jmp 0x28ac52
pushq $-0x1
popq %r11
jbe 0x28aaea
movl %r9d, %r10d
subl %eax, %r10d
xorl %r15d, %r15d
testl %esi, %esi
je 0x28aa63
pushq $0x8
popq %r8
subl %esi, %r8d
cmpl %r10d, %r8d
movl %r10d, %edi
cmovbl %r8d, %edi
subl %edi, %r8d
movq %r11, %r12
movl %edi, %ecx
shlq %cl, %r12
notl %r12d
movl %r8d, %ecx
shlq %cl, %r12
movzbl (%r14), %ecx
andl %ecx, %r12d
movl %r8d, %ecx
shrq %cl, %r12
incq %r14
subq %rdi, %r9
subl %edi, %r10d
jmp 0x28aa68
xorl %edi, %edi
xorl %r12d, %r12d
cmpl $0x3f, %edi
ja 0x28aacf
testl %r10d, %r10d
je 0x28aacf
cmpl $0x39, %edi
jb 0x28aa87
pushq $0x40
popq %rcx
movl %ecx, %esi
subl %edi, %esi
cmpl %r10d, %esi
cmovael %r10d, %esi
jmp 0x28aa94
cmpl $0x8, %r10d
pushq $0x8
popq %rcx
movl %ecx, %esi
cmovbl %r10d, %esi
movq %r11, %r8
movl %esi, %ecx
shlq %cl, %r8
shlq %cl, %r12
movl %esi, %r13d
movzbl (%r14), %ebp
movb $0x8, %cl
subb %sil, %cl
shrl %cl, %ebp
notl %r8d
andl %r8d, %ebp
orq %rbp, %r12
addl %esi, %edi
subq %r13, %r9
subl %esi, %r10d
xorl %ecx, %ecx
cmpl $0x8, %esi
sete %cl
cmovel %r15d, %esi
addq %rcx, %r14
jmp 0x28aa68
testq %r12, %r12
jne 0x28aadd
testl %r10d, %r10d
jne 0x28aa22
testq %r12, %r12
je 0x28aaea
pushq $-0x1
popq %rax
jmp 0x28ac52
xorl %r12d, %r12d
testl %edx, %edx
je 0x28ab29
pushq $0x8
popq %rcx
movl %ecx, %edi
subl %edx, %edi
cmpq %rdi, %rax
movq %rdi, %r8
cmovbq %rax, %r8
subl %r8d, %edi
movq %r11, %r15
movl %r8d, %ecx
shlq %cl, %r15
notl %r15d
movl %edi, %ecx
shlq %cl, %r15
movzbl (%rbx), %ecx
incq %rbx
andl %ecx, %r15d
movl %edi, %ecx
shrq %cl, %r15
subq %r8, %rax
jmp 0x28ab2f
xorl %r8d, %r8d
xorl %r15d, %r15d
testl %esi, %esi
je 0x28ab6d
pushq $0x8
popq %rcx
movl %ecx, %r10d
subl %esi, %r10d
cmpq %r10, %r9
movq %r10, %rdi
cmovbq %r9, %rdi
subl %edi, %r10d
movq %r11, %rbp
movl %edi, %ecx
shlq %cl, %rbp
notl %ebp
movl %r10d, %ecx
shlq %cl, %rbp
movzbl (%r14), %ecx
incq %r14
andl %ecx, %ebp
movl %r10d, %ecx
shrq %cl, %rbp
subq %rdi, %r9
jmp 0x28ab71
xorl %edi, %edi
xorl %ebp, %ebp
cmpl $0x3f, %r8d
ja 0x28ac2a
testq %rax, %rax
je 0x28ac2a
cmpl $0x39, %r8d
jb 0x28ab97
pushq $0x40
popq %rcx
movl %ecx, %edx
subl %r8d, %edx
cmpq %rdx, %rax
jmp 0x28ab9e
cmpq $0x8, %rax
pushq $0x8
popq %rdx
cmovbq %rax, %rdx
movq %r11, %r10
movl %edx, %ecx
shlq %cl, %r10
shlq %cl, %r15
movzbl (%rbx), %r13d
movb $0x8, %cl
subb %dl, %cl
shrl %cl, %r13d
notl %r10d
andl %r10d, %r13d
orq %r13, %r15
addl %edx, %r8d
subq %rdx, %rax
xorl %ecx, %ecx
cmpq $0x8, %rdx
sete %cl
cmovel %r12d, %edx
addq %rcx, %rbx
jmp 0x28ab71
cmpl $0x39, %edi
jb 0x28abea
pushq $0x40
popq %rcx
movl %ecx, %esi
subl %edi, %esi
cmpq %rsi, %r9
jmp 0x28abf1
cmpq $0x8, %r9
pushq $0x8
popq %rsi
cmovbq %r9, %rsi
movq %r11, %r8
movl %esi, %ecx
shlq %cl, %r8
shlq %cl, %rbp
movzbl (%r14), %r10d
movb $0x8, %cl
subb %sil, %cl
shrl %cl, %r10d
notl %r8d
andl %r8d, %r10d
orq %r10, %rbp
addl %esi, %edi
subq %rsi, %r9
xorl %ecx, %ecx
cmpq $0x8, %rsi
sete %cl
cmovel %r12d, %esi
addq %rcx, %r14
cmpl $0x3f, %edi
ja 0x28ac34
testq %r9, %r9
jne 0x28abd9
cmpq %rbp, %r15
jne 0x28ac42
testq %rax, %rax
jne 0x28aaed
xorl %ecx, %ecx
cmpq %rbp, %r15
sbbl %ecx, %ecx
cmpq %rbp, %r15
pushq $0x1
popq %rax
cmovbel %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1ad300(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x5a3a1(%rip), %rsi     # 0x2e5013
leaq 0x73385(%rip), %rdx     # 0x2fdffe
leaq 0xf0000(%rip), %rcx     # 0x37ac80
leaq 0xf0006(%rip), %r8      # 0x37ac8d
pushq $0x73
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390