// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/golomb.c
// Function: gt_golomb_unit_test
int gt_golomb_unit_test(GtError *err)
{
  int had_err = 0,
      stat = -1;
  GtGolomb *golomb;
  GtBittab *code = NULL;
  GtGolombBitwiseDecoder *gbwd = NULL;
  GtUword unit_test_x_size = 128UL,
                idx_i,
                idx_j,
                idx_k,
                number = unit_test_x_size + 1,
                unit_test_b_size = 256UL;

  for (idx_j = 1UL; !had_err && idx_j <= unit_test_b_size; idx_j++) {
    golomb = gt_golomb_new(idx_j);
    gbwd = gt_golomb_bitwise_decoder_new(golomb);
    for (idx_k = 0; !had_err && idx_k <= unit_test_x_size; idx_k++) {
      code = gt_golomb_encode(golomb, idx_k);
      for (idx_i = 0 ; !had_err && idx_i < gt_bittab_size(code) ; idx_i++) {
        if (gt_bittab_bit_is_set(code, idx_i))
          stat = gt_golomb_bitwise_decoder_next(gbwd, true, &number);
        else
          stat = gt_golomb_bitwise_decoder_next(gbwd, false, &number);
        gt_ensure(stat != -1);
      }

      gt_ensure(stat == 0);
      gt_ensure(number == idx_k);
      gt_bittab_delete(code);
    }
    gt_golomb_bitwise_decoder_delete(gbwd);
    gt_golomb_delete(golomb);
  }
  return had_err;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movl $0x0, 0x5c(%rsp)
movl $0xffffffff, 0x58(%rsp) # imm = 0xFFFFFFFF
movq $0x0, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x80, 0x38(%rsp)
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
movq $0x100, 0x10(%rsp)      # imm = 0x100
movq $0x1, 0x28(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x5c(%rsp)
movb %al, 0xf(%rsp)
jne 0x181a92
movq 0x28(%rsp), %rax
cmpq 0x10(%rsp), %rax
setbe %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x181a9f
jmp 0x181ccc
movq 0x28(%rsp), %rdi
callq 0x181260
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
callq 0x181620
movq %rax, 0x40(%rsp)
movq $0x0, 0x20(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x5c(%rsp)
movb %al, 0xe(%rsp)
jne 0x181ae4
movq 0x20(%rsp), %rax
cmpq 0x38(%rsp), %rax
setbe %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0x181af1
jmp 0x181ca5
movq 0x50(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1813c0
movq %rax, 0x48(%rsp)
movq $0x0, 0x30(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x5c(%rsp)
movb %al, 0xd(%rsp)
jne 0x181b3f
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq 0x48(%rsp), %rdi
callq 0x8a9b0
movq %rax, %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
setb %al
movb %al, 0xd(%rsp)
movb 0xd(%rsp), %al
testb $0x1, %al
jne 0x181b4c
jmp 0x181bef
movq 0x48(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x8a780
testb $0x1, %al
jne 0x181b61
jmp 0x181b7b
movq 0x40(%rsp), %rdi
movl $0x1, %esi
leaq 0x18(%rsp), %rdx
callq 0x181700
movl %eax, 0x58(%rsp)
jmp 0x181b90
movq 0x40(%rsp), %rdi
xorl %esi, %esi
leaq 0x18(%rsp), %rdx
callq 0x181700
movl %eax, 0x58(%rsp)
jmp 0x181b92
cmpl $0x0, 0x5c(%rsp)
jne 0x181bd8
cmpl $-0x1, 0x58(%rsp)
jne 0x181bd6
movq 0x60(%rsp), %rdi
leaq 0x3ada4e(%rip), %rsi    # 0x52f5fa
leaq 0x3d529c(%rip), %rdx    # 0x556e4f
leaq 0x3d29df(%rip), %rcx    # 0x554599
leaq 0x3d2958(%rip), %r8     # 0x554519
movl $0xd4, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x181bd8
jmp 0x181bda
jmp 0x181bdc
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x181b0e
jmp 0x181bf1
cmpl $0x0, 0x5c(%rsp)
jne 0x181c37
cmpl $0x0, 0x58(%rsp)
je 0x181c35
movq 0x60(%rsp), %rdi
leaq 0x3ad9ef(%rip), %rsi    # 0x52f5fa
leaq 0x3d522b(%rip), %rdx    # 0x556e3d
leaq 0x3d2980(%rip), %rcx    # 0x554599
leaq 0x3d28f9(%rip), %r8     # 0x554519
movl $0xd7, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x181c37
jmp 0x181c39
jmp 0x181c3b
cmpl $0x0, 0x5c(%rsp)
jne 0x181c86
movq 0x18(%rsp), %rax
cmpq 0x20(%rsp), %rax
je 0x181c84
movq 0x60(%rsp), %rdi
leaq 0x3ad9a0(%rip), %rsi    # 0x52f5fa
leaq 0x3d294c(%rip), %rdx    # 0x5545ad
leaq 0x3d2931(%rip), %rcx    # 0x554599
leaq 0x3d28aa(%rip), %r8     # 0x554519
movl $0xd8, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x181c86
jmp 0x181c88
movq 0x48(%rsp), %rdi
callq 0x8af40
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x181ac6
movq 0x40(%rsp), %rdi
callq 0x181a00
movq 0x50(%rsp), %rdi
callq 0x1819e0
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x181a74
movl 0x5c(%rsp), %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
nop