// File: /workspace/github_c_makefile_star2_O1/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 $0x38, %rsp
movq %rdi, 0x30(%rsp)
callq 0x125bcc
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 0x125bcc
movl %eax, %r15d
andl %ebp, %r15d
imulq $0x3e0f83e1, %r15, %rax # imm = 0x3E0F83E1
shrq $0x23, %rax
movl %eax, %ecx
shll $0x5, %ecx
addl %eax, %ecx
subl %ecx, %r15d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %r15d, %ecx
shll %cl, %edx
cmpl $0x20, %r15d
notl %edx
cmovel %eax, %edx
movl %edx, 0x10(%rsp)
leaq 0x28e34a(%rip), %rdi    # 0x369faa
movq %r12, %rsi
xorl %eax, %eax
callq 0x108e02
leal 0x4(,%rbx,4), %r14d
leaq 0x28df5a(%rip), %rsi    # 0x369bd3
movq %r14, %rdi
movl $0x34, %edx
callq 0x1092b2
movq %rax, %rbp
leaq 0x28e158(%rip), %rsi    # 0x369de8
movl $0x18, %edi
movl $0x48, %edx
callq 0x1092b2
movq %rax, %rbx
testq %rax, %rax
je 0xdbcfb
movl %r15d, %eax
imull %r12d, %eax
movl %eax, %edi
shrl $0x3, %edi
andl $0x7, %eax
cmpl $0x1, %eax
sbbq $-0x1, %rdi
leaq 0x28e124(%rip), %rdx    # 0x369de8
movl $0x1, %esi
movl $0x4c, %ecx
callq 0x1093ef
movq %rax, (%rbx)
testq %rax, %rax
je 0xdbce5
movl %r15d, 0x10(%rbx)
movq %r12, 0x8(%rbx)
jmp 0xdbcfb
leaq 0x28e0fc(%rip), %rsi    # 0x369de8
movq %rbx, %rdi
movl $0x4d, %edx
callq 0x109670
xorl %ebx, %ebx
leaq 0x28ded1(%rip), %rsi    # 0x369bd3
movq %r14, %rdi
movl $0x36, %edx
callq 0x1092b2
movq %rax, %r13
xorl %r14d, %r14d
callq 0x125bcc
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, (%rbp,%r14,4)
testq %rbx, %rbx
je 0xdc2a1
cmpq %r14, 0x8(%rbx)
jbe 0xdc2a1
movl 0x10(%rbx), %edx
cmpq $0x21, %rdx
jae 0xdc2a1
movq (%rbx), %rdi
movq %rdx, %rsi
imulq %r14, %rsi
movl %eax, %ecx
callq 0x2fbb6b
incq %r14
cmpq %r14, %r12
jne 0xdbd15
movq %r13, 0x20(%rsp)
movq %r12, 0x18(%rsp)
movq %r15, 0x28(%rsp)
xorl %r12d, %r12d
movb $0x1, %r13b
xorl %r14d, %r14d
movq %rbp, 0x8(%rsp)
cmpq %r14, 0x8(%rbx)
jbe 0xdc2ab
movl 0x10(%rbx), %edx
cmpq $0x21, %rdx
jae 0xdc2ab
movl (%rbp,%r14,4), %ebp
movq (%rbx), %rdi
movq %rdx, %rsi
imulq %r14, %rsi
callq 0x2fba84
movl %eax, %r15d
xorl %eax, %eax
testl %r12d, %r12d
jne 0xdbdea
movl %ebp, %ecx
andl 0x10(%rsp), %ecx
movb $0x1, %dl
cmpl %r15d, %ecx
je 0xdbdf1
movq 0x30(%rsp), %rdi
leaq 0x28b772(%rip), %rsi    # 0x36753a
leaq 0x28de21(%rip), %rdx    # 0x369bf0
leaq 0x28de2a(%rip), %rcx    # 0x369c00
leaq 0x28ddf6(%rip), %r8     # 0x369bd3
movl $0x40, %r9d
xorl %eax, %eax
callq 0x1019cf
xorl %edx, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb %dl, %dl
je 0xdbe1e
incq %r14
movl %eax, %r12d
cmpq 0x18(%rsp), %r14
setb %r13b
movq 0x8(%rsp), %rbp
jne 0xdbd7a
movl %edx, %r12d
movl $0x4d, %ebp
movl $0x4c, %edx
jmp 0xdbe4a
movl %edx, %r12d
andl 0x10(%rsp), %ebp
leaq 0x28ddee(%rip), %rdi    # 0x369c1a
movl %ebp, %esi
movl %r15d, %edx
movq %r14, %rcx
movq 0x28(%rsp), %r8
xorl %eax, %eax
callq 0x108e02
movl $0x47, %ebp
movl $0x46, %edx
leaq 0x28dd82(%rip), %r14    # 0x369bd3
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x109670
movq 0x20(%rsp), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x109670
movq (%rbx), %rdi
leaq 0x28df71(%rip), %r14    # 0x369de8
movq %r14, %rsi
movl $0x5d, %edx
callq 0x109670
movq %rbx, %rdi
movq %r14, %rsi
movl $0x5e, %edx
callq 0x109670
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x1, %r13b
jne 0xdc23c
leaq 0x28ddc1(%rip), %rdi    # 0x369c6b
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x108e02
callq 0x125bcc
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
andl %ebp, %eax
imulq $0x14f8b589, %rax, %rcx # imm = 0x14F8B589
shrq $0x2d, %rcx
imull $0x186a0, %ecx, %ecx    # imm = 0x186A0
negl %ecx
leal (%rax,%rcx), %r15d
incl %r15d
callq 0x125bcc
movl %eax, %r13d
andl %ebp, %r13d
imulq $0x7e07e07f, %r13, %rax # imm = 0x7E07E07F
shrq $0x25, %rax
movl %eax, %ecx
shll $0x6, %ecx
addl %eax, %ecx
subl %ecx, %r13d
movq $-0x1, %rax
movq $-0x1, %rdx
movl %r13d, %ecx
shlq %cl, %rdx
cmpl $0x40, %r13d
notq %rdx
cmoveq %rax, %rdx
movq %rdx, 0x10(%rsp)
testb %r12b, %r12b
movq %r15, 0x18(%rsp)
je 0xdbfb8
leaq (,%r15,8), %r14
leaq 0x28dc98(%rip), %rsi    # 0x369bd3
movq %r14, %rdi
movl $0x5e, %edx
callq 0x1092b2
movq %rax, %rbp
testq %rax, %rax
je 0xdbffd
leaq 0x28de8d(%rip), %rsi    # 0x369de8
movl $0x18, %edi
movl $0x48, %edx
callq 0x1092b2
movq %rax, %rbx
testq %rax, %rax
je 0xdbfd5
movq %r13, %rax
movq 0x18(%rsp), %r15
imulq %r15, %rax
movq %rax, %rdi
shrq $0x3, %rdi
andl $0x7, %eax
cmpq $0x1, %rax
sbbq $-0x1, %rdi
leaq 0x28de51(%rip), %rdx    # 0x369de8
movl $0x1, %esi
movl $0x4c, %ecx
callq 0x1093ef
movq %rax, (%rbx)
testq %rax, %rax
je 0xdbfbf
movl %r13d, 0x10(%rbx)
movq %r15, 0x8(%rbx)
jmp 0xdbfd5
xorl %ebp, %ebp
xorl %r15d, %r15d
jmp 0xdc031
leaq 0x28de22(%rip), %rsi    # 0x369de8
movq %rbx, %rdi
movl $0x4d, %edx
callq 0x109670
xorl %ebx, %ebx
testq %rbx, %rbx
je 0xdbffb
leaq 0x28dbf2(%rip), %rsi    # 0x369bd3
movq %r14, %rdi
movl $0x60, %edx
callq 0x1092b2
testq %rax, %rax
je 0xdbffd
movq %rax, %r15
movb $0x1, %r14b
jmp 0xdc031
xorl %ebx, %ebx
leaq 0x28b536(%rip), %rsi    # 0x36753a
leaq 0x28dc9b(%rip), %rdx    # 0x369ca6
leaq 0x28dbee(%rip), %rcx    # 0x369c00
leaq 0x28dbba(%rip), %r8     # 0x369bd3
xorl %r15d, %r15d
movq 0x30(%rsp), %rdi
movl $0x60, %r9d
xorl %eax, %eax
callq 0x1019cf
xorl %r14d, %r14d
testb %r14b, %r14b
je 0xdc24b
movq %r15, 0x20(%rsp)
movq %rbp, 0x8(%rsp)
xorl %r15d, %r15d
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movq 0x18(%rsp), %r12
callq 0x125bcc
movl %eax, %r14d
andl %ebp, %r14d
shlq $0x20, %r14
callq 0x125bcc
andl %ebp, %eax
orq %r14, %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx,%r15,8)
testq %rbx, %rbx
je 0xdc2a6
cmpq %r15, 0x8(%rbx)
jbe 0xdc2a6
movl 0x10(%rbx), %edx
cmpq $0x41, %rdx
jae 0xdc2a6
movq (%rbx), %rdi
movq %rdx, %rsi
imulq %r15, %rsi
movq %rax, %rcx
callq 0x2fcd13
incq %r15
cmpq %r15, %r12
jne 0xdc051
movq %r13, 0x28(%rsp)
xorl %r12d, %r12d
xorl %r14d, %r14d
cmpq %r14, 0x8(%rbx)
movq 0x8(%rsp), %rax
jbe 0xdc2b0
movl 0x10(%rbx), %edx
cmpq $0x41, %rdx
jae 0xdc2b0
movq (%rax,%r14,8), %r13
movq (%rbx), %rdi
movq %rdx, %rsi
imulq %r14, %rsi
callq 0x2fcc2c
movq %rax, %rbp
xorl %r15d, %r15d
testl %r12d, %r12d
je 0xdc0f7
xorl %r12d, %r12d
jmp 0xdc138
movq %r13, %rax
andq 0x10(%rsp), %rax
movb $0x1, %r12b
cmpq %rbp, %rax
je 0xdc13e
xorl %r12d, %r12d
movq 0x30(%rsp), %rdi
leaq 0x28b424(%rip), %rsi    # 0x36753a
leaq 0x28dad3(%rip), %rdx    # 0x369bf0
leaq 0x28dadc(%rip), %rcx    # 0x369c00
leaq 0x28daa8(%rip), %r8     # 0x369bd3
movl $0x75, %r9d
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testb %r12b, %r12b
je 0xdc1ab
incq %r14
movl %r15d, %r12d
cmpq %r14, 0x18(%rsp)
jne 0xdc0b8
leaq 0x28da78(%rip), %r14    # 0x369bd3
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movl $0x82, %edx
callq 0x109670
movq 0x20(%rsp), %rdi
movq %r14, %rsi
movl $0x83, %edx
callq 0x109670
movq (%rbx), %rdi
leaq 0x28dc5f(%rip), %r14    # 0x369de8
movq %r14, %rsi
movl $0x5d, %edx
callq 0x109670
movq %rbx, %rdi
movq %r14, %rsi
movl $0x5e, %edx
callq 0x109670
movb $0x1, %r12b
jmp 0xdc221
andq 0x10(%rsp), %r13
leaq 0x28dba1(%rip), %rdi    # 0x369d58
xorl %r12d, %r12d
movq %r13, %rsi
movq %rbp, %rdx
movq %r14, %rcx
movq 0x28(%rsp), %r8
xorl %eax, %eax
callq 0x108e02
leaq 0x28d9fd(%rip), %r14    # 0x369bd3
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movl $0x7c, %edx
callq 0x109670
movq 0x20(%rsp), %rdi
movq %r14, %rsi
movl $0x7d, %edx
callq 0x109670
movq (%rbx), %rdi
leaq 0x28dbe4(%rip), %r14    # 0x369de8
movq %r14, %rsi
movl $0x5d, %edx
callq 0x109670
movq %rbx, %rdi
movq %r14, %rsi
movl $0x5e, %edx
callq 0x109670
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb %r12b, %r12b
je 0xdc23c
leaq 0x28db7b(%rip), %rdi    # 0x369dad
xorl %eax, %eax
callq 0x108e02
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28daeb(%rip), %rdi    # 0x369d3d
callq 0x17690
testq %rbp, %rbp
je 0xdc270
leaq 0x28d970(%rip), %rsi    # 0x369bd3
movq %rbp, %rdi
movl $0x65, %edx
callq 0x109670
testq %r15, %r15
je 0xdc289
leaq 0x28d957(%rip), %rsi    # 0x369bd3
movq %r15, %rdi
movl $0x67, %edx
callq 0x109670
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testq %rbx, %rbx
je 0xdc29c
movq %rbx, %rdi
callq 0xdc2b5
xorl %r12d, %r12d
jmp 0xdc221
callq 0x2568e
callq 0x25655
callq 0x255e5
callq 0x2561c