// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/hcr.c
// Function: get_next_file_chunk_for_huffman
static int get_next_file_chunk_for_huffman(GtBitsequence **bits,
                                           GtUword *length,
                                           GtUword *offset,
                                           GtUword *pad_length,
                                           void *meminfo)
{
  const int empty = 0,
            success = 1;
  HcrHuffDataIterator *data_iter;
  gt_assert(meminfo);
  gt_assert(bits && length && offset && pad_length);
  data_iter = (HcrHuffDataIterator*) meminfo;

  if (data_iter->pos < data_iter->end) {
    gt_fa_xmunmap(data_iter->data);
    data_iter->data = NULL;
    data_iter->data = gt_fa_xmmap_read_range(data_iter->path,
                                        (size_t) data_iter->blocksize,
                                        data_iter->pos);
    data_iter->pos += data_iter->blocksize;
    if (data_iter->pos > data_iter->end) {
      gt_safe_assign(*length,
                    (data_iter->blocksize - (data_iter->pos - data_iter->end)));
      *length /= sizeof (GtBitsequence);
    }
    else
      *length = data_iter->bitseq_per_chunk;

    *offset = 0;
    *pad_length = 0;
    *bits = data_iter->data;
    return success;
  }
  gt_fa_xmunmap(data_iter->data);
  data_iter->data = NULL;
  *bits = NULL;
  *length = 0;
  *offset = 0;
  *pad_length = 0;
  return empty;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movq %r8, 0x28(%rsp)
movl $0x0, 0x24(%rsp)
movl $0x1, 0x20(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x18930d
movq 0x4b2cc4(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x38cd2d(%rip), %rsi    # 0x516013
leaq 0x3cbf47(%rip), %rdx    # 0x555234
leaq 0x3cbf48(%rip), %rcx    # 0x55523c
leaq 0x3cb9f0(%rip), %r8     # 0x554ceb
movl $0x275, %r9d            # imm = 0x275
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x18930f
jmp 0x189311
cmpq $0x0, 0x48(%rsp)
je 0x189331
cmpq $0x0, 0x40(%rsp)
je 0x189331
cmpq $0x0, 0x38(%rsp)
je 0x189331
cmpq $0x0, 0x30(%rsp)
jne 0x189369
movq 0x4b2c68(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x38ccd1(%rip), %rsi    # 0x516013
leaq 0x3cbf13(%rip), %rdx    # 0x55525c
leaq 0x3cbeec(%rip), %rcx    # 0x55523c
leaq 0x3cb994(%rip), %r8     # 0x554ceb
movl $0x276, %r9d            # imm = 0x276
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x18936b
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x18951b
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0xdb2a0
movq 0x18(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rax
movq 0x40(%rax), %rsi
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rdx
leaq 0x3cb922(%rip), %rcx    # 0x554ceb
movl $0x27e, %r8d            # imm = 0x27E
callq 0xdb010
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
movq 0x40(%rax), %rcx
movq 0x18(%rsp), %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jbe 0x1894d7
jmp 0x189410
movq 0x18(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rsp), %rcx
movq 0x20(%rcx), %rcx
movq 0x18(%rsp), %rdx
subq 0x18(%rdx), %rcx
subq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x8(%rsp), %rax
jne 0x18947e
cmpq $0x1, 0x10(%rsp)
setb %al
andb $0x1, %al
movzbl %al, %eax
cmpq $0x1, 0x8(%rsp)
setb %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x18947e
movq 0x8(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
xorl %eax, %eax
movl %eax, (%rsp)
jmp 0x189488
movl $0x1, %eax
movl %eax, (%rsp)
jmp 0x189488
movl (%rsp), %eax
movl %eax, 0x4(%rsp)
cmpl $0x0, 0x4(%rsp)
je 0x1894c4
movq 0x4b2b03(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x38eb7e(%rip), %rsi    # 0x518025
leaq 0x3cb83d(%rip), %rdx    # 0x554ceb
movl $0x282, %ecx            # imm = 0x282
movb $0x0, %al
callq 0x199f0
movl $0x1, %edi
callq 0x19890
jmp 0x1894c6
movq 0x40(%rsp), %rax
movq (%rax), %rcx
shrq $0x3, %rcx
movq %rcx, (%rax)
jmp 0x1894e8
movq 0x18(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
movq 0x38(%rsp), %rax
movq $0x0, (%rax)
movq 0x30(%rsp), %rax
movq $0x0, (%rax)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x48(%rsp), %rax
movq %rcx, (%rax)
movl $0x1, 0x54(%rsp)
jmp 0x18956e
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0xdb2a0
movq 0x18(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x48(%rsp), %rax
movq $0x0, (%rax)
movq 0x40(%rsp), %rax
movq $0x0, (%rax)
movq 0x38(%rsp), %rax
movq $0x0, (%rax)
movq 0x30(%rsp), %rax
movq $0x0, (%rax)
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw (%rax,%rax)