// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x1, %edi
movl $0x40, %esi
leaq 0x3eb246(%rip), %rdx    # 0x54e268
movl $0x5fe, %ecx            # imm = 0x5FE
callq 0xe83c0
movq %rax, 0x10(%rsp)
movl $0x18, %edi
leaq 0x3eb22b(%rip), %rsi    # 0x54e268
movl $0x5ff, %edx            # imm = 0x5FF
callq 0xe80f0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq $0x0, (%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq $0x0, 0x10(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq $0x0, 0x8(%rax)
cmpl $0x0, 0x1c(%rsp)
jne 0x1631fe
leaq 0x3eb55a(%rip), %rax    # 0x54e5ed
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x1630e6
movq 0x8(%rsp), %rdi
callq 0x163410
cmpl $0x3, %eax
je 0x1630e4
movq 0x20(%rsp), %rdi
leaq 0x3cc540(%rip), %rsi    # 0x52f5fa
leaq 0x3eb533(%rip), %rdx    # 0x54e5f4
leaq 0x3eb54c(%rip), %rcx    # 0x54e614
leaq 0x3eb199(%rip), %r8     # 0x54e268
movl $0x606, %r9d            # imm = 0x606
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x1c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1630e6
jmp 0x1630e8
leaq 0x449591(%rip), %rax    # 0x5ac680
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x163142
movq 0x8(%rsp), %rdi
callq 0x163410
cmpl $0x0, %eax
je 0x163140
movq 0x20(%rsp), %rdi
leaq 0x3cc4e4(%rip), %rsi    # 0x52f5fa
leaq 0x3eb50c(%rip), %rdx    # 0x54e629
leaq 0x3eb4f0(%rip), %rcx    # 0x54e614
leaq 0x3eb13d(%rip), %r8     # 0x54e268
movl $0x609, %r9d            # imm = 0x609
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x1c(%rsp) # imm = 0xFFFFFFFF
jmp 0x163142
jmp 0x163144
leaq 0x3eb4fd(%rip), %rax    # 0x54e648
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x16319e
movq 0x8(%rsp), %rdi
callq 0x163410
cmpl $0x3, %eax
je 0x16319c
movq 0x20(%rsp), %rdi
leaq 0x3cc488(%rip), %rsi    # 0x52f5fa
leaq 0x3eb47b(%rip), %rdx    # 0x54e5f4
leaq 0x3eb494(%rip), %rcx    # 0x54e614
leaq 0x3eb0e1(%rip), %r8     # 0x54e268
movl $0x60c, %r9d            # imm = 0x60C
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x1c(%rsp) # imm = 0xFFFFFFFF
jmp 0x16319e
jmp 0x1631a0
leaq 0x43a481(%rip), %rax    # 0x59d628
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x1631fa
movq 0x8(%rsp), %rdi
callq 0x163410
cmpl $0x0, %eax
je 0x1631f8
movq 0x20(%rsp), %rdi
leaq 0x3cc42c(%rip), %rsi    # 0x52f5fa
leaq 0x3eb478(%rip), %rdx    # 0x54e64d
leaq 0x3eb438(%rip), %rcx    # 0x54e614
leaq 0x3eb085(%rip), %r8     # 0x54e268
movl $0x60f, %r9d            # imm = 0x60F
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x1c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1631fa
jmp 0x1631fc
jmp 0x1631fe
cmpl $0x0, 0x1c(%rsp)
jne 0x16336f
movq $0x0, (%rsp)
movq 0x10(%rsp), %rax
leaq 0x3eb450(%rip), %rcx    # 0x54e66d
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
movq $0x3, 0x20(%rax)
movq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x163480
cmpl $0x0, 0x1c(%rsp)
jne 0x163284
cmpq $0x29a, (%rsp)          # imm = 0x29A
je 0x163282
movq 0x20(%rsp), %rdi
leaq 0x3cc3a2(%rip), %rsi    # 0x52f5fa
leaq 0x3eb417(%rip), %rdx    # 0x54e676
leaq 0x3eb3ae(%rip), %rcx    # 0x54e614
leaq 0x3eaffb(%rip), %r8     # 0x54e268
movl $0x618, %r9d            # imm = 0x618
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x1c(%rsp) # imm = 0xFFFFFFFF
jmp 0x163284
jmp 0x163286
movq 0x10(%rsp), %rax
leaq 0x3ebb2a(%rip), %rcx    # 0x54edbc
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
movq $0x4, 0x20(%rax)
movq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x163480
cmpl $0x0, 0x1c(%rsp)
jne 0x1632f9
cmpq $0x29a, (%rsp)          # imm = 0x29A
je 0x1632f7
movq 0x20(%rsp), %rdi
leaq 0x3cc32d(%rip), %rsi    # 0x52f5fa
leaq 0x3eb3a2(%rip), %rdx    # 0x54e676
leaq 0x3eb339(%rip), %rcx    # 0x54e614
leaq 0x3eaf86(%rip), %r8     # 0x54e268
movl $0x61d, %r9d            # imm = 0x61D
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x1c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1632f9
jmp 0x1632fb
movq 0x10(%rsp), %rax
leaq 0x3ebac1(%rip), %rcx    # 0x54edc8
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
movq $0x3, 0x20(%rax)
movq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x163480
cmpl $0x0, 0x1c(%rsp)
jne 0x16336b
cmpq $-0x7b, (%rsp)
je 0x163369
movq 0x20(%rsp), %rdi
leaq 0x3cc2bb(%rip), %rsi    # 0x52f5fa
leaq 0x3eb33f(%rip), %rdx    # 0x54e685
leaq 0x3eb2c7(%rip), %rcx    # 0x54e614
leaq 0x3eaf14(%rip), %r8     # 0x54e268
movl $0x622, %r9d            # imm = 0x622
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x1c(%rsp) # imm = 0xFFFFFFFF
jmp 0x16336b
jmp 0x16336d
jmp 0x16336f
jmp 0x163371
movq 0x10(%rsp), %rax
movq (%rax), %rax
cmpq $0x0, (%rax)
je 0x1633ca
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rdi
leaq 0x3eaed7(%rip), %rsi    # 0x54e268
movl $0x625, %edx            # imm = 0x625
callq 0xe88c0
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq $0x0, 0x8(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq $0x0, 0x10(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq $0x0, (%rax)
jmp 0x1633cc
movq 0x10(%rsp), %rax
movq (%rax), %rdi
leaq 0x3eae8d(%rip), %rsi    # 0x54e268
movl $0x626, %edx            # imm = 0x626
callq 0xe88c0
movq 0x10(%rsp), %rdi
leaq 0x3eae77(%rip), %rsi    # 0x54e268
movl $0x627, %edx            # imm = 0x627
callq 0xe88c0
movl 0x1c(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)