// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_compressedbits.c
// Function: gt_compressedbits_runner
static int gt_compressedbits_runner(GT_UNUSED int argc,
                                    GT_UNUSED const char **argv,
                                    GT_UNUSED int parsed_args,
                                    void *tool_arguments,
                                    GtError *err)
{
  GtCompressdbitsArguments *arguments = tool_arguments;
  int had_err = 0;
  GtUword idx;
  GtUint64 num_of_bits = 0ULL;
  GtBitsequence *bits = NULL;
  GtCompressedBitsequence *cbs = NULL, *read_cbs = NULL;
  GtStr *filename = gt_str_new();
  FILE *fp = NULL;

  gt_error_check(err);
  gt_assert(arguments);
  gt_assert(argc == parsed_args);

  if (gt_option_is_set(arguments->filename_op)) {
    FILE *file = NULL;
    gt_assert(arguments->filename != NULL);

    file = gt_xfopen(gt_str_get(arguments->filename), "r");
    if ((size_t) 1 != gt_xfread(&num_of_bits,
                                sizeof (num_of_bits), (size_t) 1, file)) {
      had_err = -1;
    }
    if (!had_err) {
      gt_log_log("bits to read: "GT_LLU"", num_of_bits);
      arguments->size = (GtUword) GT_NUMOFINTSFORBITS(num_of_bits);
      bits = gt_malloc(sizeof (*bits) * arguments->size);
      if ((size_t) arguments->size !=
          gt_xfread(bits, sizeof (*bits),
                    (size_t) arguments->size, file)) {
        had_err = -1;
      }
    }
    gt_xfclose(file);
  }
  else {
    bits = gt_calloc(sizeof (*bits), (size_t) arguments->size);
    num_of_bits = (GtUint64) (GT_INTWORDSIZE * arguments->size);

    if (arguments->fill_random) {
      for (idx = 0; idx < arguments->size; idx++) {
        bits[idx] =
          (GtBitsequence) (0xAAAAAAAAAAAAAAAAULL ^ gt_rand_max(ULONG_MAX));
      }
    }
    else {
      for (idx = 0; idx < arguments->size; idx++)
        bits[idx] = (GtBitsequence) (0xAAAAAAAAAAAAAAAAULL ^ idx);
    }
  }

  if (!had_err) {
    fp = gt_xtmpfp(filename);
    gt_fa_xfclose(fp);
    fp = NULL;

    gt_log_log("filename: %s", gt_str_get(filename));
    gt_log_log("size in words: "GT_WU"", arguments->size);
    cbs = gt_compressed_bitsequence_new(
                            bits, arguments->samplerate,
                            (GtUword) num_of_bits);
    gt_log_log("original size in MB: %2.3f",
               (sizeof (*bits) * arguments->size) / (1024.0 * 1024.0));
    gt_log_log("compressed size in MB: %2.3f",
               gt_compressed_bitsequence_size(cbs) / (1024.0 * 1024.0));
    gt_log_log("popcount table size thereof in MB: %2.3f",
               gt_popcount_tab_calculate_size(15U) / (1024.0 * 1024.0));
    had_err = gt_compressed_bitsequence_write(cbs, gt_str_get(filename), err);
  }
  if (!had_err)
  {
    read_cbs =
      gt_compressed_bitsequence_new_from_file(gt_str_get(filename), err);
    if (read_cbs == NULL)
      had_err = -1;
  }
  if (!had_err && bits != NULL && arguments->check_consistency) {
    for (idx = 0; (GtUint64) idx < num_of_bits; ++idx) {
      int GT_UNUSED bit = gt_compressed_bitsequence_access(read_cbs, idx);
      int GT_UNUSED original = GT_ISIBITSET(bits, idx) ? 1 : 0;
      gt_assert(gt_compressed_bitsequence_access(cbs, idx) == bit);
      gt_assert(original == bit);
    }
  }
  gt_compressed_bitsequence_delete(cbs);
  gt_compressed_bitsequence_delete(read_cbs);
  gt_free(bits);
  gt_str_delete(filename);
  return had_err;
}

// Assembly:
subq $0xd8, %rsp
movl %edi, 0xd4(%rsp)
movq %rsi, 0xc8(%rsp)
movl %edx, 0xc4(%rsp)
movq %rcx, 0xb8(%rsp)
movq %r8, 0xb0(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movl $0x0, 0xa4(%rsp)
movq $0x0, 0x90(%rsp)
movq $0x0, 0x88(%rsp)
movq $0x0, 0x80(%rsp)
movq $0x0, 0x78(%rsp)
callq 0x11d4a0
movq %rax, 0x70(%rsp)
movq $0x0, 0x68(%rsp)
cmpq $0x0, 0xb0(%rsp)
je 0x2239e
movq 0xb0(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x22366
jmp 0x2239e
movq 0x619c33(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4f3c9c(%rip), %rsi    # 0x516013
leaq 0x4f3e41(%rip), %rdx    # 0x5161bf
leaq 0x4f6797(%rip), %rcx    # 0x518b1c
leaq 0x4f65c4(%rip), %r8     # 0x518950
movl $0x88, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x223a0
jmp 0x223a2
cmpq $0x0, 0xa8(%rsp)
jne 0x223e5
movq 0x619bec(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4f3c55(%rip), %rsi    # 0x516013
leaq 0x55879a(%rip), %rdx    # 0x57ab5f
leaq 0x4f6750(%rip), %rcx    # 0x518b1c
leaq 0x4f657d(%rip), %r8     # 0x518950
movl $0x89, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x223e7
jmp 0x223e9
movl 0xd4(%rsp), %eax
cmpl 0xc4(%rsp), %eax
je 0x22431
movq 0x619ba0(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4f3c09(%rip), %rsi    # 0x516013
leaq 0x4f6724(%rip), %rdx    # 0x518b35
leaq 0x4f6704(%rip), %rcx    # 0x518b1c
leaq 0x4f6531(%rip), %r8     # 0x518950
movl $0x8a, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x22433
movq 0xa8(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0xf74a0
testb $0x1, %al
jne 0x2244d
jmp 0x225ea
movq $0x0, 0x60(%rsp)
movq 0xa8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x2249d
movq 0x619b34(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4f3b9d(%rip), %rsi    # 0x516013
leaq 0x4f66cc(%rip), %rdx    # 0x518b49
leaq 0x4f6698(%rip), %rcx    # 0x518b1c
leaq 0x4f64c5(%rip), %r8     # 0x518950
movl $0x8e, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2249f
movq 0xa8(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
leaq 0x509b20(%rip), %rsi    # 0x52bfda
callq 0x126af0
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rcx
leaq 0x90(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x126c30
movq %rax, %rcx
movl $0x1, %eax
cmpq %rcx, %rax
je 0x224f8
movl $0xffffffff, 0xa4(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0xa4(%rsp)
jne 0x225db
movq 0x90(%rsp), %rsi
leaq 0x4f6650(%rip), %rdi    # 0x518b65
movb $0x0, %al
callq 0xe7740
movq 0x90(%rsp), %rax
shrq $0x6, %rax
cmpq $0x0, %rax
jne 0x2253a
movl $0x1, %eax
movq %rax, 0x50(%rsp)
jmp 0x22553
movq 0x90(%rsp), %rax
subq $0x1, %rax
shrq $0x6, %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rcx
movq 0xa8(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rdi
shlq $0x3, %rdi
leaq 0x4f63d5(%rip), %rsi    # 0x518950
movl $0x98, %edx
callq 0xe80f0
movq %rax, 0x88(%rsp)
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x88(%rsp), %rdi
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rdx
movq 0x60(%rsp), %rcx
movl $0x8, %esi
callq 0x126c30
movq %rax, %rcx
movq 0x48(%rsp), %rax
cmpq %rcx, %rax
je 0x225d9
movl $0xffffffff, 0xa4(%rsp) # imm = 0xFFFFFFFF
jmp 0x225db
movq 0x60(%rsp), %rdi
callq 0x126990
jmp 0x22706
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rsi
movl $0x8, %edi
leaq 0x4f634e(%rip), %rdx    # 0x518950
movl $0xa2, %ecx
callq 0xe83c0
movq %rax, 0x88(%rsp)
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
shlq $0x6, %rax
movq %rax, 0x90(%rsp)
movq 0xa8(%rsp), %rax
testb $0x1, 0x18(%rax)
je 0x226a4
movq $0x0, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq 0xa8(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x226a2
movq $-0x1, %rdi
callq 0xec350
movq %rax, %rdx
movabsq $-0x5555555555555556, %rax # imm = 0xAAAAAAAAAAAAAAAA
xorq %rax, %rdx
movq 0x88(%rsp), %rax
movq 0x98(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x98(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x98(%rsp)
jmp 0x22646
jmp 0x22704
movq $0x0, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq 0xa8(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x22702
movabsq $-0x5555555555555556, %rdx # imm = 0xAAAAAAAAAAAAAAAA
xorq 0x98(%rsp), %rdx
movq 0x88(%rsp), %rax
movq 0x98(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x98(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x98(%rsp)
jmp 0x226b0
jmp 0x22704
jmp 0x22706
cmpl $0x0, 0xa4(%rsp)
jne 0x228d6
movq 0x70(%rsp), %rdi
leaq 0x4f6230(%rip), %rdx    # 0x518950
xorl %esi, %esi
movl %esi, 0x8(%rsp)
movl $0xb2, %ecx
callq 0xd9e50
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
callq 0xd9570
movq $0x0, 0x68(%rsp)
movq 0x70(%rsp), %rdi
callq 0x11dee0
movq %rax, %rsi
movl 0x8(%rsp), %eax
leaq 0x4f6418(%rip), %rdi    # 0x518b78
movb %al, 0xf(%rsp)
callq 0xe7740
movb 0xf(%rsp), %al
movq 0xa8(%rsp), %rcx
movq 0x8(%rcx), %rsi
leaq 0x4f6405(%rip), %rdi    # 0x518b85
callq 0xe7740
movq 0x88(%rsp), %rdi
movq 0xa8(%rsp), %rax
movl (%rax), %esi
movq 0x90(%rsp), %rdx
callq 0x13a230
movq %rax, 0x80(%rsp)
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
shlq $0x3, %rax
movq %rax, %xmm0
movaps 0x4f6168(%rip), %xmm1   # 0x518930
movaps %xmm1, 0x20(%rsp)
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x4f6167(%rip), %xmm1   # 0x518940
movaps %xmm1, 0x30(%rsp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x4f6133(%rip), %xmm1   # 0x518928
movsd %xmm1, 0x10(%rsp)
mulsd %xmm1, %xmm0
leaq 0x4f6392(%rip), %rdi    # 0x518b98
movb $0x1, %al
movb %al, 0x1f(%rsp)
callq 0xe7740
movq 0x80(%rsp), %rdi
callq 0x13c7e0
movsd 0x10(%rsp), %xmm1
movaps 0x20(%rsp), %xmm3
movaps 0x30(%rsp), %xmm2
movq %rax, %rcx
movb 0x1f(%rsp), %al
movq %rcx, %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm2, %xmm0
movaps %xmm0, %xmm2
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
leaq 0x4f635b(%rip), %rdi    # 0x518bb3
callq 0xe7740
movl $0xf, %edi
callq 0x1b4a00
movaps 0x20(%rsp), %xmm2
movaps 0x30(%rsp), %xmm1
movq %rax, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x4f608f(%rip), %xmm1   # 0x518920
divsd %xmm1, %xmm0
leaq 0x4f6334(%rip), %rdi    # 0x518bd0
movb $0x1, %al
callq 0xe7740
movq 0x80(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x70(%rsp), %rdi
callq 0x11dee0
movq 0x40(%rsp), %rdi
movq %rax, %rsi
movq 0xb0(%rsp), %rdx
callq 0x13c860
movl %eax, 0xa4(%rsp)
cmpl $0x0, 0xa4(%rsp)
jne 0x22914
movq 0x70(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0xb0(%rsp), %rsi
callq 0x13ca80
movq %rax, 0x78(%rsp)
cmpq $0x0, 0x78(%rsp)
jne 0x22912
movl $0xffffffff, 0xa4(%rsp) # imm = 0xFFFFFFFF
jmp 0x22914
cmpl $0x0, 0xa4(%rsp)
jne 0x22a79
cmpq $0x0, 0x88(%rsp)
je 0x22a79
movq 0xa8(%rsp), %rax
testb $0x1, 0x19(%rax)
je 0x22a79
movq $0x0, 0x98(%rsp)
movq 0x98(%rsp), %rax
cmpq 0x90(%rsp), %rax
jae 0x22a77
movq 0x78(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0x13ad10
movl %eax, 0x5c(%rsp)
movq 0x88(%rsp), %rax
movq 0x98(%rsp), %rcx
shrq $0x6, %rcx
movq (%rax,%rcx,8), %rdx
movq 0x98(%rsp), %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
shrq %cl, %rax
andq %rax, %rdx
xorl %eax, %eax
movl $0x1, %ecx
cmpq $0x0, %rdx
cmovnel %ecx, %eax
movl %eax, 0x58(%rsp)
movq 0x80(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0x13ad10
cmpl 0x5c(%rsp), %eax
je 0x22a14
movq 0x6195bd(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4f3626(%rip), %rsi    # 0x516013
leaq 0x4f6205(%rip), %rdx    # 0x518bf9
leaq 0x4f6121(%rip), %rcx    # 0x518b1c
leaq 0x4f5f4e(%rip), %r8     # 0x518950
movl $0xce, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x22a16
jmp 0x22a18
movl 0x58(%rsp), %eax
cmpl 0x5c(%rsp), %eax
je 0x22a5a
movq 0x619577(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4f35e0(%rip), %rsi    # 0x516013
leaq 0x4f61f1(%rip), %rdx    # 0x518c2b
leaq 0x4f60db(%rip), %rcx    # 0x518b1c
leaq 0x4f5f08(%rip), %r8     # 0x518950
movl $0xcf, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x22a5c
jmp 0x22a5e
movq 0x98(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x98(%rsp)
jmp 0x2294f
jmp 0x22a79
movq 0x80(%rsp), %rdi
callq 0x13d090
movq 0x78(%rsp), %rdi
callq 0x13d090
movq 0x88(%rsp), %rdi
leaq 0x4f5eb1(%rip), %rsi    # 0x518950
movl $0xd4, %edx
callq 0xe88c0
movq 0x70(%rsp), %rdi
callq 0x11f560
movl 0xa4(%rsp), %eax
addq $0xd8, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)