// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/encdesc.c
// Function: gt_encdesc_unit_test
int gt_encdesc_unit_test(GtError *err)
{
  int had_err = 0;
  EncdescWriteInfo *info = gt_calloc((size_t) 1, sizeof (*info));
  info->codes = gt_malloc(sizeof (*info->codes));

  GT_INITARRAY(info->codes, EncdescCode);

  /* test count_leading_zeros */
  if (!had_err) {
    char *test = "000156";
    gt_ensure(count_leading_zeros(test) == 3U);

    test = "x";
    gt_ensure(count_leading_zeros(test) == 0);

    test = "0000";
    gt_ensure(count_leading_zeros(test) == 3U);

    test = "";
    gt_ensure(count_leading_zeros(test) == 0U);
  }

  /* test parse_number_out_of_current_field */
  if (!had_err) {
    GtWord retval = 0;
    info->descbuffer = "abc00666";
    info->cur_field_start_pos = 3UL;
    parse_number_out_of_current_field(info, &retval);
    gt_ensure(retval == 666L);

    info->descbuffer = "abc\000666\000abc";
    info->cur_field_start_pos = 4UL;
    parse_number_out_of_current_field(info, &retval);
    gt_ensure(retval == 666L);

    info->descbuffer = "aaa-123\000aaa";
    info->cur_field_start_pos = 3UL;
    parse_number_out_of_current_field(info, &retval);
    gt_ensure(retval == -123L);
  }

  GT_FREEARRAY(info->codes, EncdescCode);
  gt_free(info->codes);
  gt_free(info);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x2487b3(%rip), %r15    # 0x31c0c8
pushq $0x1
popq %rdi
pushq $0x40
popq %rsi
movq %r15, %rdx
movl $0x5fe, %ecx            # imm = 0x5FE
callq 0x9334a
movq %rax, %rbx
pushq $0x18
popq %rdi
movq %r15, %rsi
movl $0x5ff, %edx            # imm = 0x5FF
callq 0x93160
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x248afd(%rip), %rdi    # 0x31c44d
callq 0xd3bb4
cmpl $0x3, %eax
jne 0xd3995
leaq 0x2a3cae(%rip), %rdi    # 0x37760f
callq 0xd3bb4
testl %eax, %eax
je 0xd3a22
leaq 0x22aa7d(%rip), %rsi    # 0x2fe3f2
leaq 0x248b0d(%rip), %rdx    # 0x31c489
leaq 0x248af1(%rip), %rcx    # 0x31c474
leaq 0x24873e(%rip), %r8     # 0x31c0c8
movq %r14, %rdi
movl $0x609, %r9d            # imm = 0x609
jmp 0xd39ba
leaq 0x22aa56(%rip), %rsi    # 0x2fe3f2
leaq 0x248ab1(%rip), %rdx    # 0x31c454
leaq 0x248aca(%rip), %rcx    # 0x31c474
leaq 0x248717(%rip), %r8     # 0x31c0c8
movq %r14, %rdi
movl $0x606, %r9d            # imm = 0x606
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
movq (%rbx), %rdi
movq (%rdi), %rax
testq %rax, %rax
je 0xd39f1
leaq 0x2486f2(%rip), %rsi    # 0x31c0c8
movq %rax, %rdi
movl $0x625, %edx            # imm = 0x625
callq 0x936f9
movq (%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x2486d0(%rip), %r14    # 0x31c0c8
movq %r14, %rsi
movl $0x626, %edx            # imm = 0x626
callq 0x936f9
movq %rbx, %rdi
movq %r14, %rsi
movl $0x627, %edx            # imm = 0x627
callq 0x936f9
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x248a7f(%rip), %rdi    # 0x31c4a8
callq 0xd3bb4
cmpl $0x3, %eax
jne 0xd3a6d
leaq 0x296b36(%rip), %rdi    # 0x36a570
callq 0xd3bb4
testl %eax, %eax
je 0xd3a97
leaq 0x22a9a8(%rip), %rsi    # 0x2fe3f2
leaq 0x248a5c(%rip), %rdx    # 0x31c4ad
leaq 0x248a1c(%rip), %rcx    # 0x31c474
leaq 0x248669(%rip), %r8     # 0x31c0c8
movq %r14, %rdi
movl $0x60f, %r9d            # imm = 0x60F
jmp 0xd39ba
leaq 0x22a97e(%rip), %rsi    # 0x2fe3f2
leaq 0x2489d9(%rip), %rdx    # 0x31c454
leaq 0x2489f2(%rip), %rcx    # 0x31c474
leaq 0x24863f(%rip), %r8     # 0x31c0c8
movq %r14, %rdi
movl $0x60c, %r9d            # imm = 0x60C
jmp 0xd39ba
movq %rsp, %r15
andq $0x0, (%r15)
leaq 0x248a28(%rip), %rax    # 0x31c4cd
movq %rax, 0x8(%rbx)
movq $0x3, 0x20(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xd3bd8
movq (%r15), %r15
xorl %ebp, %ebp
cmpq $0x29a, %r15            # imm = 0x29A
je 0xd3af9
leaq 0x22a921(%rip), %rsi    # 0x2fe3f2
leaq 0x2489fe(%rip), %rdx    # 0x31c4d6
leaq 0x248995(%rip), %rcx    # 0x31c474
leaq 0x2485e2(%rip), %r8     # 0x31c0c8
movq %r14, %rdi
movl $0x618, %r9d            # imm = 0x618
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
leaq 0x24911c(%rip), %rax    # 0x31cc1c
movq %rax, 0x8(%rbx)
movq $0x4, 0x20(%rbx)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xd3bd8
cmpq $0x29a, %r15            # imm = 0x29A
jne 0xd3b59
cmpq $0x29a, (%rsp)          # imm = 0x29A
je 0xd3b59
leaq 0x22a8c1(%rip), %rsi    # 0x2fe3f2
leaq 0x24899e(%rip), %rdx    # 0x31c4d6
leaq 0x248935(%rip), %rcx    # 0x31c474
leaq 0x248582(%rip), %r8     # 0x31c0c8
movq %r14, %rdi
movl $0x61d, %r9d            # imm = 0x61D
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
leaq 0x2490c8(%rip), %rax    # 0x31cc28
movq %rax, 0x8(%rbx)
movq $0x3, 0x20(%rbx)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xd3bd8
testl %ebp, %ebp
jne 0xd39c4
cmpq $-0x7b, (%rsp)
je 0xd39c4
leaq 0x22a861(%rip), %rsi    # 0x2fe3f2
leaq 0x24894d(%rip), %rdx    # 0x31c4e5
leaq 0x2488d5(%rip), %rcx    # 0x31c474
leaq 0x248522(%rip), %r8     # 0x31c0c8
movq %r14, %rdi
movl $0x622, %r9d            # imm = 0x622
jmp 0xd39ba