// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/bitbuffer.c
// Function: gt_bitbuffer_flush
void gt_bitbuffer_flush(bool bruteforce,GtBitbuffer *bb,uint8_t *bytestring)
{
  gt_assert(bb != NULL);
  if (bb->remainingbitsinbuffer < bb->bitsinbuffer)
  {
    if (bb->fp != NULL)
    {
      gt_assert(!bruteforce && bytestring == NULL);
      (void) fwrite(&bb->currentbitbuffer,
                    sizeof bb->currentbitbuffer,
                    (size_t) 1,bb->fp);
      if (bb->bitsperentry > 0)
      {
        uint64_t writtenbits = bb->numberofallvalues * bb->bitsperentry;
        (void) fseek(bb->fp,0,SEEK_SET);
        (void) fwrite(&writtenbits,sizeof writtenbits,(size_t) 1,bb->fp);
      }
    } else
    {
      if (bruteforce)
      {
        *bytestring = bb->currentuint8;
      } else
      {
        gt_assert(bb->fp == NULL && bb->currentbitbuffer <= UINT8_MAX);
        *bytestring = (uint8_t) bb->currentbitbuffer;
      }
    }
  }
  bb->currentbitbuffer = 0;
  bb->currentuint8 = 0;
  bb->remainingbitsinbuffer = bb->bitsinbuffer;
}

// Assembly:
subq $0x28, %rsp
movb %dil, %al
andb $0x1, %al
movb %al, 0x27(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x893f7
movq 0x5b2bda(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x48cc43(%rip), %rsi    # 0x516013
leaq 0x4a7be3(%rip), %rdx    # 0x530fba
leaq 0x4a7ca2(%rip), %rcx    # 0x531080
leaq 0x4a7a39(%rip), %r8     # 0x530e1e
movl $0xe0, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x893f9
movq 0x18(%rsp), %rax
movzwl 0x10(%rax), %eax
movq 0x18(%rsp), %rcx
movzwl 0x14(%rcx), %ecx
cmpl %ecx, %eax
jge 0x8956d
movq 0x18(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x894ea
jmp 0x89425
testb $0x1, 0x27(%rsp)
jne 0x89434
cmpq $0x0, 0x10(%rsp)
je 0x8946c
movq 0x5b2b65(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x48cbce(%rip), %rsi    # 0x516013
leaq 0x4a7c47(%rip), %rdx    # 0x531093
leaq 0x4a7c2d(%rip), %rcx    # 0x531080
leaq 0x4a79c4(%rip), %r8     # 0x530e1e
movl $0xe5, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x8946e
movq 0x18(%rsp), %rdi
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rcx
movl $0x8, %esi
movl $0x1, %edx
callq 0x19ea0
movq 0x18(%rsp), %rax
movzwl 0x12(%rax), %eax
cmpl $0x0, %eax
jle 0x894e5
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rsp), %rcx
movzwl 0x12(%rcx), %ecx
imulq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x197e0
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rcx
leaq 0x8(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x19ea0
jmp 0x8956b
testb $0x1, 0x27(%rsp)
je 0x89502
movq 0x18(%rsp), %rax
movb 0x17(%rax), %cl
movq 0x10(%rsp), %rax
movb %cl, (%rax)
jmp 0x89569
jmp 0x89504
movq 0x18(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x8951e
movq 0x18(%rsp), %rax
cmpq $0xff, (%rax)
jbe 0x89556
movq 0x5b2a7b(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x48cae4(%rip), %rsi    # 0x516013
leaq 0x4a7b7f(%rip), %rdx    # 0x5310b5
leaq 0x4a7b43(%rip), %rcx    # 0x531080
leaq 0x4a78da(%rip), %r8     # 0x530e1e
movl $0xf6, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x89558
movq 0x18(%rsp), %rax
movq (%rax), %rax
movb %al, %cl
movq 0x10(%rsp), %rax
movb %cl, (%rax)
jmp 0x8956b
jmp 0x8956d
movq 0x18(%rsp), %rax
movq $0x0, (%rax)
movq 0x18(%rsp), %rax
movb $0x0, 0x17(%rax)
movq 0x18(%rsp), %rax
movw 0x14(%rax), %cx
movq 0x18(%rsp), %rax
movw %cx, 0x10(%rax)
addq $0x28, %rsp
retq
nopl (%rax)