// File: /workspace/github_c_makefile_star2_O2/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
callq 0xbf3b1
testq %r15, %r15
je 0xc0370
movq %rax, %rbx
movq %r15, %rdi
callq 0x8da98
testb %al, %al
je 0xc0340
movq %rbx, %rdi
callq 0xbffad
movq %rbx, %r12
addq $0x98, %r12
leaq 0x1ef(%rip), %rdi       # 0xc03a8
pushq $0x50
popq %rcx
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %r8
movq %r14, %r9
callq 0x94058
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 0x8b9fa
andq $0x0, 0x98(%rbx)
testl %ebp, %ebp
jne 0xc0354
movq %rbx, %rdi
callq 0xbff7e
movq %rax, %r13
leaq 0x2587e3(%rip), %rdi    # 0x318a89
movq %rax, %rsi
xorl %eax, %eax
callq 0x92a82
leaq -0x1b7(%rip), %rdi      # 0xc0100
movq %rbx, %rsi
movq %r15, %rdx
movq %r13, %rcx
movq %r12, %r8
movq %r14, %r9
callq 0x9430d
testl %eax, %eax
jne 0xc0354
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 0x25868c(%rip), %rdi    # 0x3189ad
xorl %eax, %eax
callq 0x92a82
movl 0xd8(%rbx), %edi
callq 0x1042e4
movq %rax, 0x68(%rbx)
movb $0x1, 0xf0(%rbx)
jmp 0xc035e
leaq 0x258755(%rip), %rsi    # 0x318a9c
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x89dbb
movq %rbx, %rdi
callq 0xc0517
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x377bf1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x224c92(%rip), %rsi    # 0x2e5013
leaq 0x227784(%rip), %rdx    # 0x2e7b0c
leaq 0x2586d2(%rip), %rcx    # 0x318a61
leaq 0x2584a0(%rip), %r8     # 0x318836
movl $0x3de, %r9d            # imm = 0x3DE
xorl %eax, %eax
callq 0x17a50
callq 0x17390