// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/compressed_bitsequence.c
// Function: gt_compressed_bitsequence_unit_test
int gt_compressed_bitsequence_unit_test(GtError *err)
{
  const unsigned int sample_testratio = 32U;
  int had_err = 0;
  const GtUword bitseq_testsize = 256UL,
                cbs_testsize = (GT_LOGWORDSIZE == 6) ?
                               16380UL :
                               8192UL;
  GtUword idx;
  GtBitsequence *bitseq;
  GtCompressedBitsequence *cbs;

  gt_error_check(err);

  bitseq = gt_malloc((size_t) bitseq_testsize * sizeof (*bitseq));

  for (idx = 0; idx < bitseq_testsize; idx++) {
    bitseq[idx] = (GtBitsequence) ((GT_LOGWORDSIZE == 6) ?
                                   (GtBitsequence) 0xaaaaccccaaaaccccULL :
                                   (GtBitsequence) 0xaaaaccccULL);
  }

  had_err =
    gt_compressed_bitsequence_unit_test_variable_field(err, bitseq,
                                                       bitseq_testsize);

  if (!had_err) {
    for (idx = 0; idx < bitseq_testsize; idx++) {
      bitseq[idx] = (GtBitsequence) ((GT_LOGWORDSIZE == 6) ?
                                     (GtBitsequence) 0xaaaaccccaaaaccccULL :
                                     (GtBitsequence) 0xaaaaccccUL);
    }
    had_err =
      gt_compressed_bitsequence_unit_test_block_identical(err, bitseq,
                                                          sample_testratio,
                                                          cbs_testsize);
  }

  if (!had_err) {
    cbs = gt_compressed_bitsequence_new(bitseq, sample_testratio, cbs_testsize);
    gt_ensure(cbs != NULL);

    if (cbs != NULL) {

      for (idx = 1UL; !had_err && idx < cbs_testsize; idx += 32UL) {
        gt_ensure(1 == gt_compressed_bitsequence_access(cbs, idx - 1));
        gt_ensure(0 == gt_compressed_bitsequence_access(cbs, idx));
      }
      gt_compressed_bitsequence_delete(cbs);
    }
  }

  /* set some blocks to 0  or ~0 to see if correct block ist found */
  bitseq[GT_DIV2(bitseq_testsize)] = (GtBitsequence) 0;
  bitseq[GT_DIV2(bitseq_testsize)+1] = (GtBitsequence) ~0ULL;
  if (!had_err) {
    cbs = gt_compressed_bitsequence_new(bitseq, sample_testratio, cbs_testsize);
    gt_ensure(cbs != NULL);

    if (cbs != NULL) {
      GtUword rank1, rank0;

      rank1 = gt_compressed_bitsequence_rank_1(cbs,
                               (GtUword) GT_INTWORDSIZE - 1UL);
      gt_ensure(rank1 == (GtUword) GT_DIV2(GT_INTWORDSIZE));
      for (idx = (GtUword) GT_INTWORDSIZE - 1UL;
           !had_err && idx < cbs_testsize;
           idx += idx + 1) {
        rank1 = gt_compressed_bitsequence_rank_1(cbs, idx);
        rank0 = gt_compressed_bitsequence_rank_0(cbs, idx);
        gt_ensure(rank1 + rank0 == idx+1);
      }
      rank1 = gt_compressed_bitsequence_rank_1(cbs, cbs_testsize-1);
      rank0 = gt_compressed_bitsequence_rank_0(cbs, cbs_testsize-1);
      gt_ensure(rank1 + rank0 == cbs_testsize);
      gt_compressed_bitsequence_delete(cbs);
    }
  }

  if (!had_err) {
    cbs = gt_compressed_bitsequence_new(bitseq, sample_testratio, cbs_testsize);
    if (cbs != NULL) {
      GtUword ranktotal1, select1, rank1, select0, rank0;
      ranktotal1 = gt_compressed_bitsequence_rank_1(cbs, cbs_testsize - 1);
      for (idx = 1UL; !had_err && idx <= ranktotal1; idx++) {
        select1 = gt_compressed_bitsequence_select_1(cbs, idx);
        gt_ensure(gt_compressed_bitsequence_access(cbs, select1) == 1);
        rank1 = gt_compressed_bitsequence_rank_1(cbs, select1);
        gt_ensure(idx == rank1);
      }
      for (idx = 1UL; !had_err && idx <= cbs_testsize - ranktotal1; idx++) {
        select0 = gt_compressed_bitsequence_select_0(cbs, idx);
        gt_ensure(gt_compressed_bitsequence_access(cbs, select0) == 0);
        rank0 = gt_compressed_bitsequence_rank_0(cbs, select0);
        gt_ensure(idx == rank0);
      }
    }
    gt_compressed_bitsequence_delete(cbs);
  }

  gt_free(bitseq);

  return had_err;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movl $0x20, 0x6c(%rsp)
movl $0x0, 0x68(%rsp)
movq $0x100, 0x60(%rsp)      # imm = 0x100
movq $0x3ffc, 0x58(%rsp)     # imm = 0x3FFC
cmpq $0x0, 0x70(%rsp)
je 0x13d1eb
movq 0x70(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x13d1b3
jmp 0x13d1eb
movq 0x4fede6(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d8e4f(%rip), %rsi    # 0x516013
leaq 0x3d8ff4(%rip), %rdx    # 0x5161bf
leaq 0x40d8b2(%rip), %rcx    # 0x54aa84
leaq 0x40d62d(%rip), %r8     # 0x54a806
movl $0x4ad, %r9d            # imm = 0x4AD
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x13d1ed
movl $0x800, %edi            # imm = 0x800
leaq 0x40d60d(%rip), %rsi    # 0x54a806
movl $0x4af, %edx            # imm = 0x4AF
callq 0xe80f0
movq %rax, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
cmpq $0x100, 0x50(%rsp)      # imm = 0x100
jae 0x13d244
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
movabsq $-0x5555333355553334, %rdx # imm = 0xAAAACCCCAAAACCCC
movq %rdx, (%rax,%rcx,8)
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x13d211
movq 0x70(%rsp), %rdi
movq 0x48(%rsp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x13d930
movl %eax, 0x68(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0x13d2bc
movq $0x0, 0x50(%rsp)
cmpq $0x100, 0x50(%rsp)      # imm = 0x100
jae 0x13d29f
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
movabsq $-0x5555333355553334, %rdx # imm = 0xAAAACCCCAAAACCCC
movq %rdx, (%rax,%rcx,8)
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x13d26c
movq 0x70(%rsp), %rdi
movq 0x48(%rsp), %rsi
movl $0x20, %edx
movl $0x3ffc, %ecx           # imm = 0x3FFC
callq 0x13de70
movl %eax, 0x68(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0x13d444
movq 0x48(%rsp), %rdi
movl $0x20, %esi
movl $0x3ffc, %edx           # imm = 0x3FFC
callq 0x13a230
movq %rax, 0x40(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0x13d327
cmpq $0x0, 0x40(%rsp)
jne 0x13d325
movq 0x70(%rsp), %rdi
leaq 0x3f22ff(%rip), %rsi    # 0x52f5fa
leaq 0x40d56e(%rip), %rdx    # 0x54a870
leaq 0x40d77b(%rip), %rcx    # 0x54aa84
leaq 0x40d4f6(%rip), %r8     # 0x54a806
movl $0x4c9, %r9d            # imm = 0x4C9
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x68(%rsp) # imm = 0xFFFFFFFF
jmp 0x13d327
jmp 0x13d329
cmpq $0x0, 0x40(%rsp)
je 0x13d442
movq $0x1, 0x50(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x68(%rsp)
movb %al, 0x7(%rsp)
jne 0x13d35b
cmpq $0x3ffc, 0x50(%rsp)     # imm = 0x3FFC
setb %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x13d368
jmp 0x13d438
jmp 0x13d36a
cmpl $0x0, 0x68(%rsp)
jne 0x13d3c7
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rsi
subq $0x1, %rsi
callq 0x13ad10
movl %eax, %ecx
movl $0x1, %eax
cmpl %ecx, %eax
je 0x13d3c5
movq 0x70(%rsp), %rdi
leaq 0x3f225f(%rip), %rsi    # 0x52f5fa
leaq 0x40d706(%rip), %rdx    # 0x54aaa8
leaq 0x40d6db(%rip), %rcx    # 0x54aa84
leaq 0x40d456(%rip), %r8     # 0x54a806
movl $0x4ce, %r9d            # imm = 0x4CE
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x68(%rsp) # imm = 0xFFFFFFFF
jmp 0x13d3c7
jmp 0x13d3c9
jmp 0x13d3cb
cmpl $0x0, 0x68(%rsp)
jne 0x13d421
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x13ad10
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x13d41f
movq 0x70(%rsp), %rdi
leaq 0x3f2205(%rip), %rsi    # 0x52f5fa
leaq 0x40d6e0(%rip), %rdx    # 0x54aadc
leaq 0x40d681(%rip), %rcx    # 0x54aa84
leaq 0x40d3fc(%rip), %r8     # 0x54a806
movl $0x4cf, %r9d            # imm = 0x4CF
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x68(%rsp) # imm = 0xFFFFFFFF
jmp 0x13d421
jmp 0x13d423
jmp 0x13d425
movq 0x50(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x50(%rsp)
jmp 0x13d33e
movq 0x40(%rsp), %rdi
callq 0x13d090
jmp 0x13d444
movq 0x48(%rsp), %rax
movq $0x0, 0x400(%rax)
movq 0x48(%rsp), %rax
movq $-0x1, 0x408(%rax)
cmpl $0x0, 0x68(%rsp)
jne 0x13d68f
movq 0x48(%rsp), %rdi
movl $0x20, %esi
movl $0x3ffc, %edx           # imm = 0x3FFC
callq 0x13a230
movq %rax, 0x40(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0x13d4cf
cmpq $0x0, 0x40(%rsp)
jne 0x13d4cd
movq 0x70(%rsp), %rdi
leaq 0x3f2157(%rip), %rsi    # 0x52f5fa
leaq 0x40d3c6(%rip), %rdx    # 0x54a870
leaq 0x40d5d3(%rip), %rcx    # 0x54aa84
leaq 0x40d34e(%rip), %r8     # 0x54a806
movl $0x4da, %r9d            # imm = 0x4DA
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x68(%rsp) # imm = 0xFFFFFFFF
jmp 0x13d4cf
jmp 0x13d4d1
cmpq $0x0, 0x40(%rsp)
je 0x13d68d
movq 0x40(%rsp), %rdi
movl $0x3f, %esi
callq 0x13b130
movq %rax, 0x38(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0x13d538
cmpq $0x20, 0x38(%rsp)
je 0x13d536
movq 0x70(%rsp), %rdi
leaq 0x3f20ee(%rip), %rsi    # 0x52f5fa
leaq 0x40d5f9(%rip), %rdx    # 0x54ab0c
leaq 0x40d56a(%rip), %rcx    # 0x54aa84
leaq 0x40d2e5(%rip), %r8     # 0x54a806
movl $0x4e1, %r9d            # imm = 0x4E1
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x68(%rsp) # imm = 0xFFFFFFFF
jmp 0x13d538
jmp 0x13d53a
movq $0x3f, 0x50(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x68(%rsp)
movb %al, 0x6(%rsp)
jne 0x13d560
cmpq $0x3ffc, 0x50(%rsp)     # imm = 0x3FFC
setb %al
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
testb $0x1, %al
jne 0x13d56d
jmp 0x13d608
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x13b130
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x13b2c0
movq %rax, 0x30(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0x13d5ec
movq 0x38(%rsp), %rax
addq 0x30(%rsp), %rax
movq 0x50(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
je 0x13d5ea
movq 0x70(%rsp), %rdi
leaq 0x3f203a(%rip), %rsi    # 0x52f5fa
leaq 0x40d570(%rip), %rdx    # 0x54ab37
leaq 0x40d4b6(%rip), %rcx    # 0x54aa84
leaq 0x40d231(%rip), %r8     # 0x54a806
movl $0x4e7, %r9d            # imm = 0x4E7
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x68(%rsp) # imm = 0xFFFFFFFF
jmp 0x13d5ec
jmp 0x13d5ee
jmp 0x13d5f0
movq 0x50(%rsp), %rax
addq $0x1, %rax
addq 0x50(%rsp), %rax
movq %rax, 0x50(%rsp)
jmp 0x13d543
movq 0x40(%rsp), %rdi
movl $0x3ffb, %esi           # imm = 0x3FFB
callq 0x13b130
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movl $0x3ffb, %esi           # imm = 0x3FFB
callq 0x13b2c0
movq %rax, 0x30(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0x13d681
movq 0x38(%rsp), %rax
addq 0x30(%rsp), %rax
cmpq $0x3ffc, %rax           # imm = 0x3FFC
je 0x13d67f
movq 0x70(%rsp), %rdi
leaq 0x3f1fa5(%rip), %rsi    # 0x52f5fa
leaq 0x40d4f2(%rip), %rdx    # 0x54ab4e
leaq 0x40d421(%rip), %rcx    # 0x54aa84
leaq 0x40d19c(%rip), %r8     # 0x54a806
movl $0x4eb, %r9d            # imm = 0x4EB
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x68(%rsp) # imm = 0xFFFFFFFF
jmp 0x13d681
jmp 0x13d683
movq 0x40(%rsp), %rdi
callq 0x13d090
jmp 0x13d68f
cmpl $0x0, 0x68(%rsp)
jne 0x13d90d
movq 0x48(%rsp), %rdi
movl $0x20, %esi
movl $0x3ffc, %edx           # imm = 0x3FFC
callq 0x13a230
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x13d903
movq 0x40(%rsp), %rdi
movl $0x3ffb, %esi           # imm = 0x3FFB
callq 0x13b130
movq %rax, 0x28(%rsp)
movq $0x1, 0x50(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x68(%rsp)
movb %al, 0x5(%rsp)
jne 0x13d6fa
movq 0x50(%rsp), %rax
cmpq 0x28(%rsp), %rax
setbe %al
movb %al, 0x5(%rsp)
movb 0x5(%rsp), %al
testb $0x1, %al
jne 0x13d707
jmp 0x13d7e6
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x13b490
movq %rax, 0x20(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0x13d76e
movq 0x40(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x13ad10
cmpl $0x1, %eax
je 0x13d76c
movq 0x70(%rsp), %rdi
leaq 0x3f1eb8(%rip), %rsi    # 0x52f5fa
leaq 0x40d423(%rip), %rdx    # 0x54ab6c
leaq 0x40d334(%rip), %rcx    # 0x54aa84
leaq 0x40d0af(%rip), %r8     # 0x54a806
movl $0x4f7, %r9d            # imm = 0x4F7
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x68(%rsp) # imm = 0xFFFFFFFF
jmp 0x13d76e
jmp 0x13d770
movq 0x40(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x13b130
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0x13d7cf
movq 0x50(%rsp), %rax
cmpq 0x18(%rsp), %rax
je 0x13d7cd
movq 0x70(%rsp), %rdi
leaq 0x3f1e57(%rip), %rsi    # 0x52f5fa
leaq 0x40d3f6(%rip), %rdx    # 0x54aba0
leaq 0x40d2d3(%rip), %rcx    # 0x54aa84
leaq 0x40d04e(%rip), %r8     # 0x54a806
movl $0x4f9, %r9d            # imm = 0x4F9
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x68(%rsp) # imm = 0xFFFFFFFF
jmp 0x13d7cf
jmp 0x13d7d1
jmp 0x13d7d3
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x13d6dc
movq $0x1, 0x50(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x68(%rsp)
movb %al, 0x4(%rsp)
jne 0x13d815
movq 0x50(%rsp), %rax
movl $0x3ffc, %ecx           # imm = 0x3FFC
subq 0x28(%rsp), %rcx
cmpq %rcx, %rax
setbe %al
movb %al, 0x4(%rsp)
movb 0x4(%rsp), %al
testb $0x1, %al
jne 0x13d822
jmp 0x13d901
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x13bdf0
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0x13d889
movq 0x40(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x13ad10
cmpl $0x0, %eax
je 0x13d887
movq 0x70(%rsp), %rdi
leaq 0x3f1d9d(%rip), %rsi    # 0x52f5fa
leaq 0x40d349(%rip), %rdx    # 0x54abad
leaq 0x40d219(%rip), %rcx    # 0x54aa84
leaq 0x40cf94(%rip), %r8     # 0x54a806
movl $0x4fd, %r9d            # imm = 0x4FD
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x68(%rsp) # imm = 0xFFFFFFFF
jmp 0x13d889
jmp 0x13d88b
movq 0x40(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x13b2c0
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0x13d8ea
movq 0x50(%rsp), %rax
cmpq 0x8(%rsp), %rax
je 0x13d8e8
movq 0x70(%rsp), %rdi
leaq 0x3f1d3c(%rip), %rsi    # 0x52f5fa
leaq 0x40d31c(%rip), %rdx    # 0x54abe1
leaq 0x40d1b8(%rip), %rcx    # 0x54aa84
leaq 0x40cf33(%rip), %r8     # 0x54a806
movl $0x4ff, %r9d            # imm = 0x4FF
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x68(%rsp) # imm = 0xFFFFFFFF
jmp 0x13d8ea
jmp 0x13d8ec
jmp 0x13d8ee
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x13d7ef
jmp 0x13d903
movq 0x40(%rsp), %rdi
callq 0x13d090
movq 0x48(%rsp), %rdi
leaq 0x40ceed(%rip), %rsi    # 0x54a806
movl $0x505, %edx            # imm = 0x505
callq 0xe88c0
movl 0x68(%rsp), %eax
addq $0x78, %rsp
retq
nopl (%rax)