// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x23ed94(%rip), %r15    # 0x37bd28
movl $0x1, %edi
movl $0x40, %esi
movq %r15, %rdx
movl $0x5fe, %ecx            # imm = 0x5FE
callq 0x10436a
movq %rax, %rbx
movl $0x18, %edi
movq %r15, %rsi
movl $0x5ff, %edx            # imm = 0x5FF
callq 0x104226
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
xorl %r15d, %r15d
movq %r15, 0x10(%rax)
movq %rsp, %r12
movq %r15, (%r12)
leaq 0x23f0e4(%rip), %rdi    # 0x37c0c2
movq %rdi, 0x8(%rbx)
movq $0x3, 0x20(%rbx)
movl $0x3, %esi
movq %r12, %rdx
callq 0x13d15c
movq (%r12), %r12
cmpq $0x29a, %r12            # imm = 0x29A
je 0x13d036
leaq 0x221433(%rip), %rsi    # 0x35e43e
leaq 0x23f0b9(%rip), %rdx    # 0x37c0cb
leaq 0x23f094(%rip), %rcx    # 0x37c0ad
leaq 0x23ed08(%rip), %r8     # 0x37bd28
movq %r14, %rdi
movl $0x618, %r9d            # imm = 0x618
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
leaq 0x23f7d4(%rip), %rdi    # 0x37c811
movq %rdi, 0x8(%rbx)
movq $0x4, 0x20(%rbx)
movq %rsp, %rdx
movl $0x4, %esi
callq 0x13d15c
cmpq $0x29a, %r12            # imm = 0x29A
jne 0x13d09b
cmpq $0x29a, (%rsp)          # imm = 0x29A
je 0x13d09b
leaq 0x2213ce(%rip), %rsi    # 0x35e43e
leaq 0x23f054(%rip), %rdx    # 0x37c0cb
leaq 0x23f02f(%rip), %rcx    # 0x37c0ad
leaq 0x23eca3(%rip), %r8     # 0x37bd28
movq %r14, %rdi
movl $0x61d, %r9d            # imm = 0x61D
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
leaq 0x23f77b(%rip), %rdi    # 0x37c81d
movq %rdi, 0x8(%rbx)
movq $0x3, 0x20(%rbx)
movq %rsp, %rdx
movl $0x3, %esi
callq 0x13d15c
testl %r15d, %r15d
jne 0x13d0f9
cmpq $-0x7b, (%rsp)
je 0x13d0f9
leaq 0x221370(%rip), %rsi    # 0x35e43e
leaq 0x23f005(%rip), %rdx    # 0x37c0da
leaq 0x23efd1(%rip), %rcx    # 0x37c0ad
leaq 0x23ec45(%rip), %r8     # 0x37bd28
movq %r14, %rdi
movl $0x622, %r9d            # imm = 0x622
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movq (%rbx), %rdi
movq (%rdi), %rax
testq %rax, %rax
je 0x13d129
leaq 0x23ec1d(%rip), %rsi    # 0x37bd28
movq %rax, %rdi
movl $0x625, %edx            # imm = 0x625
callq 0x1045eb
movq (%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x23ebf8(%rip), %r14    # 0x37bd28
movq %r14, %rsi
movl $0x626, %edx            # imm = 0x626
callq 0x1045eb
movq %rbx, %rdi
movq %r14, %rsi
movl $0x627, %edx            # imm = 0x627
callq 0x1045eb
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq