// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x168, %rsp            # imm = 0x168
movq %rdi, 0x158(%rsp)
movq %rsi, 0x150(%rsp)
movq %rdx, 0x148(%rsp)
movq %rcx, 0x140(%rsp)
movq %r8, 0x138(%rsp)
movq %r9, 0x130(%rsp)
movq 0x148(%rsp), %rax
movq %rax, 0x128(%rsp)
movq 0x130(%rsp), %rax
movq %rax, 0x120(%rsp)
movq 0x150(%rsp), %rax
shrq $0x3, %rax
movq %rax, 0x118(%rsp)
movq 0x138(%rsp), %rax
shrq $0x3, %rax
movq %rax, 0x110(%rsp)
movq 0x150(%rsp), %rax
andq $0x7, %rax
movl %eax, 0x10c(%rsp)
movq 0x138(%rsp), %rax
andq $0x7, %rax
movl %eax, 0x108(%rsp)
movq 0x158(%rsp), %rax
addq 0x118(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x140(%rsp), %rax
addq 0x110(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq $0x0, 0xf0(%rsp)
movq $0x0, 0xe8(%rsp)
cmpq $0x0, 0x158(%rsp)
je 0x46ee33
cmpq $0x0, 0x140(%rsp)
jne 0x46ee6b
movq 0x1cd166(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0xa71cf(%rip), %rsi     # 0x516013
leaq 0xc03bb(%rip), %rdx     # 0x52f206
leaq 0x140e1e(%rip), %rcx    # 0x5afc70
leaq 0x140e24(%rip), %r8     # 0x5afc7d
movl $0x73, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x46ee6d
cmpq $0x0, 0x148(%rsp)
jne 0x46ee93
cmpq $0x0, 0x130(%rsp)
jne 0x46ee93
movl $0x0, 0x164(%rsp)
jmp 0x46f7fe
movq 0x148(%rsp), %rax
cmpq 0x130(%rsp), %rax
jbe 0x46eeec
movq 0x140(%rsp), %rdi
movq 0x138(%rsp), %rsi
movq 0x130(%rsp), %rdx
movq 0x158(%rsp), %rcx
movq 0x150(%rsp), %r8
movq 0x148(%rsp), %r9
callq 0x46ed30
imull $0xffffffff, %eax, %eax # imm = 0xFFFFFFFF
movl %eax, 0x164(%rsp)
jmp 0x46f7fe
movq 0x130(%rsp), %rax
cmpq 0x148(%rsp), %rax
jbe 0x46f21f
movq 0x130(%rsp), %rax
subq 0x148(%rsp), %rax
movl %eax, 0xdc(%rsp)
movl $0x0, 0xe0(%rsp)
cmpl $0x0, 0x108(%rsp)
je 0x46f02e
movl $0x8, %eax
subl 0x108(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jae 0x46ef59
movl $0x8, %eax
subl 0x108(%rsp), %eax
movl %eax, 0x74(%rsp)
jmp 0x46ef64
movl 0xdc(%rsp), %eax
movl %eax, 0x74(%rsp)
movl 0x74(%rsp), %eax
movl %eax, 0xcc(%rsp)
movl $0x8, %eax
subl 0x108(%rsp), %eax
subl 0xcc(%rsp), %eax
movl %eax, 0xc8(%rsp)
movl 0xcc(%rsp), %eax
movl %eax, %ecx
movq $-0x1, %rax
shlq %cl, %rax
xorq $-0x1, %rax
movl 0xc8(%rsp), %ecx
shlq %cl, %rax
movq %rax, 0xd0(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0xf8(%rsp)
movzbl (%rax), %eax
andq 0xd0(%rsp), %rax
movl 0xc8(%rsp), %ecx
shrq %cl, %rax
movq %rax, 0xe8(%rsp)
movl 0xcc(%rsp), %eax
addl 0xe0(%rsp), %eax
movl %eax, 0xe0(%rsp)
movl 0xcc(%rsp), %eax
movl %eax, %ecx
movq 0x120(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x120(%rsp)
movl 0xcc(%rsp), %ecx
movl 0xdc(%rsp), %eax
subl %ecx, %eax
movl %eax, 0xdc(%rsp)
jmp 0x46f030
movl 0xe0(%rsp), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq $0x40, %rcx
movb %al, 0x73(%rsp)
jae 0x46f054
cmpl $0x0, 0xdc(%rsp)
setne %al
movb %al, 0x73(%rsp)
movb 0x73(%rsp), %al
testb $0x1, %al
jne 0x46f061
jmp 0x46f1d4
movl 0xe0(%rsp), %eax
movl %eax, %ecx
movl $0x40, %eax
subq %rcx, %rax
movl %eax, 0xc0(%rsp)
cmpl $0x8, 0xc0(%rsp)
jae 0x46f0b5
movl 0xc0(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jae 0x46f0a0
movl 0xc0(%rsp), %eax
movl %eax, 0x6c(%rsp)
jmp 0x46f0ab
movl 0xdc(%rsp), %eax
movl %eax, 0x6c(%rsp)
movl 0x6c(%rsp), %eax
movl %eax, 0x68(%rsp)
jmp 0x46f0e1
movl $0x8, %eax
cmpl 0xdc(%rsp), %eax
jae 0x46f0ce
movl $0x8, %eax
movl %eax, 0x64(%rsp)
jmp 0x46f0d9
movl 0xdc(%rsp), %eax
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
movl %eax, 0x68(%rsp)
movl 0x68(%rsp), %eax
movl %eax, 0xc4(%rsp)
movl 0xc4(%rsp), %eax
movl %eax, %ecx
movq $-0x1, %rax
shlq %cl, %rax
xorq $-0x1, %rax
movq %rax, 0xb8(%rsp)
movq 0xe8(%rsp), %rax
movl 0xc4(%rsp), %ecx
shlq %cl, %rax
movq 0xf8(%rsp), %rcx
movzbl (%rcx), %edx
movl $0x8, %ecx
subl 0xc4(%rsp), %ecx
sarl %cl, %edx
movl %edx, %ecx
movslq %ecx, %rcx
andq 0xb8(%rsp), %rcx
orq %rcx, %rax
movq %rax, 0xe8(%rsp)
movl 0xc4(%rsp), %eax
addl 0xe0(%rsp), %eax
movl %eax, 0xe0(%rsp)
movl 0xc4(%rsp), %eax
movl %eax, %ecx
movq 0x120(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x120(%rsp)
movl 0xc4(%rsp), %ecx
movl 0xdc(%rsp), %eax
subl %ecx, %eax
movl %eax, 0xdc(%rsp)
cmpl $0x8, 0xc4(%rsp)
jne 0x46f1c1
movq 0xf8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xf8(%rsp)
movl $0x0, 0x108(%rsp)
jmp 0x46f1cf
movl 0xc4(%rsp), %eax
movl %eax, 0x108(%rsp)
jmp 0x46f030
jmp 0x46f1d6
xorl %eax, %eax
cmpq $0x0, 0xe8(%rsp)
movb %al, 0x63(%rsp)
jne 0x46f1f6
cmpl $0x0, 0xdc(%rsp)
setne %al
movb %al, 0x63(%rsp)
movb 0x63(%rsp), %al
testb $0x1, %al
jne 0x46ef19
cmpq $0x0, 0xe8(%rsp)
jbe 0x46f21d
movl $0xffffffff, 0x164(%rsp) # imm = 0xFFFFFFFF
jmp 0x46f7fe
jmp 0x46f21f
jmp 0x46f221
movl $0x0, 0xe4(%rsp)
movl $0x0, 0xe0(%rsp)
cmpl $0x0, 0x10c(%rsp)
je 0x46f335
movl $0x8, %eax
subl 0x10c(%rsp), %eax
movl %eax, %eax
cmpq 0x128(%rsp), %rax
jae 0x46f272
movl $0x8, %eax
subl 0x10c(%rsp), %eax
movl %eax, %eax
movq %rax, 0x58(%rsp)
jmp 0x46f27f
movq 0x128(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movl %eax, 0xac(%rsp)
movl $0x8, %eax
subl 0x10c(%rsp), %eax
subl 0xac(%rsp), %eax
movl %eax, 0xa8(%rsp)
movl 0xac(%rsp), %eax
movl %eax, %ecx
movq $-0x1, %rax
shlq %cl, %rax
xorq $-0x1, %rax
movl 0xa8(%rsp), %ecx
shlq %cl, %rax
movq %rax, 0xb0(%rsp)
movq 0x100(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x100(%rsp)
movzbl (%rax), %eax
andq 0xb0(%rsp), %rax
movl 0xa8(%rsp), %ecx
shrq %cl, %rax
movq %rax, 0xf0(%rsp)
movl 0xac(%rsp), %eax
addl 0xe4(%rsp), %eax
movl %eax, 0xe4(%rsp)
movl 0xac(%rsp), %eax
movl %eax, %ecx
movq 0x128(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x128(%rsp)
jmp 0x46f341
movq $0x0, 0xf0(%rsp)
cmpl $0x0, 0x108(%rsp)
je 0x46f43f
movl $0x8, %eax
subl 0x108(%rsp), %eax
movl %eax, %eax
cmpq 0x120(%rsp), %rax
jae 0x46f37c
movl $0x8, %eax
subl 0x108(%rsp), %eax
movl %eax, %eax
movq %rax, 0x50(%rsp)
jmp 0x46f389
movq 0x120(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movl %eax, 0x9c(%rsp)
movl $0x8, %eax
subl 0x108(%rsp), %eax
subl 0x9c(%rsp), %eax
movl %eax, 0x98(%rsp)
movl 0x9c(%rsp), %eax
movl %eax, %ecx
movq $-0x1, %rax
shlq %cl, %rax
xorq $-0x1, %rax
movl 0x98(%rsp), %ecx
shlq %cl, %rax
movq %rax, 0xa0(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0xf8(%rsp)
movzbl (%rax), %eax
andq 0xa0(%rsp), %rax
movl 0x98(%rsp), %ecx
shrq %cl, %rax
movq %rax, 0xe8(%rsp)
movl 0x9c(%rsp), %eax
addl 0xe0(%rsp), %eax
movl %eax, 0xe0(%rsp)
movl 0x9c(%rsp), %eax
movl %eax, %ecx
movq 0x120(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x120(%rsp)
jmp 0x46f44b
movq $0x0, 0xe8(%rsp)
jmp 0x46f44d
movl 0xe4(%rsp), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq $0x40, %rcx
movb %al, 0x4f(%rsp)
jae 0x46f472
cmpq $0x0, 0x128(%rsp)
setne %al
movb %al, 0x4f(%rsp)
movb 0x4f(%rsp), %al
testb $0x1, %al
jne 0x46f47f
jmp 0x46f5e8
movl 0xe4(%rsp), %eax
movl %eax, %ecx
movl $0x40, %eax
subq %rcx, %rax
movl %eax, 0x90(%rsp)
cmpl $0x8, 0x90(%rsp)
jae 0x46f4d9
movl 0x90(%rsp), %eax
cmpq 0x128(%rsp), %rax
jae 0x46f4c0
movl 0x90(%rsp), %eax
movq %rax, 0x40(%rsp)
jmp 0x46f4cd
movq 0x128(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x38(%rsp)
jmp 0x46f50b
movl $0x8, %eax
cmpq 0x128(%rsp), %rax
jae 0x46f4f4
movl $0x8, %eax
movq %rax, 0x30(%rsp)
jmp 0x46f501
movq 0x128(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movl %eax, 0x94(%rsp)
movl 0x94(%rsp), %eax
movl %eax, %ecx
movq $-0x1, %rax
shlq %cl, %rax
xorq $-0x1, %rax
movq %rax, 0x88(%rsp)
movq 0xf0(%rsp), %rax
movl 0x94(%rsp), %ecx
shlq %cl, %rax
movq 0x100(%rsp), %rcx
movzbl (%rcx), %edx
movl $0x8, %ecx
subl 0x94(%rsp), %ecx
sarl %cl, %edx
movl %edx, %ecx
movslq %ecx, %rcx
andq 0x88(%rsp), %rcx
orq %rcx, %rax
movq %rax, 0xf0(%rsp)
movl 0x94(%rsp), %eax
addl 0xe4(%rsp), %eax
movl %eax, 0xe4(%rsp)
movl 0x94(%rsp), %eax
movl %eax, %ecx
movq 0x128(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x128(%rsp)
cmpl $0x8, 0x94(%rsp)
jne 0x46f5d5
movq 0x100(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x100(%rsp)
movl $0x0, 0x10c(%rsp)
jmp 0x46f5e3
movl 0x94(%rsp), %eax
movl %eax, 0x10c(%rsp)
jmp 0x46f44d
jmp 0x46f5ea
movl 0xe0(%rsp), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq $0x40, %rcx
movb %al, 0x2f(%rsp)
jae 0x46f60f
cmpq $0x0, 0x120(%rsp)
setne %al
movb %al, 0x2f(%rsp)
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0x46f61c
jmp 0x46f77f
movl 0xe0(%rsp), %eax
movl %eax, %ecx
movl $0x40, %eax
subq %rcx, %rax
movl %eax, 0x80(%rsp)
cmpl $0x8, 0x80(%rsp)
jae 0x46f676
movl 0x80(%rsp), %eax
cmpq 0x120(%rsp), %rax
jae 0x46f65d
movl 0x80(%rsp), %eax
movq %rax, 0x20(%rsp)
jmp 0x46f66a
movq 0x120(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x46f6a8
movl $0x8, %eax
cmpq 0x120(%rsp), %rax
jae 0x46f691
movl $0x8, %eax
movq %rax, 0x10(%rsp)
jmp 0x46f69e
movq 0x120(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movl %eax, 0x84(%rsp)
movl 0x84(%rsp), %eax
movl %eax, %ecx
movq $-0x1, %rax
shlq %cl, %rax
xorq $-0x1, %rax
movq %rax, 0x78(%rsp)
movq 0xe8(%rsp), %rax
movl 0x84(%rsp), %ecx
shlq %cl, %rax
movq 0xf8(%rsp), %rcx
movzbl (%rcx), %edx
movl $0x8, %ecx
subl 0x84(%rsp), %ecx
sarl %cl, %edx
movl %edx, %ecx
movslq %ecx, %rcx
andq 0x78(%rsp), %rcx
orq %rcx, %rax
movq %rax, 0xe8(%rsp)
movl 0x84(%rsp), %eax
addl 0xe0(%rsp), %eax
movl %eax, 0xe0(%rsp)
movl 0x84(%rsp), %eax
movl %eax, %ecx
movq 0x120(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x120(%rsp)
cmpl $0x8, 0x84(%rsp)
jne 0x46f76c
movq 0xf8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xf8(%rsp)
movl $0x0, 0x108(%rsp)
jmp 0x46f77a
movl 0x84(%rsp), %eax
movl %eax, 0x108(%rsp)
jmp 0x46f5ea
jmp 0x46f781
movq 0xf0(%rsp), %rcx
xorl %eax, %eax
cmpq 0xe8(%rsp), %rcx
movb %al, 0xf(%rsp)
jne 0x46f7a9
cmpq $0x0, 0x128(%rsp)
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x46f221
movq 0xf0(%rsp), %rax
cmpq 0xe8(%rsp), %rax
jbe 0x46f7d2
movl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x46f7f3
movq 0xf0(%rsp), %rdx
movq 0xe8(%rsp), %rsi
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rsi, %rdx
cmovbl %ecx, %eax
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x164(%rsp)
movl 0x164(%rsp), %eax
addq $0x168, %rsp            # imm = 0x168
retq
nopl (%rax)