// File: /workspace/github_c_makefile_star2_O1/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 0x250d21(%rip), %rdx    # 0x381806
movl $0x1, %edi
movl $0xf8, %esi
movl $0x192, %ecx            # imm = 0x192
callq 0x1093ef
movl $0xf, 0xd8(%rax)
movq $0x0, 0x98(%rax)
testq %r15, %r15
je 0x130d2c
movq %rax, %rbx
movq %r15, %rdi
callq 0x10415c
testb %al, %al
je 0x130c29
movq %rbx, %r13
addq $0x98, %r13
movq %rbx, %rdi
callq 0x13091f
leaq 0x1ee(%rip), %rdi       # 0x130d31
movl $0x50, %r12d
movl $0x50, %ecx
movq %rbx, %rsi
movq %r15, %rdx
movq %r13, %r8
movq %r14, %r9
callq 0x109bfc
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 0x102b12
movq $0x0, 0x98(%rbx)
testl %ebp, %ebp
je 0x130c42
xorl %eax, %eax
jmp 0x130c9f
leaq 0x250e3c(%rip), %rsi    # 0x381a6c
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1019cf
jmp 0x130d10
movq %rbx, %rdi
callq 0x13091f
movq 0xa8(%rbx), %rax
addq 0xa0(%rbx), %rax
addq 0xc8(%rbx), %rax
addq 0xd0(%rbx), %rax
leaq 0x50(,%rax,8), %r12
leaq 0x250de4(%rip), %rdi    # 0x381a59
movq %r12, %rsi
xorl %eax, %eax
callq 0x108e02
leaq -0x227(%rip), %rdi      # 0x130a5f
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
movq %r14, %r9
callq 0x109e7f
testl %eax, %eax
sete %al
testb %al, %al
je 0x130d10
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 %r12, 0x20(%rsp)
movl %edi, 0x18(%rsp)
movq %rax, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x250c8c(%rip), %rdi    # 0x38197d
xorl %eax, %eax
callq 0x108e02
movl 0xd8(%rbx), %edi
callq 0x16be7c
movq %rax, 0x68(%rbx)
movb $0x1, 0xf0(%rbx)
jmp 0x130d1a
movq %rbx, %rdi
callq 0x130eb7
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3d627