// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/bitpackstringop.c
// Function: gt_bsPrint
int gt_bsPrint(FILE *fp, constBitString str, BitOffset offset,
               BitOffset numBits)
{
  uint32_t accum = 0;
  unsigned bitsLeft = numBits, bitTop = offset%bitElemBits, bitsInAccum = 0;
  size_t elemStart = offset/bitElemBits;
  const BitElem *p = str + elemStart;
  char buf[sizeof (accum) * CHAR_BIT];
  int ioGtError = 0;
  gt_assert(str);
  do {
    if (bitTop)
    {
      uint32_t mask;
      unsigned bits2Read = GT_MIN(bitElemBits - bitTop, bitsLeft);
      unsigned unreadRightBits = (bitElemBits - bitTop - bits2Read);
      mask = (~((~(uint32_t)0) << bits2Read)) << unreadRightBits;
      ACCUM2FP(((*p++) & mask) >> unreadRightBits, bits2Read);
      bitsLeft -= bits2Read;
    }
    /* get bits from intervening elems */
    while (bitsLeft >= bitElemBits && !ioGtError)
    {
      while (bitsLeft >= bitElemBits
             && sizeof (accum) * CHAR_BIT - bitElemBits >= bitsInAccum)
      {
        accum = accum << bitElemBits | (*p++);
        bitsLeft -= bitElemBits;
        bitsInAccum += bitElemBits;
      }
      ACCUM2FP(accum, bitsInAccum);
      accum = 0; bitsInAccum = 0;
    }
    if (ioGtError)
      break;
    /* get bits from last elem */
    if (bitsLeft)
    {
      accum = ((*p) & ((~(uint32_t)0)<<(bitElemBits - bitsLeft)))
        >> (bitElemBits - bitsLeft);
      ACCUM2FP(accum, bitsLeft);
    }
  } while (0);
  return ioGtError?-1:0;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movl $0x0, 0x64(%rsp)
movq 0x68(%rsp), %rax
movl %eax, 0x60(%rsp)
movq 0x70(%rsp), %rax
andq $0x7, %rax
movl %eax, 0x5c(%rsp)
movl $0x0, 0x58(%rsp)
movq 0x70(%rsp), %rax
shrq $0x3, %rax
movq %rax, 0x50(%rsp)
movq 0x78(%rsp), %rax
addq 0x50(%rsp), %rax
movq %rax, 0x48(%rsp)
movl $0x0, 0x1c(%rsp)
cmpq $0x0, 0x78(%rsp)
jne 0x470af9
movq 0x1cb4d8(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0xa5541(%rip), %rsi     # 0x516013
leaq 0xd3584(%rip), %rdx     # 0x54405d
leaq 0x13f1e9(%rip), %rcx    # 0x5afcc9
leaq 0x13f196(%rip), %r8     # 0x5afc7d
movl $0x203, %r9d            # imm = 0x203
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x470afb
jmp 0x470afd
cmpl $0x0, 0x5c(%rsp)
je 0x470bbd
movl $0x8, %eax
subl 0x5c(%rsp), %eax
cmpl 0x60(%rsp), %eax
jae 0x470b26
movl $0x8, %eax
subl 0x5c(%rsp), %eax
movl %eax, 0xc(%rsp)
jmp 0x470b2e
movl 0x60(%rsp), %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x14(%rsp)
movl $0x8, %eax
subl 0x5c(%rsp), %eax
subl 0x14(%rsp), %eax
movl %eax, 0x10(%rsp)
movl 0x14(%rsp), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
shll %cl, %eax
xorl $-0x1, %eax
movl 0x10(%rsp), %ecx
shll %cl, %eax
movl %eax, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
movq 0x48(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x48(%rsp)
movzbl (%rax), %esi
andl 0x18(%rsp), %esi
movl 0x10(%rsp), %ecx
shrl %cl, %esi
movl 0x14(%rsp), %edx
callq 0x470d30
leaq 0x20(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x19810
cmpl $-0x1, %eax
jne 0x470baf
movl $0x1, 0x1c(%rsp)
jmp 0x470d08
movl 0x14(%rsp), %ecx
movl 0x60(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x60(%rsp)
jmp 0x470bbf
xorl %eax, %eax
cmpl $0x8, 0x60(%rsp)
movb %al, 0xb(%rsp)
jb 0x470bda
cmpl $0x0, 0x1c(%rsp)
setne %al
xorb $-0x1, %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
testb $0x1, %al
jne 0x470be7
jmp 0x470c96
jmp 0x470be9
xorl %eax, %eax
cmpl $0x8, 0x60(%rsp)
movb %al, 0xa(%rsp)
jb 0x470c0b
movl 0x58(%rsp), %eax
movl %eax, %ecx
movl $0x18, %eax
cmpq %rcx, %rax
setae %al
movb %al, 0xa(%rsp)
movb 0xa(%rsp), %al
testb $0x1, %al
jne 0x470c15
jmp 0x470c4e
movl 0x64(%rsp), %eax
shll $0x8, %eax
movq 0x48(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x48(%rsp)
movzbl (%rcx), %ecx
orl %ecx, %eax
movl %eax, 0x64(%rsp)
movl 0x60(%rsp), %eax
subl $0x8, %eax
movl %eax, 0x60(%rsp)
movl 0x58(%rsp), %eax
addl $0x8, %eax
movl %eax, 0x58(%rsp)
jmp 0x470be9
leaq 0x20(%rsp), %rdi
movl 0x64(%rsp), %esi
movl 0x58(%rsp), %edx
callq 0x470d30
leaq 0x20(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x19810
cmpl $-0x1, %eax
jne 0x470c81
movl $0x1, 0x1c(%rsp)
jmp 0x470c96
movl $0x0, 0x64(%rsp)
movl $0x0, 0x58(%rsp)
jmp 0x470bbf
cmpl $0x0, 0x1c(%rsp)
je 0x470c9f
jmp 0x470d08
cmpl $0x0, 0x60(%rsp)
je 0x470d06
movq 0x48(%rsp), %rax
movzbl (%rax), %eax
movl $0x8, %ecx
subl 0x60(%rsp), %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
movl $0x8, %ecx
subl 0x60(%rsp), %ecx
shrl %cl, %eax
movl %eax, 0x64(%rsp)
leaq 0x20(%rsp), %rdi
movl 0x64(%rsp), %esi
movl 0x60(%rsp), %edx
callq 0x470d30
leaq 0x20(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x19810
cmpl $-0x1, %eax
jne 0x470d04
movl $0x1, 0x1c(%rsp)
jmp 0x470d08
jmp 0x470d06
jmp 0x470d08
movl 0x1c(%rsp), %edx
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0x0, %edx
cmovnel %ecx, %eax
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)