// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/encdesc.c
// Function: prepare_write_data_and_count_bits
static void prepare_write_data_and_count_bits(GtEncdesc *encdesc,
                                              EncdescWriteInfo *info)
{
  size_t desc_char_idx,
         field_char_idx,
         len;
  DescField *cur_field;

  len = strlen(info->descbuffer);
  info->cur_field_num = 0;
  info->cur_field_start_pos = 0;
  info->total_bits_prepared = 0;
  gt_assert(info->codes->nextfreeEncdescCode == 0);

  if (!encdesc->num_of_fields_is_const) {
    encdesc_prepare_num_of_fields(encdesc, info);
  }

  cur_field = &encdesc->fields[info->cur_field_num];
  for (desc_char_idx = 0; desc_char_idx <= len; desc_char_idx++) {
    if (info->descbuffer[desc_char_idx] == cur_field->sep ||
        desc_char_idx == len) {

      info->descbuffer[desc_char_idx] = '\0';
      if (!cur_field->is_const) {
        if (cur_field->is_numeric) {
          prepare_numeric_field(encdesc, info);
        }
        else {
          if (!cur_field->fieldlen_is_const) {
            regular_field_prepare_length(encdesc, info,
                                         (GtUword) desc_char_idx);
          }
          for (field_char_idx = 0;
               field_char_idx < desc_char_idx - info->cur_field_start_pos;
               field_char_idx++) {
            if (field_char_idx >= (size_t) cur_field->len ||
                !gt_bittab_bit_is_set(cur_field->bittab,
                                     (GtUword) field_char_idx)) {
              regular_field_prepare_char(encdesc, info,
                                         (GtUword) field_char_idx);
            }
          }

        }
      }
      info->cur_field_start_pos = (GtUword) desc_char_idx + 1;
      info->cur_field_num++;
      cur_field = &encdesc->fields[info->cur_field_num];
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r13
movq 0x8(%rsi), %rdi
callq 0x172f0
movq %rax, %r14
movq $0x0, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movq (%rbx), %rax
cmpq $0x0, 0x10(%rax)
jne 0x14446e
cmpb $0x0, 0x6c(%r13)
jne 0x143e9b
movq 0x30(%rbx), %rsi
movq (%r13), %rax
movq (%rax,%rsi,8), %r12
cmpq 0x40(%r13), %r12
ja 0x14447d
jae 0x143e38
leaq 0x241a48(%rip), %rdi    # 0x385876
movq %r12, %rdx
xorl %eax, %eax
callq 0x108e02
movl 0x68(%r13), %r15d
movq (%rbx), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, 0x10(%rax)
jb 0x143e6f
addq $0x32, %rsi
movq %rsi, 0x8(%rax)
movq (%rax), %rdi
shlq $0x4, %rsi
leaq 0x241239(%rip), %rdx    # 0x385098
movl $0x3d, %ecx
callq 0x1094e6
movq (%rbx), %rcx
movq %rax, (%rcx)
movq (%rbx), %rcx
movq (%rcx), %rax
testq %rax, %rax
je 0x144482
movq 0x10(%rcx), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x10(%rcx)
shlq $0x4, %rdx
movl %r15d, 0x8(%rax,%rdx)
movq %r12, (%rax,%rdx)
addq %r15, 0x10(%rbx)
imulq $0xc8, 0x28(%rbx), %r15
leaq 0x20(%rbx), %rax
movq %rax, 0x28(%rsp)
addq 0x18(%r13), %r15
xorl %r12d, %r12d
movq %r13, 0x18(%rsp)
movq %r14, 0x30(%rsp)
movq 0x8(%rbx), %rax
movb (%rax,%r12), %cl
cmpb 0xb8(%r15), %cl
sete %cl
cmpq %r14, %r12
sete %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x14425e
movb $0x0, (%rax,%r12)
cmpb $0x0, 0xbb(%r15)
jne 0x14423a
cmpb $0x1, 0xbf(%r15)
jne 0x143f6b
movq $0x0, 0x8(%rsp)
movq 0x18(%r13), %r14
imulq $0xc8, 0x28(%rbx), %r15
leaq (%r14,%r15), %rbp
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x143c73
cmpb $0x1, 0xba(%r14,%r15)
jne 0x144199
cmpb $0x0, 0xb9(%rbp)
jne 0x144199
movq 0x8(%rbx), %rax
movq 0x20(%rbx), %rdx
movb (%rax,%rdx), %cl
cmpb $0x30, %cl
jne 0x1440ef
addq %rax, %rdx
incq %rdx
xorl %eax, %eax
movb (%rdx,%rax), %cl
incq %rax
cmpb $0x30, %cl
je 0x143f5b
jmp 0x1440f1
cmpb $0x0, 0xb9(%r15)
jne 0x144001
imulq $0xc8, 0x28(%rbx), %rcx
movq 0x18(%r13), %rdx
movq (%rbx), %rax
movq 0x20(%rbx), %r14
movq 0x58(%rdx,%rcx), %r13
movl 0xa8(%rdx,%rcx), %ebp
movq 0x8(%rax), %rsi
cmpq %rsi, 0x10(%rax)
jb 0x143fc8
addq $0x32, %rsi
movq %rsi, 0x8(%rax)
movq (%rax), %rdi
shlq $0x4, %rsi
leaq 0x2410e0(%rip), %rdx    # 0x385098
movl $0x3d, %ecx
callq 0x1094e6
movq (%rbx), %rcx
movq %rax, (%rcx)
movq (%rbx), %rcx
movq (%rcx), %rax
testq %rax, %rax
je 0x144469
addq %r13, %r14
movq %r12, %rdx
subq %r14, %rdx
movq 0x10(%rcx), %rsi
leaq 0x1(%rsi), %rdi
movq %rdi, 0x10(%rcx)
shlq $0x4, %rsi
movl %ebp, 0x8(%rax,%rsi)
movq %rdx, (%rax,%rsi)
addq %rbp, 0x10(%rbx)
movq 0x18(%rsp), %r13
movq 0x28(%rsp), %rax
cmpq (%rax), %r12
je 0x14423a
xorl %ebp, %ebp
cmpq 0x50(%r15), %rbp
jae 0x14402b
movq 0x18(%r15), %rdi
movq %rbp, %rsi
callq 0xd94c7
testb %al, %al
jne 0x1440d3
imulq $0xc8, 0x28(%rbx), %rax
movq 0x18(%r13), %rcx
movq (%rcx,%rax), %rax
movq (%rax,%rbp,8), %rdi
testq %rdi, %rdi
je 0x14445f
movq 0x8(%rbx), %rax
addq 0x20(%rbx), %rax
movsbq (%rbp,%rax), %rsi
leaq 0x20(%rsp), %rdx
leaq 0x8(%rsp), %rcx
callq 0x15bdb3
movl 0x8(%rsp), %r13d
movq 0x20(%rsp), %r14
movq (%rbx), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, 0x10(%rax)
jb 0x1440a2
addq $0x32, %rsi
movq %rsi, 0x8(%rax)
movq (%rax), %rdi
shlq $0x4, %rsi
leaq 0x241006(%rip), %rdx    # 0x385098
movl $0x3d, %ecx
callq 0x1094e6
movq (%rbx), %rcx
movq %rax, (%rcx)
movq (%rbx), %rcx
movq (%rcx), %rax
testq %rax, %rax
je 0x14445a
movq 0x10(%rcx), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x10(%rcx)
shlq $0x4, %rdx
movl %r13d, 0x8(%rax,%rdx)
movq %r14, (%rax,%rdx)
addq %r13, 0x10(%rbx)
movq 0x18(%rsp), %r13
incq %rbp
movq %r12, %rax
movq 0x28(%rsp), %rcx
subq (%rcx), %rax
cmpq %rax, %rbp
jb 0x144011
jmp 0x14423a
xorl %eax, %eax
movq 0x18(%r13), %rdx
imulq $0xc8, 0x28(%rbx), %rsi
movq 0x10(%rdx,%rsi), %rdi
testq %rdi, %rdi
je 0x144478
testb %al, %al
setne %dl
testb %cl, %cl
sete %cl
andb %dl, %cl
subb %cl, %al
movzbl %al, %esi
leaq 0x20(%rsp), %rdx
leaq 0x14(%rsp), %rcx
callq 0x15bdb3
movl 0x14(%rsp), %r15d
movq 0x20(%rsp), %r13
movq (%rbx), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, 0x10(%rax)
jb 0x144168
addq $0x32, %rsi
movq %rsi, 0x8(%rax)
movq (%rax), %rdi
shlq $0x4, %rsi
leaq 0x240f40(%rip), %rdx    # 0x385098
movl $0x3d, %ecx
callq 0x1094e6
movq (%rbx), %rcx
movq %rax, (%rcx)
movq (%rbx), %rcx
movq (%rcx), %rax
testq %rax, %rax
je 0x144473
movq 0x10(%rcx), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x10(%rcx)
shlq $0x4, %rdx
movl %r15d, 0x8(%rax,%rdx)
movq %r13, (%rax,%rdx)
addq %r15, 0x10(%rbx)
movq 0x18(%rsp), %r13
cmpq $0x0, 0x30(%rbx)
je 0x1441aa
cmpb $0x1, 0x38(%rbx)
jne 0x14426f
movq 0x8(%rsp), %r15
subq 0x98(%rbp), %r15
movq 0x18(%r13), %rax
imulq $0xc8, 0x28(%rbx), %rcx
movl 0xb0(%rax,%rcx), %r13d
movq (%rbx), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, 0x10(%rax)
jb 0x1441fd
addq $0x32, %rsi
movq %rsi, 0x8(%rax)
movq (%rax), %rdi
shlq $0x4, %rsi
leaq 0x240eab(%rip), %rdx    # 0x385098
movl $0x3d, %ecx
callq 0x1094e6
movq (%rbx), %rcx
movq %rax, (%rcx)
movq (%rbx), %rcx
movq (%rcx), %rax
testq %rax, %rax
je 0x144464
movq 0x10(%rcx), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x10(%rcx)
shlq $0x4, %rdx
movl %r13d, 0x8(%rax,%rdx)
movq %r15, (%rax,%rdx)
addq %r13, 0x10(%rbx)
movq 0x18(%rsp), %r13
movq 0x8(%rsp), %rax
movq %rax, 0xa0(%rbp)
leaq 0x1(%r12), %rax
movq %rax, 0x20(%rbx)
movq 0x28(%rbx), %rax
incq %rax
movq %rax, 0x28(%rbx)
imulq $0xc8, %rax, %r15
addq 0x18(%r13), %r15
movq 0x30(%rsp), %r14
incq %r12
cmpq %r14, %r12
jbe 0x143ebd
jmp 0x14444b
cmpb $0x1, 0xc0(%rbp)
jne 0x144281
cmpb $0x0, 0xbc(%rbp)
jne 0x14422e
cmpb $0x1, 0xc1(%rbp)
jne 0x1442f0
cmpb $0x1, 0xbe(%rbp)
jne 0x1442a5
movq 0x8(%rsp), %rax
cmpq 0xa0(%rbp), %rax
jge 0x1444aa
cmpb $0x1, 0xbd(%rbp)
jne 0x1442c0
movq 0x8(%rsp), %rax
cmpq 0xa0(%rbp), %rax
jle 0x1444af
movq %rbp, %rsi
movq 0x8(%rsp), %rbp
movq 0x80(%rsi), %rax
movq 0x90(%rsi), %rcx
movq 0xa0(%rsi), %rdx
addq %rcx, %rdx
subq %rdx, %rbp
subq %rcx, %rax
cmpq %rax, %rbp
jbe 0x144327
jmp 0x1444a5
movq %rbp, %rcx
movq 0x8(%rsp), %rbp
movq 0x88(%rcx), %rax
cmpq %rax, %rbp
jg 0x144491
movq %rcx, %rsi
movq 0x98(%rcx), %rcx
subq %rcx, %rbp
jl 0x14448c
subq %rcx, %rax
cmpq %rax, %rbp
ja 0x144487
movq %rsi, %r14
cmpb $0x1, 0xc2(%rsi)
jne 0x1443d4
movq 0x18(%r13), %rax
imulq $0xc8, 0x28(%rbx), %rcx
movq 0x8(%rax,%rcx), %rdi
testq %rdi, %rdi
je 0x1444a0
movq %rbp, %rsi
leaq 0x20(%rsp), %rdx
leaq 0x14(%rsp), %rcx
callq 0x15bdb3
movl 0x14(%rsp), %r15d
movq 0x20(%rsp), %r13
movq (%rbx), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, 0x10(%rax)
jb 0x1443a0
addq $0x32, %rsi
movq %rsi, 0x8(%rax)
movq (%rax), %rdi
shlq $0x4, %rsi
leaq 0x240d08(%rip), %rdx    # 0x385098
movl $0x3d, %ecx
callq 0x1094e6
movq (%rbx), %rcx
movq %rax, (%rcx)
movq (%rbx), %rcx
movq (%rcx), %rax
testq %rax, %rax
je 0x14449b
movq %r14, %rbp
movq 0x10(%rcx), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x10(%rcx)
shlq $0x4, %rdx
movl %r15d, 0x8(%rax,%rdx)
movq %r13, (%rax,%rdx)
addq %r15, 0x10(%rbx)
jmp 0x144229
movq 0x18(%r13), %rax
imulq $0xc8, 0x28(%rbx), %rcx
movl 0xac(%rax,%rcx), %r15d
movq (%rbx), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, 0x10(%rax)
jb 0x14441b
addq $0x32, %rsi
movq %rsi, 0x8(%rax)
movq (%rax), %rdi
shlq $0x4, %rsi
leaq 0x240c8d(%rip), %rdx    # 0x385098
movl $0x3d, %ecx
callq 0x1094e6
movq (%rbx), %rcx
movq %rax, (%rcx)
movq (%rbx), %rcx
movq (%rcx), %rax
testq %rax, %rax
je 0x144496
movq 0x10(%rcx), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x10(%rcx)
shlq $0x4, %rdx
movl %r15d, 0x8(%rax,%rdx)
movq %rbp, (%rax,%rdx)
addq %r15, 0x10(%rbx)
movq %r14, %rbp
jmp 0x14422e
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x41846
callq 0x4187d
callq 0x41b21
callq 0x4180f
callq 0x41768
callq 0x418b6
callq 0x418ed
callq 0x417d8
callq 0x417a1
callq 0x41926
callq 0x4195f
callq 0x41998
callq 0x41a43
callq 0x41a7a
callq 0x41ab1
callq 0x41ae8
callq 0x419d1
callq 0x41a0a