// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/checkbitpackarray.c
// Function: gt_bitpackarray_unit_test
int gt_bitpackarray_unit_test(GtError *err)
{
  struct BitPackArray *bitStore = NULL;
  int had_err = 0;
  {
    uint32_t *randSrc = NULL; /*< create random ints here for input as bit
                               *  store */
    uint32_t *randCmp = NULL, /*< used for random ints read back */
       mask;
    size_t i, numRnd;
    unsigned bits;
    numRnd = random() % MAX_RND_NUMS + 1;
    bits = random() % (sizeof (randSrc[0]) * CHAR_BIT + 1);
    if (bits == 32)
      mask = ~(uint32_t)0;
    else
      mask = ~((~(uint32_t)0)<<bits);

    gt_log_log("numRnd="GT_WU"\n", (GtUword)numRnd);
    randSrc = gt_malloc(sizeof (uint32_t)*numRnd);
    bitStore = bitpackarray_new(bits, numRnd,true);
    randCmp = gt_malloc(sizeof (uint32_t)*numRnd);
    for (i = 0; i < numRnd; ++i)
    {
      uint32_t v = randSrc[i] = random();
      bitpackarray_store_uint32(bitStore, i, v);
    }
    for (i = 0; i < numRnd; ++i)
    {
      uint32_t v = randSrc[i];
      uint32_t r = bitpackarray_get_uint32(bitStore, i);
      gt_ensure((v & mask) == r);
      if (had_err)
      {
        gt_log_log("gt_bsStoreUInt32/bitpackarray_get_uint32: "
                "Expected %"PRIu32", got %"PRIu32", i = "GT_WU", bits=%u\n",
                v & mask, r, (GtUword)i, bits);
        gt_free(randSrc);
        gt_free(randCmp);
        bitpackarray_delete(bitStore);
        return had_err;
      }
    }
  gt_free(randSrc);
  gt_free(randCmp);
  bitpackarray_delete(bitStore);
  }
  gt_log_log("bitpackarray_store_uint32/bitpackarray_get_uint32: passed\n");
  {
    uint64_t *randSrc = NULL; /*< create random ints here for input as bit
                        *  store */
    uint64_t *randCmp = NULL, /*< used for random ints read back */
       mask;
    size_t i, numRnd;
    unsigned bits;
    numRnd = random() % MAX_RND_NUMS + 1;
    bits = random() % (sizeof (randSrc[0]) * CHAR_BIT + 1);
    if (bits == (sizeof (randSrc[0]) * CHAR_BIT))
      mask = ~(uint64_t)0;
    else
      mask = ~((~(uint64_t)0)<<bits);
    gt_ensure((randSrc = gt_malloc(sizeof (uint64_t)*numRnd))
           && (bitStore = bitpackarray_new(bits, numRnd,true))
           && (randCmp = gt_malloc(sizeof (uint64_t)*numRnd)));
    if (had_err)
    {
      perror("Storage allocations failed");
      if (randSrc)
        gt_free(randSrc);
      if (randCmp)
        gt_free(randCmp);
      if (bitStore)
        bitpackarray_delete(bitStore);
      return had_err;
    }
    for (i = 0; i < numRnd; ++i)
    {
      uint64_t v = randSrc[i] = ((uint64_t)random() << 32 | random());
      bitpackarray_store_uint64(bitStore, i, v);
    }
    for (i = 0; i < numRnd; ++i)
    {
      uint64_t v = randSrc[i];
      uint64_t r = bitpackarray_get_uint64(bitStore, i);
      gt_ensure((v & mask) == r);
      if (had_err)
      {
        gt_log_log("gt_bsStoreUInt64/bitpackarray_get_uint64: "
                "Expected "GT_LLU", got "GT_LLU", i = "GT_WU", bits=%u\n",
                (GtUint64)(v & mask),
                (GtUint64)r, (GtUword)i, bits);
        gt_free(randSrc);
        gt_free(randCmp);
        bitpackarray_delete(bitStore);
        return had_err;
      }
    }
    gt_free(randSrc);
    gt_free(randCmp);
    bitpackarray_delete(bitStore);
  }
  gt_log_log("bitpackarray_store_uint64/bitpackarray_get_uint64: passed\n");
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
callq 0xb3a58
movl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
andl %r14d, %eax
xorl %ebp, %ebp
movl $0x186a0, %ecx          # imm = 0x186A0
xorl %edx, %edx
divl %ecx
movl %edx, %ebx
leal 0x1(%rbx), %r12d
callq 0xb3a58
andl %r14d, %eax
pushq $0x21
popq %rcx
xorl %edx, %edx
divl %ecx
movl %edx, %r14d
pushq $-0x1
popq %rax
movl %eax, %edx
movl %r14d, %ecx
shll %cl, %edx
cmpl $0x20, %r14d
notl %edx
cmovel %eax, %edx
movl %edx, 0x20(%rsp)
leaq 0x29fe28(%rip), %rdi    # 0x300e0a
movq %r12, %rsi
xorl %eax, %eax
callq 0x92a82
leal 0x4(,%rbx,4), %ebx
leaq 0x29fa39(%rip), %r13    # 0x300a33
pushq $0x34
popq %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x93160
movq %rax, %r15
movl %r14d, 0xc(%rsp)
movl %r14d, %edi
movq %r12, %rsi
callq 0x6148e
movq %rax, %r14
pushq $0x36
popq %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x93160
movq %rax, %rbx
cmpq %rbp, %r12
je 0x61079
callq 0xb3a58
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, (%r15,%rbp,4)
testq %r14, %r14
je 0x613d2
cmpq %rbp, 0x8(%r14)
jbe 0x613d2
movl 0x10(%r14), %edx
cmpq $0x21, %rdx
jae 0x613d2
movq (%r14), %rdi
movq %rdx, %rsi
imulq %rbp, %rsi
movl %eax, %ecx
callq 0x28ca84
incq %rbp
jmp 0x6102f
movq %rbx, 0x10(%rsp)
xorl %ebx, %ebx
cmpq %rbx, %r12
je 0x610cc
testq %r14, %r14
je 0x613fc
cmpq %rbx, 0x8(%r14)
jbe 0x613fc
movl 0x10(%r14), %edx
cmpq $0x21, %rdx
jae 0x613fc
movl (%r15,%rbx,4), %r13d
andl 0x20(%rsp), %r13d
movq (%r14), %rdi
movq %rdx, %rsi
imulq %rbx, %rsi
callq 0x28c984
cmpl %eax, %r13d
jne 0x61203
incq %rbx
jmp 0x61080
leaq 0x29f960(%rip), %rbx    # 0x300a33
pushq $0x4c
popq %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x936f9
pushq $0x4d
popq %rdx
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x936f9
movq %r14, %rdi
callq 0x61508
leaq 0x29f9cb(%rip), %rdi    # 0x300acb
xorl %eax, %eax
callq 0x92a82
callq 0xb3a58
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
andl %ebp, %eax
movl $0x186a0, %ecx          # imm = 0x186A0
xorl %edx, %edx
divl %ecx
movl %edx, %r13d
callq 0xb3a58
andl %ebp, %eax
pushq $0x41
popq %rcx
xorl %edx, %edx
divl %ecx
movl %edx, %ebp
pushq $-0x1
popq %rax
movq %rax, %rdx
movl %ebp, %ecx
shlq %cl, %rdx
cmpl $0x40, %ebp
notq %rdx
cmoveq %rax, %rdx
movq %rdx, 0x20(%rsp)
leal 0x8(,%r13,8), %r15d
pushq $0x5e
popq %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x93160
movq %rax, %r12
testq %rax, %rax
je 0x6137c
incl %r13d
movl %ebp, %edi
movq %r13, %rsi
callq 0x6148e
testq %rax, %rax
je 0x61379
movq %rax, %r14
leaq 0x29f8a8(%rip), %rsi    # 0x300a33
pushq $0x60
popq %rdx
movq %r15, %rdi
callq 0x93160
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x6137c
movl %ebp, 0xc(%rsp)
xorl %r15d, %r15d
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
cmpq %r15, %r13
je 0x6126d
callq 0xb3a58
movl %eax, %ebx
andl %ebp, %ebx
shlq $0x20, %rbx
callq 0xb3a58
andl %ebp, %eax
orq %rbx, %rax
movq %rax, (%r12,%r15,8)
cmpq %r15, 0x8(%r14)
jbe 0x61432
movl 0x10(%r14), %edx
cmpq $0x41, %rdx
jae 0x61432
movq (%r14), %rdi
movq %rdx, %rsi
imulq %r15, %rsi
movq %rax, %rcx
callq 0x28dfac
incq %r15
jmp 0x611b0
movl %eax, %ebp
leaq 0x29d1e6(%rip), %rsi    # 0x2fe3f2
leaq 0x29f83d(%rip), %rdx    # 0x300a50
leaq 0x29f846(%rip), %rcx    # 0x300a60
leaq 0x29f812(%rip), %r12    # 0x300a33
pushq $0x40
popq %r9
movq 0x18(%rsp), %rdi
movq %r12, %r8
xorl %eax, %eax
callq 0x89dbb
leaq 0x29f83f(%rip), %rdi    # 0x300a7a
movl %r13d, %esi
movl %ebp, %edx
movq %rbx, %rcx
movl 0xc(%rsp), %r8d
xorl %eax, %eax
callq 0x92a82
pushq $0x46
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x936f9
pushq $0x47
popq %rdx
movq 0x10(%rsp), %rdi
movq %r12, %rsi
jmp 0x61358
xorl %ebx, %ebx
cmpq %rbx, %r13
je 0x612ae
cmpq %rbx, 0x8(%r14)
jbe 0x61460
movl 0x10(%r14), %edx
cmpq $0x41, %rdx
jae 0x61460
movq (%r12,%rbx,8), %r15
andq 0x20(%rsp), %r15
movq (%r14), %rdi
movq %rdx, %rsi
imulq %rbx, %rsi
callq 0x28deac
cmpq %rax, %r15
jne 0x612f1
incq %rbx
jmp 0x6126f
leaq 0x29f77e(%rip), %rbx    # 0x300a33
movq %r12, %rdi
movq %rbx, %rsi
movl $0x82, %edx
callq 0x936f9
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movl $0x83, %edx
callq 0x936f9
movq %r14, %rdi
callq 0x61508
leaq 0x29f927(%rip), %rdi    # 0x300c0d
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x92a82
jmp 0x61368
movq %rax, %rbp
leaq 0x29d0f7(%rip), %rsi    # 0x2fe3f2
leaq 0x29f74e(%rip), %rdx    # 0x300a50
leaq 0x29f757(%rip), %rcx    # 0x300a60
leaq 0x29f723(%rip), %r13    # 0x300a33
pushq $0x75
popq %r9
movq 0x18(%rsp), %rdi
movq %r13, %r8
xorl %eax, %eax
callq 0x89dbb
leaq 0x29f88e(%rip), %rdi    # 0x300bb8
movq %r15, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
movl 0xc(%rsp), %r8d
xorl %eax, %eax
callq 0x92a82
pushq $0x7c
popq %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x936f9
pushq $0x7d
popq %rdx
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x936f9
movq %r14, %rdi
callq 0x61508
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
leaq 0x29d06f(%rip), %rsi    # 0x2fe3f2
leaq 0x29f77c(%rip), %rdx    # 0x300b06
leaq 0x29f6cf(%rip), %rcx    # 0x300a60
leaq 0x29f69b(%rip), %r8     # 0x300a33
pushq $0x60
popq %r9
movq 0x18(%rsp), %rdi
xorl %eax, %eax
callq 0x89dbb
leaq 0x29f7ee(%rip), %rdi    # 0x300b9d
callq 0x17660
testq %r12, %r12
je 0x613cb
leaq 0x29f673(%rip), %rsi    # 0x300a33
pushq $0x65
popq %rdx
movq %r12, %rdi
callq 0x936f9
testq %r14, %r14
jne 0x6135d
jmp 0x61365
movq 0x3d6b8f(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x283c30(%rip), %rsi    # 0x2e5013
leaq 0x29f8b6(%rip), %rdx    # 0x300ca0
leaq 0x29f8ff(%rip), %rcx    # 0x300cf0
leaq 0x29f850(%rip), %r8     # 0x300c48
pushq $0x6c
jmp 0x61424
movq 0x3d6b65(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x283c06(%rip), %rsi    # 0x2e5013
leaq 0x29f8f6(%rip), %rdx    # 0x300d0a
leaq 0x29f944(%rip), %rcx    # 0x300d5f
leaq 0x29f826(%rip), %r8     # 0x300c48
pushq $0x7e
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x3d6b2f(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x283bd0(%rip), %rsi    # 0x2e5013
leaq 0x29f856(%rip), %rdx    # 0x300ca0
leaq 0x29f926(%rip), %rcx    # 0x300d77
leaq 0x29f7f0(%rip), %r8     # 0x300c48
movl $0x8e, %r9d
jmp 0x61426
movq 0x3d6b01(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x283ba2(%rip), %rsi    # 0x2e5013
leaq 0x29f919(%rip), %rdx    # 0x300d91
leaq 0x29f967(%rip), %rcx    # 0x300de6
leaq 0x29f7c2(%rip), %r8     # 0x300c48
movl $0x9e, %r9d
jmp 0x61426