// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/bitbuffer.c
// Function: gt_bitbuffer_generic_write_FILE
void gt_bitbuffer_generic_write_FILE(GtBitbuffer *bb,
                                     GtUword value,
                                     GtBitcount_type bitsforvalue)
{
  GtBitcount_type bits2store = bitsforvalue;

  gt_assert(bb != NULL && bitsforvalue <= bb->bitsinbuffer);
  bb->numberofallvalues++;
  while (true)
  {
    gt_assert(bits2store > 0);
    if (bb->remainingbitsinbuffer >= bits2store)
    {
      bb->remainingbitsinbuffer -= bits2store;
      bb->currentbitbuffer |= (uint64_t)
                    ((value & ((1UL << bits2store) - 1))
                     << bb->remainingbitsinbuffer);
      break;
    }
    if (bb->remainingbitsinbuffer == 0) /* buffer full */
    {
      (void) fwrite(&bb->currentbitbuffer,sizeof bb->currentbitbuffer,
                    (size_t) 1,bb->fp);
      bb->currentbitbuffer = 0;
      bb->remainingbitsinbuffer = bb->bitsinbuffer;
    } else
    {
      gt_assert(bits2store > bb->remainingbitsinbuffer);
      bits2store -= bb->remainingbitsinbuffer;
      bb->currentbitbuffer
        |= ((uint64_t) value >> bb->remainingbitsinbuffer);
      bb->remainingbitsinbuffer = 0;
    }
  }
}

// Assembly:
subq $0x18, %rsp
movw %dx, %ax
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movw %ax, 0x6(%rsp)
movw 0x6(%rsp), %ax
movw %ax, 0x4(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x88b4a
movzwl 0x6(%rsp), %eax
movq 0x10(%rsp), %rcx
movzwl 0x14(%rcx), %ecx
cmpl %ecx, %eax
jle 0x88b82
movq 0x5b344f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x48d4b8(%rip), %rsi    # 0x516013
leaq 0x4a82f5(%rip), %rdx    # 0x530e57
leaq 0x4a831d(%rip), %rcx    # 0x530e86
leaq 0x4a82ae(%rip), %r8     # 0x530e1e
movl $0x4d, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x88b84
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
jmp 0x88b97
movzwl 0x4(%rsp), %eax
cmpl $0x0, %eax
jg 0x88bd9
movq 0x5b33f8(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x48d461(%rip), %rsi    # 0x516013
leaq 0x4a82ed(%rip), %rdx    # 0x530ea6
leaq 0x4a82c6(%rip), %rcx    # 0x530e86
leaq 0x4a8257(%rip), %r8     # 0x530e1e
movl $0x51, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x88bdb
movq 0x10(%rsp), %rax
movzwl 0x10(%rax), %eax
movzwl 0x4(%rsp), %ecx
cmpl %ecx, %eax
jl 0x88c40
movzwl 0x4(%rsp), %edx
movq 0x10(%rsp), %rax
movzwl 0x10(%rax), %ecx
subl %edx, %ecx
movw %cx, 0x10(%rax)
movq 0x8(%rsp), %rax
movzwl 0x4(%rsp), %ecx
movl %ecx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
subq $0x1, %rcx
andq %rcx, %rax
movq 0x10(%rsp), %rcx
movzwl 0x10(%rcx), %ecx
movl %ecx, %ecx
shlq %cl, %rax
movq %rax, %rcx
movq 0x10(%rsp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x88d22
movq 0x10(%rsp), %rax
movzwl 0x10(%rax), %eax
cmpl $0x0, %eax
jne 0x88c8e
movq 0x10(%rsp), %rdi
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rcx
movl $0x8, %esi
movl $0x1, %edx
callq 0x19ea0
movq 0x10(%rsp), %rax
movq $0x0, (%rax)
movq 0x10(%rsp), %rax
movw 0x14(%rax), %cx
movq 0x10(%rsp), %rax
movw %cx, 0x10(%rax)
jmp 0x88d1d
jmp 0x88c90
movzwl 0x4(%rsp), %eax
movq 0x10(%rsp), %rcx
movzwl 0x10(%rcx), %ecx
cmpl %ecx, %eax
jg 0x88cda
movq 0x5b32f7(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x48d360(%rip), %rsi    # 0x516013
leaq 0x4a81fb(%rip), %rdx    # 0x530eb5
leaq 0x4a81c5(%rip), %rcx    # 0x530e86
leaq 0x4a8156(%rip), %r8     # 0x530e1e
movl $0x62, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x88cdc
movq 0x10(%rsp), %rax
movzwl 0x10(%rax), %ecx
movzwl 0x4(%rsp), %eax
subl %ecx, %eax
movw %ax, 0x4(%rsp)
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
movzwl 0x10(%rcx), %ecx
movl %ecx, %ecx
shrq %cl, %rax
movq %rax, %rcx
movq 0x10(%rsp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
movw $0x0, 0x10(%rax)
jmp 0x88b95
addq $0x18, %rsp
retq
nopw (%rax,%rax)