// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/compressed_bitsequence.c
// Function: gt_compressed_bitsequence_new_from_file
GtCompressedBitsequence *
gt_compressed_bitsequence_new_from_file(const char *filename,
                                        GtError *err)
{
  int had_err = 0;
  GtUword expectedsize = 0;
  GtCompressedBitsequence *cbs = gt_compressed_bitsequence_new_empty();
  gt_assert(filename != NULL);
  if (gt_file_exists(filename)) {
    expectedsize = (GtUword) gt_compressed_bitsequence_header_size(cbs);
    had_err = gt_mapspec_read_header(
                                 gt_compressed_bitsequence_header_setup_mapspec,
                                 cbs, filename, expectedsize,
                                 &(cbs->mmapped), err);
    cbs->c_offsets_size = cbs->header.c_offsets_size[0];
    cbs->classes_size = cbs->header.classes_size[0];
    cbs->num_of_bits = cbs->header.num_of_bits[0];
    cbs->num_of_blocks = cbs->header.num_of_blocks[0];
    cbs->num_of_superblocks = cbs->header.num_of_superblocks[0];
    cbs->superblockoffsets_size = cbs->header.superblockoffsets_size[0];
    cbs->superblockranks_size = cbs->header.superblockranks_size[0];

    cbs->blocksize = cbs->header.blocksize[0];
    cbs->class_bits = cbs->header.class_bits[0];
    cbs->last_block_len = cbs->header.last_block_len[0];
    cbs->superblockoffsets_bits = cbs->header.superblockoffsets_bits[0];
    cbs->superblockranks_bits = cbs->header.superblockranks_bits[0];
    cbs->superblocksize = cbs->header.superblocksize[0];

    gt_fa_xmunmap(cbs->mmapped);
    cbs->mmapped = NULL;
    if (!had_err) {
      expectedsize = (GtUword) gt_compressed_bitsequence_file_size(cbs);
      gt_log_log("new expected: " GT_WU "\n", expectedsize);
      had_err = gt_mapspec_read(gt_compressed_bitsequence_data_setup_mapspec,
                                cbs, filename, expectedsize,
                                &(cbs->mmapped), err);
    }
    if (!had_err) {
      gt_log_log("blocksize: %u\n"
                 "class_offsets_size: " GT_WU "\n"
                 "class_bits: %u\n"
                 "classes_size: " GT_WU "\n"
                 "last_block_len: %u\n"
                 "num_of_bits: " GT_WU "\n"
                 "num_of_blocks: " GT_WU "\n"
                 "num_of_superblocks: " GT_WU "\n"
                 "superblocksize: %u\n"
                 "size: " GT_WU "\n",
                 cbs->blocksize,
                 cbs->c_offsets_size,
                 cbs->class_bits,
                 cbs->classes_size,
                 cbs->last_block_len,
                 cbs->num_of_bits,
                 cbs->num_of_blocks,
                 cbs->num_of_superblocks,
                 cbs->superblocksize,
                 expectedsize);
    }
  }
  else {
    gt_error_set(err, "file %s does not exist!", filename);
    had_err = -1;
  }
  if (had_err) {
    gt_compressed_bitsequence_delete(cbs);
    return NULL;
  }
  cbs->popcount_tab = gt_popcount_tab_new(cbs->blocksize);
  cbs->from_file = true;
  return cbs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x24d934(%rip), %rdx    # 0x378536
movl $0x1, %edi
movl $0xf8, %esi
movl $0x192, %ecx            # imm = 0x192
callq 0x10436a
movl $0xf, 0xd8(%rax)
movq $0x0, 0x98(%rax)
testq %r15, %r15
je 0x12ae3d
movq %rax, %rbx
movq %r15, %rdi
callq 0xff28c
testb %al, %al
je 0x12ae0d
movq %rbx, %r12
addq $0x98, %r12
movq %rbx, %rdi
callq 0x12aa39
leaq 0x1e2(%rip), %rdi       # 0x12ae42
movl $0x50, %ecx
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %r8
movq %r14, %r9
callq 0x104b78
movl %eax, %ebp
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq (%rax), %rax
movq %rax, 0xa0(%rbx)
movq (%rcx), %rax
movq %rax, 0xa8(%rbx)
movq 0x10(%rbx), %rax
movq (%rax), %rax
movq %rax, 0xb0(%rbx)
movq 0x18(%rbx), %rax
movq (%rax), %rax
movq %rax, 0xb8(%rbx)
movq 0x20(%rbx), %rax
movq (%rax), %rax
movq %rax, 0xc0(%rbx)
movq 0x28(%rbx), %rax
movq (%rax), %rax
movq %rax, 0xc8(%rbx)
movq 0x30(%rbx), %rax
movq (%rax), %rax
movq %rax, 0xd0(%rbx)
movq 0x38(%rbx), %rax
movl (%rax), %eax
movl %eax, 0xd8(%rbx)
movq 0x40(%rbx), %rax
movl (%rax), %eax
movl %eax, 0xdc(%rbx)
movq 0x48(%rbx), %rax
movl (%rax), %eax
movl %eax, 0xe0(%rbx)
movq 0x50(%rbx), %rax
movl (%rax), %eax
movl %eax, 0xe4(%rbx)
movq 0x58(%rbx), %rax
movl (%rax), %eax
movl %eax, 0xe8(%rbx)
movq 0x60(%rbx), %rax
movl (%rax), %eax
movl %eax, 0xec(%rbx)
movq 0x98(%rbx), %rdi
callq 0xfdc54
movq $0x0, 0x98(%rbx)
testl %ebp, %ebp
jne 0x12ae21
movq %rbx, %rdi
callq 0x12aa39
movq 0xa8(%rbx), %rax
addq 0xa0(%rbx), %rax
addq 0xc8(%rbx), %rax
addq 0xd0(%rbx), %rax
leaq 0x50(,%rax,8), %r13
leaq 0x24da16(%rip), %rdi    # 0x378789
movq %r13, %rsi
xorl %eax, %eax
callq 0x103d72
leaq -0x208(%rip), %rdi      # 0x12ab7c
movq %rbx, %rsi
movq %r15, %rdx
movq %r13, %rcx
movq %r12, %r8
movq %r14, %r9
callq 0x104dc0
testl %eax, %eax
jne 0x12ae21
movl 0xd8(%rbx), %esi
movl 0xdc(%rbx), %ecx
movq 0xa0(%rbx), %rdx
movq 0xa8(%rbx), %r8
movl 0xe0(%rbx), %r9d
movups 0xb0(%rbx), %xmm0
movq 0xc0(%rbx), %rax
movl 0xec(%rbx), %edi
movq %r13, 0x20(%rsp)
movl %edi, 0x18(%rsp)
movq %rax, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x24d8bf(%rip), %rdi    # 0x3786ad
xorl %eax, %eax
callq 0x103d72
movl 0xd8(%rbx), %edi
callq 0x163ff0
movq %rax, 0x68(%rbx)
movb $0x1, 0xf0(%rbx)
jmp 0x12ae2b
leaq 0x24d988(%rip), %rsi    # 0x37879c
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xfcb67
movq %rbx, %rdi
callq 0x12afc8
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3cbe2