// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/bitpackstringop32.c
// Function: gt_bsGetNonUniformUInt32Array
void
gt_bsGetNonUniformUInt32Array(
  constBitString str, BitOffset offset, size_t numValues,
  BitOffset numBitsTotal, unsigned numBitsList[], uint32_t val[])
{
  /* idea: read as much as possible from str in each iteration,
   * accumulate if bitsLeft < numBits */
  size_t j = 0;
  BitOffset totalBitsLeft = numBitsTotal;
  size_t elemStart = offset/bitElemBits;
  unsigned bitTop = offset%bitElemBits,
    bitsRead = 0; /*< how many bits in current *p are read */
  const BitElem *p = str + elemStart;
  unsigned bitsInAccum = 0;
  GtUword accum = 0;
  gt_assert(str && val);
  /* user requested zero values, ugly but must be handled, since legal */
  if (!totalBitsLeft)
  {
    return;
  }
  /* get bits of first element if not aligned */
  if (bitTop)
  {
    GtUword mask; /*< all of the bits we want to get from *p */
    unsigned bits2Read = GT_MIN(bitElemBits - bitTop, totalBitsLeft);
    unsigned unreadRightBits = (bitElemBits - bitTop - bits2Read);
    mask = (~((~(GtUword)0) << bits2Read)) << unreadRightBits;
    accum = ((*p++) & mask) >> unreadRightBits;
    bitsInAccum += bits2Read;
    totalBitsLeft -= bits2Read;
  }
  while (j < numValues)
  {
    while (bitsInAccum < numBitsList[j] && totalBitsLeft)
    {
      unsigned bits2Read, bitsFree = sizeof (accum)*CHAR_BIT - bitsInAccum;
      GtUword mask;
      bits2Read = GT_MIN3(bitsFree, bitElemBits - bitsRead, totalBitsLeft);
      mask = (~((~(GtUword)0) << bits2Read));
      accum = accum << bits2Read | (((*p) >> (bitElemBits
                                              - bits2Read - bitsRead)) & mask);
      bitsInAccum += bits2Read;
      totalBitsLeft -= bits2Read;
      /* all of *p consumed? */
      if ((bitsRead += bits2Read) == bitElemBits)
      {
        ++p, bitsRead = 0;
      }
    }
    {
      unsigned numBits;
      /* now we have enough bits in accum */
      while (j < numValues && bitsInAccum >= (numBits = numBitsList[j]))
      {
        GtUword valMask;
        gt_assert(numBits <= sizeof (val[0])*CHAR_BIT);
        valMask = ~(GtUword)0;
        if (numBits < (sizeof (val[0])*CHAR_BIT))
          valMask = ~(valMask << numBits);
        val[j++] = ((accum >> (bitsInAccum - numBits)) & valMask );
        bitsInAccum -= numBits;
      }
    }
  }
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xc0(%rsp)
movq %rsi, 0xb8(%rsp)
movq %rdx, 0xb0(%rsp)
movq %rcx, 0xa8(%rsp)
movq %r8, 0xa0(%rsp)
movq %r9, 0x98(%rsp)
movq $0x0, 0x90(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0xb8(%rsp), %rax
shrq $0x3, %rax
movq %rax, 0x80(%rsp)
movq 0xb8(%rsp), %rax
andq $0x7, %rax
movl %eax, 0x7c(%rsp)
movl $0x0, 0x78(%rsp)
movq 0xc0(%rsp), %rax
addq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movl $0x0, 0x6c(%rsp)
movq $0x0, 0x60(%rsp)
cmpq $0x0, 0xc0(%rsp)
je 0x15752b
cmpq $0x0, 0x98(%rsp)
jne 0x157563
movq 0x5caa6(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x6b2a(%rip), %rsi      # 0x15e066
leaq 0x379a4(%rip), %rdx     # 0x18eee7
leaq 0x379e7(%rip), %rcx     # 0x18ef31
leaq 0x37916(%rip), %r8      # 0x18ee67
movl $0xeb, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x157565
cmpq $0x0, 0x88(%rsp)
jne 0x157575
jmp 0x1578d5
cmpl $0x0, 0x7c(%rsp)
je 0x157638
movl $0x8, %eax
subl 0x7c(%rsp), %eax
movl %eax, %eax
cmpq 0x88(%rsp), %rax
jae 0x1575a7
movl $0x8, %eax
subl 0x7c(%rsp), %eax
movl %eax, %eax
movq %rax, 0x28(%rsp)
jmp 0x1575b4
movq 0x88(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movl %eax, 0x54(%rsp)
movl $0x8, %eax
subl 0x7c(%rsp), %eax
subl 0x54(%rsp), %eax
movl %eax, 0x50(%rsp)
movl 0x54(%rsp), %eax
movl %eax, %ecx
movq $-0x1, %rax
shlq %cl, %rax
xorq $-0x1, %rax
movl 0x50(%rsp), %ecx
shlq %cl, %rax
movq %rax, 0x58(%rsp)
movq 0x70(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x70(%rsp)
movzbl (%rax), %eax
andq 0x58(%rsp), %rax
movl 0x50(%rsp), %ecx
shrq %cl, %rax
movq %rax, 0x60(%rsp)
movl 0x54(%rsp), %eax
addl 0x6c(%rsp), %eax
movl %eax, 0x6c(%rsp)
movl 0x54(%rsp), %eax
movl %eax, %ecx
movq 0x88(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x88(%rsp)
jmp 0x15763a
movq 0x90(%rsp), %rax
cmpq 0xb0(%rsp), %rax
jae 0x1578d5
jmp 0x157652
movl 0x6c(%rsp), %ecx
movq 0xa0(%rsp), %rdx
movq 0x90(%rsp), %rsi
xorl %eax, %eax
cmpl (%rdx,%rsi,4), %ecx
movb %al, 0x27(%rsp)
jae 0x157681
cmpq $0x0, 0x88(%rsp)
setne %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x15768e
jmp 0x1577c9
movl 0x6c(%rsp), %eax
movl %eax, %ecx
movl $0x40, %eax
subq %rcx, %rax
movl %eax, 0x48(%rsp)
movl 0x48(%rsp), %eax
movl $0x8, %ecx
subl 0x78(%rsp), %ecx
cmpl %ecx, %eax
jae 0x1576e3
movl 0x48(%rsp), %eax
cmpq 0x88(%rsp), %rax
jae 0x1576ca
movl 0x48(%rsp), %eax
movq %rax, 0x18(%rsp)
jmp 0x1576d7
movq 0x88(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x157721
movl $0x8, %eax
subl 0x78(%rsp), %eax
movl %eax, %eax
cmpq 0x88(%rsp), %rax
jae 0x15770a
movl $0x8, %eax
subl 0x78(%rsp), %eax
movl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x157717
movq 0x88(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movl %eax, 0x4c(%rsp)
movl 0x4c(%rsp), %eax
movl %eax, %ecx
movq $-0x1, %rax
shlq %cl, %rax
xorq $-0x1, %rax
movq %rax, 0x40(%rsp)
movq 0x60(%rsp), %rax
movl 0x4c(%rsp), %ecx
shlq %cl, %rax
movq 0x70(%rsp), %rcx
movzbl (%rcx), %edx
movl $0x8, %ecx
subl 0x4c(%rsp), %ecx
subl 0x78(%rsp), %ecx
sarl %cl, %edx
movl %edx, %ecx
movslq %ecx, %rcx
andq 0x40(%rsp), %rcx
orq %rcx, %rax
movq %rax, 0x60(%rsp)
movl 0x4c(%rsp), %eax
addl 0x6c(%rsp), %eax
movl %eax, 0x6c(%rsp)
movl 0x4c(%rsp), %eax
movl %eax, %ecx
movq 0x88(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x88(%rsp)
movl 0x4c(%rsp), %eax
addl 0x78(%rsp), %eax
movl %eax, 0x78(%rsp)
cmpl $0x8, %eax
jne 0x1577c4
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
movl $0x0, 0x78(%rsp)
jmp 0x157652
jmp 0x1577cb
movq 0x90(%rsp), %rcx
xorl %eax, %eax
cmpq 0xb0(%rsp), %rcx
movb %al, 0x7(%rsp)
jae 0x157807
movl 0x6c(%rsp), %eax
movq 0xa0(%rsp), %rcx
movq 0x90(%rsp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, 0x3c(%rsp)
cmpl %ecx, %eax
setae %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x157814
jmp 0x1578d0
jmp 0x157816
movl 0x3c(%rsp), %eax
cmpq $0x20, %rax
jbe 0x157858
movq 0x5c7b1(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x6835(%rip), %rsi      # 0x15e066
leaq 0x376d5(%rip), %rdx     # 0x18ef0d
leaq 0x376f2(%rip), %rcx     # 0x18ef31
leaq 0x37621(%rip), %r8      # 0x18ee67
movl $0x114, %r9d            # imm = 0x114
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x15785a
movq $-0x1, 0x30(%rsp)
movl 0x3c(%rsp), %eax
cmpq $0x20, %rax
jae 0x157882
movq 0x30(%rsp), %rax
movl 0x3c(%rsp), %ecx
shlq %cl, %rax
xorq $-0x1, %rax
movq %rax, 0x30(%rsp)
movq 0x60(%rsp), %rax
movl 0x6c(%rsp), %ecx
subl 0x3c(%rsp), %ecx
movl %ecx, %ecx
shrq %cl, %rax
andq 0x30(%rsp), %rax
movl %eax, %edx
movq 0x98(%rsp), %rax
movq 0x90(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x90(%rsp)
movl %edx, (%rax,%rcx,4)
movl 0x3c(%rsp), %ecx
movl 0x6c(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x6c(%rsp)
jmp 0x1577cb
jmp 0x15763a
addq $0xc8, %rsp
retq
nopl (%rax)