// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl $0xffffffff, 0x3c(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x38(%rsp)
movq $0x64, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
callq 0x15ea70
movq %rax, 0x8(%rsp)
movq $0x1, 0x30(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x20(%rsp), %rax
ja 0x15ee9e
movq 0x30(%rsp), %rdi
callq 0x15e990
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x8a9b0
subq $0x1, %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0x15eda4
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x8a780
testb $0x1, %al
jne 0x15ed16
jmp 0x15ed30
movq 0x8(%rsp), %rdi
movl $0x1, %esi
leaq 0x18(%rsp), %rdx
callq 0x15eb00
movl %eax, 0x3c(%rsp)
jmp 0x15ed45
movq 0x8(%rsp), %rdi
xorl %esi, %esi
leaq 0x18(%rsp), %rdx
callq 0x15eb00
movl %eax, 0x3c(%rsp)
jmp 0x15ed47
cmpl $0x0, 0x38(%rsp)
jne 0x15ed8d
cmpl $0x1, 0x3c(%rsp)
je 0x15ed8b
movq 0x40(%rsp), %rdi
leaq 0x3d0899(%rip), %rsi    # 0x52f5fa
leaq 0x3f7e1b(%rip), %rdx    # 0x556b83
leaq 0x3ef4c3(%rip), %rcx    # 0x54e232
leaq 0x3ef478(%rip), %r8     # 0x54e1ee
movl $0x79, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x38(%rsp) # imm = 0xFFFFFFFF
jmp 0x15ed8d
jmp 0x15ed8f
jmp 0x15ed91
movq 0x28(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x15ecf5
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x8a780
testb $0x1, %al
jne 0x15edb9
jmp 0x15edd3
movq 0x8(%rsp), %rdi
movl $0x1, %esi
leaq 0x18(%rsp), %rdx
callq 0x15eb00
movl %eax, 0x3c(%rsp)
jmp 0x15ede8
movq 0x8(%rsp), %rdi
xorl %esi, %esi
leaq 0x18(%rsp), %rdx
callq 0x15eb00
movl %eax, 0x3c(%rsp)
jmp 0x15edea
cmpl $0x0, 0x38(%rsp)
jne 0x15ee30
cmpl $0x0, 0x3c(%rsp)
je 0x15ee2e
movq 0x40(%rsp), %rdi
leaq 0x3d07f6(%rip), %rsi    # 0x52f5fa
leaq 0x3f8032(%rip), %rdx    # 0x556e3d
leaq 0x3ef420(%rip), %rcx    # 0x54e232
leaq 0x3ef3d5(%rip), %r8     # 0x54e1ee
movl $0x80, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x38(%rsp) # imm = 0xFFFFFFFF
jmp 0x15ee30
jmp 0x15ee32
jmp 0x15ee34
cmpl $0x0, 0x38(%rsp)
jne 0x15ee7f
movq 0x18(%rsp), %rax
cmpq 0x30(%rsp), %rax
je 0x15ee7d
movq 0x40(%rsp), %rdi
leaq 0x3d07a7(%rip), %rsi    # 0x52f5fa
leaq 0x3ef3f1(%rip), %rdx    # 0x54e24b
leaq 0x3ef3d1(%rip), %rcx    # 0x54e232
leaq 0x3ef386(%rip), %r8     # 0x54e1ee
movl $0x81, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x38(%rsp) # imm = 0xFFFFFFFF
jmp 0x15ee7f
jmp 0x15ee81
movq 0x10(%rsp), %rdi
callq 0x8af40
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x15ecc3
movq 0x8(%rsp), %rdi
callq 0x15ec60
movl 0x38(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)