// File: /workspace/github_c_makefile_star2_O3/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, %r15
callq 0x11fe0c
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
andl %ebp, %eax
imulq $0x14f8b589, %rax, %rcx # imm = 0x14F8B589
shrq $0x2d, %rcx
imull $0x186a0, %ecx, %ecx    # imm = 0x186A0
movl %eax, %ebx
subl %ecx, %ebx
negl %ecx
leal (%rax,%rcx), %r12d
incl %r12d
callq 0x11fe0c
movl %eax, %r14d
andl %ebp, %r14d
imulq $0x3e0f83e1, %r14, %rax # imm = 0x3E0F83E1
shrq $0x23, %rax
movl %eax, %ecx
shll $0x5, %ecx
addl %eax, %ecx
subl %ecx, %r14d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %r14d, %ecx
shll %cl, %edx
cmpl $0x20, %r14d
notl %edx
cmovel %eax, %edx
movl %edx, 0x20(%rsp)
leaq 0x287884(%rip), %rdi    # 0x360e9a
movq %r12, %rsi
xorl %eax, %eax
callq 0x103d72
leal 0x4(,%rbx,4), %ebp
leaq 0x287495(%rip), %rsi    # 0x360ac3
movq %rbp, %rdi
movl $0x34, %edx
callq 0x104226
movq %rax, %r13
leaq 0x287693(%rip), %rsi    # 0x360cd8
movl $0x18, %edi
movl $0x48, %edx
callq 0x104226
testq %rax, %rax
movq %r14, 0x10(%rsp)
je 0xd96b3
movq %rax, %rbx
movl %r14d, %eax
imull %r12d, %eax
movl %eax, %edi
shrl $0x3, %edi
andl $0x7, %eax
cmpl $0x1, %eax
sbbq $-0x1, %rdi
leaq 0x28765a(%rip), %rdx    # 0x360cd8
movl $0x1, %esi
movl $0x4c, %ecx
callq 0x10436a
movq %rax, (%rbx)
testq %rax, %rax
je 0xd969f
movl %r14d, 0x10(%rbx)
movq %r12, 0x8(%rbx)
jmp 0xd96b5
leaq 0x287632(%rip), %rsi    # 0x360cd8
movq %rbx, %rdi
movl $0x4d, %edx
callq 0x1045eb
xorl %ebx, %ebx
leaq 0x287407(%rip), %rsi    # 0x360ac3
movq %rbp, %rdi
movl $0x36, %edx
callq 0x104226
movq %rax, %rbp
xorl %r14d, %r14d
callq 0x11fe0c
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, (%r13,%r14,4)
testq %rbx, %rbx
je 0xd9b84
cmpq %r14, 0x8(%rbx)
jbe 0xd9b84
movl 0x10(%rbx), %edx
cmpq $0x21, %rdx
jae 0xd9b84
movq (%rbx), %rdi
movq %rdx, %rsi
imulq %r14, %rsi
movl %eax, %ecx
callq 0x2f2738
incq %r14
cmpq %r14, %r12
jne 0xd96cf
movq %rbp, 0x8(%rsp)
movq %r15, 0x18(%rsp)
xorl %r14d, %r14d
cmpq %r14, 0x8(%rbx)
jbe 0xd9b89
movl 0x10(%rbx), %edx
cmpq $0x21, %rdx
jae 0xd9b89
movl (%r13,%r14,4), %ebp
andl 0x20(%rsp), %ebp
movq (%rbx), %rdi
movq %rdx, %rsi
imulq %r14, %rsi
callq 0x2f2688
cmpl %eax, %ebp
jne 0xd99e3
incq %r14
cmpq %r14, %r12
jne 0xd9724
leaq 0x287359(%rip), %r15    # 0x360ac3
movq %r13, %rdi
movq %r15, %rsi
movl $0x4c, %edx
callq 0x1045eb
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movl $0x4d, %edx
callq 0x1045eb
movq (%rbx), %rdi
leaq 0x287542(%rip), %r14    # 0x360cd8
movq %r14, %rsi
movl $0x5d, %edx
callq 0x1045eb
movq %rbx, %rdi
movq %r14, %rsi
movl $0x5e, %edx
callq 0x1045eb
leaq 0x2873a1(%rip), %rdi    # 0x360b5b
xorl %eax, %eax
callq 0x103d72
callq 0x11fe0c
movl %eax, %r13d
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
andl %ebp, %r13d
imulq $0x14f8b589, %r13, %rax # imm = 0x14F8B589
shrq $0x2d, %rax
imull $0x186a0, %eax, %r14d   # imm = 0x186A0
movl %r13d, %r12d
subl %r14d, %r12d
callq 0x11fe0c
andl %ebp, %eax
imulq $0x7e07e07f, %rax, %rdx # imm = 0x7E07E07F
shrq $0x25, %rdx
movl %edx, %ecx
shll $0x6, %ecx
addl %edx, %ecx
subl %ecx, %eax
movq $-0x1, %rdx
movq $-0x1, %rsi
movl %eax, %ecx
shlq %cl, %rsi
movq %rax, 0x8(%rsp)
cmpl $0x40, %eax
notq %rsi
cmoveq %rdx, %rsi
movq %rsi, 0x20(%rsp)
leal 0x8(,%r12,8), %ebp
movq %rbp, %rdi
movq %r15, %rsi
movl $0x5e, %edx
callq 0x104226
movq %rax, %r15
testq %rax, %rax
je 0xd9b16
leaq 0x287482(%rip), %rsi    # 0x360cd8
movl $0x18, %edi
movl $0x48, %edx
callq 0x104226
testq %rax, %rax
je 0xd9b14
movq %rax, %rbx
negl %r14d
leal (%r14,%r13), %r12d
incl %r12d
movq 0x8(%rsp), %r14
movq %r14, %rax
imulq %r12, %rax
movq %rax, %rdi
shrq $0x3, %rdi
andl $0x7, %eax
cmpq $0x1, %rax
sbbq $-0x1, %rdi
leaq 0x287438(%rip), %rdx    # 0x360cd8
movl $0x1, %esi
movl $0x4c, %ecx
callq 0x10436a
movq %rax, (%rbx)
testq %rax, %rax
je 0xd9b00
movl %r14d, 0x10(%rbx)
movq %r12, 0x8(%rbx)
leaq 0x2871f9(%rip), %rsi    # 0x360ac3
movq %rbp, %rdi
movl $0x60, %edx
callq 0x104226
testq %rax, %rax
je 0xd9b16
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
callq 0x11fe0c
movl %eax, %r14d
andl %ebp, %r14d
shlq $0x20, %r14
callq 0x11fe0c
andl %ebp, %eax
orq %r14, %rax
movq %rax, (%r15,%r13,8)
cmpq %r13, 0x8(%rbx)
jbe 0xd9b8e
movl 0x10(%rbx), %edx
cmpq $0x41, %rdx
jae 0xd9b8e
movq (%rbx), %rdi
movq %rdx, %rsi
imulq %r13, %rsi
movq %rax, %rcx
callq 0x2f388c
incq %r13
cmpq %r13, %r12
jne 0xd98ed
xorl %r14d, %r14d
cmpq %r14, 0x8(%rbx)
jbe 0xd9b93
movl 0x10(%rbx), %edx
cmpq $0x41, %rdx
jae 0xd9b93
movq (%r15,%r14,8), %rbp
andq 0x20(%rsp), %rbp
movq (%rbx), %rdi
movq %rdx, %rsi
imulq %r14, %rsi
callq 0x2f37dc
cmpq %rax, %rbp
jne 0xd9a51
incq %r14
cmpq %r14, %r12
jne 0xd993e
leaq 0x28713e(%rip), %r14    # 0x360ac3
movq %r15, %rdi
movq %r14, %rsi
movl $0x82, %edx
callq 0x1045eb
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movl $0x83, %edx
callq 0x1045eb
movq (%rbx), %rdi
leaq 0x287327(%rip), %r14    # 0x360cd8
movq %r14, %rsi
movl $0x5d, %edx
callq 0x1045eb
movq %rbx, %rdi
movq %r14, %rsi
movl $0x5e, %edx
callq 0x1045eb
leaq 0x2872c8(%rip), %rdi    # 0x360c9d
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x103d72
jmp 0xd9aef
movl %eax, %r15d
leaq 0x284a51(%rip), %rsi    # 0x35e43e
leaq 0x2870ec(%rip), %rdx    # 0x360ae0
leaq 0x2870f5(%rip), %rcx    # 0x360af0
leaq 0x2870c1(%rip), %r12    # 0x360ac3
movq 0x18(%rsp), %rdi
movq %r12, %r8
movl $0x40, %r9d
xorl %eax, %eax
callq 0xfcb67
leaq 0x2870ec(%rip), %rdi    # 0x360b0a
movl %ebp, %esi
movl %r15d, %edx
movq %r14, %rcx
movq 0x10(%rsp), %r8
xorl %eax, %eax
callq 0x103d72
movq %r13, %rdi
movq %r12, %rsi
movl $0x46, %edx
callq 0x1045eb
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movl $0x47, %edx
jmp 0xd9abe
movq %rax, %r13
leaq 0x2849e3(%rip), %rsi    # 0x35e43e
leaq 0x28707e(%rip), %rdx    # 0x360ae0
leaq 0x287087(%rip), %rcx    # 0x360af0
leaq 0x287053(%rip), %r12    # 0x360ac3
movq 0x18(%rsp), %rdi
movq %r12, %r8
movl $0x75, %r9d
xorl %eax, %eax
callq 0xfcb67
leaq 0x2871bc(%rip), %rdi    # 0x360c48
movq %rbp, %rsi
movq %r13, %rdx
movq %r14, %rcx
movq 0x8(%rsp), %r8
xorl %eax, %eax
callq 0x103d72
movq %r15, %rdi
movq %r12, %rsi
movl $0x7c, %edx
callq 0x1045eb
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movl $0x7d, %edx
callq 0x1045eb
movq (%rbx), %rdi
leaq 0x28720b(%rip), %r14    # 0x360cd8
movq %r14, %rsi
movl $0x5d, %edx
callq 0x1045eb
movq %rbx, %rdi
movq %r14, %rsi
movl $0x5e, %edx
callq 0x1045eb
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2871d1(%rip), %rsi    # 0x360cd8
movq %rbx, %rdi
movl $0x4d, %edx
callq 0x1045eb
xorl %ebx, %ebx
leaq 0x284921(%rip), %rsi    # 0x35e43e
leaq 0x287072(%rip), %rdx    # 0x360b96
leaq 0x286fc5(%rip), %rcx    # 0x360af0
leaq 0x286f91(%rip), %r8     # 0x360ac3
movq 0x18(%rsp), %rdi
movl $0x60, %r9d
xorl %eax, %eax
callq 0xfcb67
leaq 0x2870e2(%rip), %rdi    # 0x360c2d
callq 0x17690
testq %r15, %r15
je 0xd9b69
leaq 0x286f67(%rip), %rsi    # 0x360ac3
movq %r15, %rdi
movl $0x65, %edx
callq 0x1045eb
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rbx, %rbx
je 0xd9aef
movq %rbx, %rdi
callq 0xd9b98
jmp 0xd9aef
callq 0x25177
callq 0x250ce
callq 0x25105
callq 0x2513e