// File: /workspace/github_c_makefile_star2_O1/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 0x2415e7(%rip), %r15    # 0x385098
movl $0x1, %edi
movl $0x40, %esi
movq %r15, %rdx
movl $0x5fe, %ecx            # imm = 0x5FE
callq 0x1093ef
movq %rax, %rbx
movl $0x18, %edi
movq %r15, %rsi
movl $0x5ff, %edx            # imm = 0x5FF
callq 0x1092b2
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
xorl %r15d, %r15d
movq %r15, 0x10(%rax)
movq %rsp, %r12
movq %r15, (%r12)
leaq 0x241937(%rip), %rax    # 0x385432
movq %rax, 0x8(%rbx)
movq $0x3, 0x20(%rbx)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x143c73
movq (%r12), %r12
cmpq $0x29a, %r12            # imm = 0x29A
je 0x143b51
leaq 0x223a14(%rip), %rsi    # 0x36753a
leaq 0x24190e(%rip), %rdx    # 0x38543b
leaq 0x2418e9(%rip), %rcx    # 0x38541d
leaq 0x24155d(%rip), %r8     # 0x385098
movq %r14, %rdi
movl $0x618, %r9d            # imm = 0x618
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
leaq 0x242029(%rip), %rax    # 0x385b81
movq %rax, 0x8(%rbx)
movq $0x4, 0x20(%rbx)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x143c73
cmpq $0x29a, %r12            # imm = 0x29A
jne 0x143bb4
cmpq $0x29a, (%rsp)          # imm = 0x29A
je 0x143bb4
leaq 0x2239b1(%rip), %rsi    # 0x36753a
leaq 0x2418ab(%rip), %rdx    # 0x38543b
leaq 0x241886(%rip), %rcx    # 0x38541d
leaq 0x2414fa(%rip), %r8     # 0x385098
movq %r14, %rdi
movl $0x61d, %r9d            # imm = 0x61D
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
leaq 0x241fd2(%rip), %rax    # 0x385b8d
movq %rax, 0x8(%rbx)
movq $0x3, 0x20(%rbx)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x143c73
testl %r15d, %r15d
jne 0x143c10
cmpq $-0x7b, (%rsp)
je 0x143c10
leaq 0x223955(%rip), %rsi    # 0x36753a
leaq 0x24185e(%rip), %rdx    # 0x38544a
leaq 0x24182a(%rip), %rcx    # 0x38541d
leaq 0x24149e(%rip), %r8     # 0x385098
movq %r14, %rdi
movl $0x622, %r9d            # imm = 0x622
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movq (%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x143c3d
leaq 0x241476(%rip), %rsi    # 0x385098
movl $0x625, %edx            # imm = 0x625
callq 0x109670
movq (%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq (%rbx), %rdi
leaq 0x241451(%rip), %r14    # 0x385098
movq %r14, %rsi
movl $0x626, %edx            # imm = 0x626
callq 0x109670
movq %rbx, %rdi
movq %r14, %rsi
movl $0x627, %edx            # imm = 0x627
callq 0x109670
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq