// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/popcount_tab.c
// Function: gt_popcount_tab_unit_test
int gt_popcount_tab_unit_test(GtError *err)
{
  int had_err = 0;
  GtUword idx, jdx, popc_perm, init, offset,
                blockmask = gt_popcount_tab_perm_start(16U);
  unsigned int popcount_c, class_size;
  const unsigned int blocksize = 4U;
  const GtUword blocksize_four[] =
    {0, 1UL, 2UL, 4UL, 8UL, 3UL, 5UL, 6UL,
     9UL, 10UL, 12UL, 7UL, 11UL, 13UL, 14UL, 15UL};
  const unsigned int offsets_bits[] = {1U, 3U, 3U, 3U, 1U};
  GtPopcountTab *popcount_t = gt_popcount_tab_new((unsigned) blocksize);

  gt_error_check(err);

  for (idx = 0; !had_err && idx <= (GtUword) blocksize; idx++) {
    gt_ensure(
              gt_popcount_tab_offset_bits(popcount_t, (unsigned int) idx) ==
                offsets_bits[idx]);
  }

  for (idx = 0; !had_err && idx < (1UL << blocksize); idx++) {
    gt_ensure(blocksize_four[idx] ==
              gt_compact_ulong_store_get(popcount_t->blocks, idx));
  }
  for (popcount_c = 0, idx = 0;
       !had_err && popcount_c <= blocksize;
       idx += class_size,
       popcount_c++) {
    class_size = (unsigned int)
      gt_combinatorics_binomial_ln((GtUword) blocksize,
                                   (GtUword) popcount_c);
    for (jdx = 0;
         !had_err && jdx < (GtUword) class_size;
         jdx++) {
      gt_ensure(idx ==
                gt_compact_ulong_store_get(popcount_t->offsets,
                                           (GtUword) popcount_c));
      gt_ensure(
                blocksize_four[idx + jdx] ==
                          (GtUword) gt_popcount_tab_get(popcount_t,
                                                              popcount_c, jdx));
    }
  }
  gt_ensure(gt_popcount_tab_rank_1(popcount_t, 2U, 0UL, 1U) == 0U);
  gt_ensure(gt_popcount_tab_rank_0(popcount_t, 2U, 0UL, 1U) == 2U);
  gt_ensure(gt_popcount_tab_rank_1(popcount_t, 2U, 1UL, 0U) == 0U);
  gt_ensure(gt_popcount_tab_rank_0(popcount_t, 2U, 1UL, 0U) == 1U);
  gt_ensure(gt_popcount_tab_rank_1(popcount_t, 2U, 1UL, 1U) == 1U);
  gt_ensure(gt_popcount_tab_rank_0(popcount_t, 2U, 1UL, 1U) == 1U);
  gt_ensure(gt_popcount_tab_rank_1(popcount_t, 2U, 1UL, 2U) == 1U);
  gt_ensure(gt_popcount_tab_rank_0(popcount_t, 2U, 1UL, 2U) == 2U);
  gt_ensure(gt_popcount_tab_rank_1(popcount_t, 4U, 0UL, 1U) == 2U);

  for (idx = 0; !had_err && idx < (1UL << blocksize); idx++) {
    popcount_c = gt_popcount_tab_class(popcount_t, idx);
    offset = gt_popcount_tab_get_offset_for_block(popcount_t, idx);

    for (jdx = 0; !had_err && jdx < (GtUword) blocksize; jdx++) {
      gt_ensure(
                gt_popcount_tab_rank_1(popcount_t, popcount_c,
                                       offset, (unsigned int) jdx) +
                  gt_popcount_tab_rank_0(popcount_t, popcount_c,
                                         offset, (unsigned int) jdx) ==
                  (unsigned int) jdx + 1U);
    }
  }

  if (!had_err) {
    offset = gt_popcount_tab_get_offset_for_block(popcount_t, 4UL);
    gt_ensure(offset == 2UL);
    offset = gt_popcount_tab_get_offset_for_block(popcount_t, 15UL);
    gt_ensure(offset == 0);
  }
  gt_popcount_tab_delete(popcount_t);

  if (!had_err) {
    popcount_t = gt_popcount_tab_new(10U);
    for (idx = 0; !had_err && idx < 1UL<<10UL; idx++) {
      offset = gt_popcount_tab_get_offset_for_block(popcount_t, idx);
      popcount_c = gt_popcount_tab_popcount(idx);
      jdx = gt_popcount_tab_get(popcount_t, popcount_c, offset);
      gt_ensure(idx == jdx);
    }
    gt_popcount_tab_delete(popcount_t);
    popc_perm = init = gt_popcount_tab_perm_start(5U);
    while (!had_err && popc_perm >= init) {
      gt_ensure(gt_popcount_tab_popcount(popc_perm) == 5U);
      popc_perm = gt_popcount_tab_next_perm(popc_perm) & blockmask;
    }
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl $0x4, %edi
callq 0x16be7c
movq %rax, 0x8(%rsp)
testq %rbx, %rbx
je 0x16c517
movq %rbx, %rdi
callq 0x101a9a
testb %al, %al
jne 0x16cd43
movq %rbx, (%rsp)
leaq 0x22afde(%rip), %r12    # 0x397500
leaq 0x22a913(%rip), %r15    # 0x396e3c
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x16c234
movl %eax, %ebx
movl (%r12), %r14d
movl $0x0, %r13d
cmpl %r14d, %eax
je 0x16c577
movq (%rsp), %rdi
leaq 0x1fafe7(%rip), %rsi    # 0x36753a
leaq 0x22ab04(%rip), %rdx    # 0x39705e
leaq 0x22aae3(%rip), %rcx    # 0x397044
movq %r15, %r8
movl $0x16b, %r9d            # imm = 0x16B
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpl %r14d, %ebx
jne 0x16c58d
leaq 0x1(%rbp), %rax
addq $0x4, %r12
cmpq $0x4, %rbp
movq %rax, %rbp
jb 0x16c52b
cmpl %r14d, %ebx
jne 0x16c60a
leaq 0x22aee7(%rip), %r12    # 0x397480
leaq 0x22a89c(%rip), %r15    # 0x396e3c
xorl %ebp, %ebp
movq (%r12), %r14
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movq %rbp, %rsi
callq 0xe80ec
movq %rax, %rbx
movl $0x0, %r13d
cmpq %rax, %r14
je 0x16c5f4
movq (%rsp), %rdi
leaq 0x1faf6a(%rip), %rsi    # 0x36753a
leaq 0x22aad8(%rip), %rdx    # 0x3970af
leaq 0x22aa66(%rip), %rcx    # 0x397044
movq %r15, %r8
movl $0x170, %r9d            # imm = 0x170
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpq %rbx, %r14
jne 0x16c60a
leaq 0x1(%rbp), %rax
addq $0x8, %r12
cmpq $0xf, %rbp
movq %rax, %rbp
jb 0x16c5a2
testl %r13d, %r13d
sete %al
jne 0x16c71c
xorl %r15d, %r15d
xorl %ebp, %ebp
movl $0x4, %edi
movq %r15, %rsi
callq 0xe7dab
movq %rax, %rbx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
andq %rax, %rbx
je 0x16c700
leaq (,%rbp,8), %rax
movq %rax, 0x10(%rsp)
xorl %r12d, %r12d
movq 0x8(%rsp), %r13
movq 0x10(%r13), %rdi
movq %r15, %rsi
callq 0xe80ec
cmpq %rax, %rbp
jne 0x16c68e
movq 0x10(%rsp), %rax
leaq (%rax,%r12,8), %rax
leaq 0x22ae11(%rip), %rcx    # 0x397480
movq (%rcx,%rax), %r14
movq %r13, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0x16c104
cmpq %rax, %r14
jne 0x16c6b9
xorl %r13d, %r13d
movb $0x1, %r14b
jmp 0x16c6ef
xorl %r14d, %r14d
movq (%rsp), %rdi
leaq 0x1fae9e(%rip), %rsi    # 0x36753a
leaq 0x22aa57(%rip), %rdx    # 0x3970fa
leaq 0x22a99a(%rip), %rcx    # 0x397044
leaq 0x22a78b(%rip), %r8     # 0x396e3c
movl $0x17e, %r9d            # imm = 0x17E
jmp 0x16c6e2
xorl %r14d, %r14d
movq (%rsp), %rdi
leaq 0x1fae73(%rip), %rsi    # 0x36753a
leaq 0x22aa79(%rip), %rdx    # 0x397147
leaq 0x22a96f(%rip), %rcx    # 0x397044
leaq 0x22a760(%rip), %r8     # 0x396e3c
movl $0x182, %r9d            # imm = 0x182
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testb %r14b, %r14b
je 0x16c700
incq %r12
cmpq %rbx, %r12
jb 0x16c649
testl %r13d, %r13d
sete %al
jne 0x16c71c
addq %rbx, %rbp
leaq 0x1(%r15), %rcx
cmpq $0x4, %r15
movq %rcx, %r15
jb 0x16c61b
testb %al, %al
je 0x16c76d
movq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x2, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x16c2bd
testl %eax, %eax
movq (%rsp), %rbx
je 0x16c779
leaq 0x1fadf2(%rip), %rsi    # 0x36753a
leaq 0x22aa50(%rip), %rdx    # 0x39719f
leaq 0x22a8ee(%rip), %rcx    # 0x397044
leaq 0x22a6df(%rip), %r8     # 0x396e3c
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x185, %r9d            # imm = 0x185
jmp 0x16c9b4
xorl %ebp, %ebp
movq 0x8(%rsp), %r15
jmp 0x16c9bb
movq %r15, %rdi
movl $0x2, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x16c2bd
testl %eax, %eax
je 0x16c7bd
leaq 0x1fada2(%rip), %rsi    # 0x36753a
leaq 0x22aa36(%rip), %rdx    # 0x3971d5
leaq 0x22a89e(%rip), %rcx    # 0x397044
leaq 0x22a68f(%rip), %r8     # 0x396e3c
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x186, %r9d            # imm = 0x186
jmp 0x16c9b4
movl $0x1, %edx
movq %r15, %rdi
movl $0x2, %esi
xorl %ecx, %ecx
callq 0x16c2bd
testl %eax, %eax
je 0x16c801
leaq 0x1fad5e(%rip), %rsi    # 0x36753a
leaq 0x22aa28(%rip), %rdx    # 0x39720b
leaq 0x22a85a(%rip), %rcx    # 0x397044
leaq 0x22a64b(%rip), %r8     # 0x396e3c
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x187, %r9d            # imm = 0x187
jmp 0x16c9b4
movl $0x1, %edx
movq %r15, %rdi
movl $0x2, %esi
xorl %ecx, %ecx
callq 0x16c2bd
testl %eax, %eax
je 0x16c845
leaq 0x1fad1a(%rip), %rsi    # 0x36753a
leaq 0x22aa1a(%rip), %rdx    # 0x397241
leaq 0x22a816(%rip), %rcx    # 0x397044
leaq 0x22a607(%rip), %r8     # 0x396e3c
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x188, %r9d            # imm = 0x188
jmp 0x16c9b4
movl $0x1, %edx
movq %r15, %rdi
movl $0x2, %esi
movl $0x1, %ecx
callq 0x16c2bd
cmpl $0x1, %eax
jne 0x16c912
movl $0x1, %edx
movq %r15, %rdi
movl $0x2, %esi
movl $0x1, %ecx
callq 0x16c2bd
cmpl $0x1, %eax
jne 0x16c93b
movl $0x1, %edx
movq %r15, %rdi
movl $0x2, %esi
movl $0x2, %ecx
callq 0x16c2bd
cmpl $0x1, %eax
jne 0x16c964
movl $0x1, %edx
movq %r15, %rdi
movl $0x2, %esi
movl $0x2, %ecx
callq 0x16c2bd
cmpl $0x1, %eax
jne 0x16c98d
movq %r15, %rdi
movl $0x4, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x16c2bd
movb $0x1, %bpl
cmpl $0x2, %eax
je 0x16c9bb
leaq 0x1fac4e(%rip), %rsi    # 0x36753a
leaq 0x22aa5c(%rip), %rdx    # 0x39734f
leaq 0x22a74a(%rip), %rcx    # 0x397044
leaq 0x22a53b(%rip), %r8     # 0x396e3c
xorl %ebp, %ebp
movq (%rsp), %rdi
movl $0x18d, %r9d            # imm = 0x18D
jmp 0x16c9b4
leaq 0x1fac21(%rip), %rsi    # 0x36753a
leaq 0x22a957(%rip), %rdx    # 0x397277
leaq 0x22a71d(%rip), %rcx    # 0x397044
leaq 0x22a50e(%rip), %r8     # 0x396e3c
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x189, %r9d            # imm = 0x189
jmp 0x16c9b4
leaq 0x1fabf8(%rip), %rsi    # 0x36753a
leaq 0x22a964(%rip), %rdx    # 0x3972ad
leaq 0x22a6f4(%rip), %rcx    # 0x397044
leaq 0x22a4e5(%rip), %r8     # 0x396e3c
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x18a, %r9d            # imm = 0x18A
jmp 0x16c9b4
leaq 0x1fabcf(%rip), %rsi    # 0x36753a
leaq 0x22a971(%rip), %rdx    # 0x3972e3
leaq 0x22a6cb(%rip), %rcx    # 0x397044
leaq 0x22a4bc(%rip), %r8     # 0x396e3c
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x18b, %r9d            # imm = 0x18B
jmp 0x16c9b4
leaq 0x1faba6(%rip), %rsi    # 0x36753a
leaq 0x22a97e(%rip), %rdx    # 0x397319
leaq 0x22a6a2(%rip), %rcx    # 0x397044
leaq 0x22a493(%rip), %r8     # 0x396e3c
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x18c, %r9d            # imm = 0x18C
xorl %eax, %eax
callq 0x1019cf
movl %ebp, %ecx
testb %bpl, %bpl
je 0x16cab3
xorl %ebx, %ebx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x16c1bb
movl %eax, 0x1c(%rsp)
movq %r15, %rdi
movq %rbx, 0x20(%rsp)
movq %rbx, %rsi
callq 0x16c418
movq %rax, %rbp
xorl %r12d, %r12d
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %r15
movq %r15, %rdi
movl 0x1c(%rsp), %r14d
movl %r14d, %esi
movq %rbp, %rdx
movl %r12d, %ecx
callq 0x16c2bd
movl %eax, %ebx
leaq 0x1(%r12), %r13
testl %r14d, %r14d
je 0x16ca34
movl %r14d, %esi
leal 0x1(%r12), %r14d
movq %r15, %rdi
movq %rbp, %rdx
movl %r12d, %ecx
callq 0x16c2bd
subl %eax, %r14d
jmp 0x16ca37
movl %r13d, %r14d
addl %ebx, %r14d
leal 0x1(%r12), %ebx
cmpl %r14d, %ebx
sete %r15b
je 0x16ca75
movq (%rsp), %rdi
leaq 0x1faae7(%rip), %rsi    # 0x36753a
leaq 0x22a92b(%rip), %rdx    # 0x397385
leaq 0x22a5e3(%rip), %rcx    # 0x397044
leaq 0x22a3d4(%rip), %r8     # 0x396e3c
movl $0x199, %r9d            # imm = 0x199
xorl %eax, %eax
callq 0x1019cf
cmpl %r14d, %ebx
movq 0x10(%rsp), %rbp
jne 0x16ca8c
cmpq $0x3, %r12
movq %r13, %r12
jb 0x16c9f2
movl %r15d, %ecx
cmpl %r14d, %ebx
jne 0x16caae
movq 0x20(%rsp), %rdx
leaq 0x1(%rdx), %rbx
cmpq $0xf, %rdx
movq 0x8(%rsp), %r15
jb 0x16c9c8
jmp 0x16cab3
movq 0x8(%rsp), %r15
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testb %cl, %cl
je 0x16cb5d
movl $0x4, %esi
movq %r15, %rdi
callq 0x16c418
movq %rax, %rbx
xorl %r14d, %r14d
cmpq $0x2, %rax
je 0x16cb12
leaq 0x1faa54(%rip), %rsi    # 0x36753a
leaq 0x22a94b(%rip), %rdx    # 0x397438
leaq 0x22a550(%rip), %rcx    # 0x397044
leaq 0x22a341(%rip), %r8     # 0x396e3c
movq (%rsp), %rdi
movl $0x19f, %r9d            # imm = 0x19F
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl $0xf, %esi
movq %r15, %rdi
callq 0x16c418
cmpq $0x2, %rbx
jne 0x16cb5d
testq %rax, %rax
je 0x16cb5d
leaq 0x1faa09(%rip), %rsi    # 0x36753a
leaq 0x1fb659(%rip), %rdx    # 0x368191
leaq 0x22a505(%rip), %rcx    # 0x397044
leaq 0x22a2f6(%rip), %r8     # 0x396e3c
movq (%rsp), %rdi
movl $0x1a1, %r9d            # imm = 0x1A1
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movq %r15, %rdi
callq 0x16c0ae
testl %r14d, %r14d
jne 0x16cd32
movabsq $0x3333333333333333, %r13 # imm = 0x3333333333333333
movabsq $0x101010101010101, %r14 # imm = 0x101010101010101
movl $0xa, %edi
callq 0x16be7c
movq %rax, %rbx
xorl %eax, %eax
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
callq 0x16c418
movl %r12d, %ecx
shrl %ecx
andl $0x155, %ecx            # imm = 0x155
movq %r12, %rdx
subq %rcx, %rdx
movq %rdx, %rcx
andq %r13, %rcx
shrq $0x2, %rdx
andq %r13, %rdx
addq %rcx, %rdx
movq %rdx, %rsi
shrq $0x4, %rsi
addq %rdx, %rsi
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rsi
imulq %r14, %rsi
shrq $0x38, %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x16c104
movq %rax, %r15
movl $0x0, %ebp
cmpq %rax, %r12
je 0x16cc29
movq (%rsp), %rdi
leaq 0x1fa938(%rip), %rsi    # 0x36753a
leaq 0x22a83d(%rip), %rdx    # 0x397446
leaq 0x22a434(%rip), %rcx    # 0x397044
leaq 0x22a225(%rip), %r8     # 0x396e3c
movl $0x1ab, %r9d            # imm = 0x1AB
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq %r15, %r12
jne 0x16cc40
leaq 0x1(%r12), %rax
cmpq $0x3ff, %r12            # imm = 0x3FF
jb 0x16cb91
movq %rbx, %rdi
callq 0x16c0ae
cmpq %r15, %r12
jne 0x16cd32
movl $0x1f, %r12d
movabsq $-0x100000000000000, %rsi # imm = 0xFF00000000000000
movabsq $0x500000000000000, %r15 # imm = 0x500000000000000
movl %r12d, %eax
shrl %eax
andl $0x5555, %eax           # imm = 0x5555
movq %r12, %rcx
subq %rax, %rcx
movq %rcx, %rax
andq %r13, %rax
shrq $0x2, %rcx
andq %r13, %rcx
addq %rax, %rcx
movq %rcx, %rbx
shrq $0x4, %rbx
addq %rcx, %rbx
movabsq $0xf0f0f0f0f0f0f0f, %rax # imm = 0xF0F0F0F0F0F0F0F
andq %rax, %rbx
imulq %r14, %rbx
andq %rsi, %rbx
movl $0x0, %ebp
cmpq %r15, %rbx
je 0x16cceb
movq (%rsp), %rdi
movq %rsi, %rbp
leaq 0x1fa879(%rip), %rsi    # 0x36753a
leaq 0x22a789(%rip), %rdx    # 0x397451
leaq 0x22a375(%rip), %rcx    # 0x397044
leaq 0x22a166(%rip), %r8     # 0x396e3c
movl $0x1b0, %r9d            # imm = 0x1B0
xorl %eax, %eax
callq 0x1019cf
movq %rbp, %rsi
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq -0x1(%r12), %rdx
orq %r12, %rdx
leaq 0x1(%rdx), %rax
notq %rdx
andq %rax, %rdx
shrq %rdx
addq $0xffff, %rdx           # imm = 0xFFFF
andq %r12, %rdx
bsfq %rdx, %rcx
movq %rdx, %r12
shrq %cl, %r12
testq %rdx, %rdx
cmoveq %rdx, %r12
cmpq %r15, %rbx
jne 0x16cd32
andl $0xfffe, %eax           # imm = 0xFFFE
orq %rax, %r12
cmpq $0x1e, %r12
ja 0x16cc6b
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4f835