// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/elias_gamma.c
// Function: gt_elias_gamma_unit_test
int gt_elias_gamma_unit_test(GtError *err)
{
  int stat = -1,
      had_err = 0;
  GtUword idx,
                idx_j,
                unit_test_x_size = 100UL,
                number = unit_test_x_size + 1;
  GtBittab *code;
  GtEliasGammaBitwiseDecoder *egbd = gt_elias_gamma_bitwise_decoder_new();

  for (idx = 1UL; idx <= unit_test_x_size; idx++) {
    code = gt_elias_gamma_encode(idx);
    for (idx_j = gt_bittab_size(code) - 1; idx_j != 0 ; idx_j--) {
      if (gt_bittab_bit_is_set(code, idx_j))
        stat = gt_elias_gamma_bitwise_decoder_next(egbd, true, &number);
      else
        stat = gt_elias_gamma_bitwise_decoder_next(egbd, false, &number);
      gt_ensure(stat == 1);
    }

    if (gt_bittab_bit_is_set(code, idx_j))
      stat = gt_elias_gamma_bitwise_decoder_next(egbd, true, &number);
    else
      stat = gt_elias_gamma_bitwise_decoder_next(egbd, false, &number);
    gt_ensure(stat == 0);
    gt_ensure(number == idx);
    gt_bittab_delete(code);
  }
  gt_elias_gamma_bitwise_decoder_delete(egbd);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
movq $0x65, (%r14)
leaq 0x243a34(%rip), %rsi    # 0x38501f
movl $0x20, %edi
movl $0x33, %edx
callq 0x1092b2
movq %rax, %r12
movl $0x0, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x1, 0x18(%rax)
movl $0x1, %r13d
xorl %r15d, %r15d
movq %r13, 0x8(%rsp)
movq %r13, %rdi
callq 0x141484
movq %rax, %rbp
movq %rax, %rdi
callq 0xd9585
movq %rax, %r13
movq %rbp, %rdi
decq %r13
je 0x14168d
movq %r13, %rsi
callq 0xd94c7
movzbl %al, %esi
movq %r12, %rdi
movq %r14, %rdx
callq 0x141523
orl %r15d, %eax
jne 0x141636
movq %rbx, %rdi
leaq 0x225ed7(%rip), %rsi    # 0x36753a
leaq 0x24c189(%rip), %rdx    # 0x38d7f3
leaq 0x2439f2(%rip), %rcx    # 0x385063
leaq 0x2439a7(%rip), %r8     # 0x38501f
movl $0x79, %r9d
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x141636
xorl %esi, %esi
callq 0xd94c7
movzbl %al, %esi
movq %r12, %rdi
movq %r14, %rdx
callq 0x141523
testl %r15d, %r15d
jne 0x1416e4
testl %eax, %eax
movq 0x8(%rsp), %r13
je 0x1416e9
movq %rbx, %rdi
leaq 0x225e80(%rip), %rsi    # 0x36753a
leaq 0x24c3ec(%rip), %rdx    # 0x38daad
leaq 0x24399b(%rip), %rcx    # 0x385063
leaq 0x243950(%rip), %r8     # 0x38501f
movl $0x80, %r9d
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x1416e9
movq 0x8(%rsp), %r13
movl %r15d, %eax
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x141732
xorl %r15d, %r15d
cmpq %r13, 0x10(%rsp)
je 0x141732
movq %rbx, %rdi
leaq 0x225e30(%rip), %rsi    # 0x36753a
leaq 0x24396b(%rip), %rdx    # 0x38507c
leaq 0x24394b(%rip), %rcx    # 0x385063
leaq 0x243900(%rip), %r8     # 0x38501f
movl $0x81, %r9d
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movq %rbp, %rdi
callq 0xd97e0
incq %r13
cmpq $0x65, %r13
jne 0x14161b
leaq 0x2438d1(%rip), %rsi    # 0x38501f
movq %r12, %rdi
movl $0x64, %edx
callq 0x109670
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)