// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x192b0
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq $0x0, 0x28(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x20(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x28(%rsp), %rax
movq (%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x16397f
movq 0x4d8652(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3b26bb(%rip), %rsi    # 0x516013
leaq 0x3eb0bd(%rip), %rdx    # 0x54ea1c
leaq 0x3eb0dc(%rip), %rcx    # 0x54ea42
leaq 0x3ea8fb(%rip), %r8     # 0x54e268
movl $0xde, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x163981
movq 0x30(%rsp), %rax
testb $0x1, 0x6c(%rax)
jne 0x16399b
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x163bf0
movq 0x30(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rsp), %rcx
imulq $0xc8, 0x28(%rcx), %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x10(%rsp), %rax
ja 0x163b34
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rsp), %rcx
movsbl (%rax,%rcx), %eax
movq 0x8(%rsp), %rcx
movsbl 0xb8(%rcx), %ecx
cmpl %ecx, %eax
je 0x163a04
movq 0x20(%rsp), %rax
cmpq 0x10(%rsp), %rax
jne 0x163b1f
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rsp), %rcx
movb $0x0, (%rax,%rcx)
movq 0x8(%rsp), %rax
testb $0x1, 0xbb(%rax)
jne 0x163ade
movq 0x8(%rsp), %rax
testb $0x1, 0xbf(%rax)
je 0x163a4a
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x163cb0
jmp 0x163adc
movq 0x8(%rsp), %rax
testb $0x1, 0xb9(%rax)
jne 0x163a6c
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x164030
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rdx
subq 0x20(%rdx), %rcx
cmpq %rcx, %rax
jae 0x163ada
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq 0x50(%rcx), %rax
jae 0x163ab4
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x18(%rsp), %rsi
callq 0x8a780
testb $0x1, %al
jne 0x163ac8
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x1640a0
jmp 0x163aca
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x163a75
jmp 0x163adc
jmp 0x163ade
movq 0x20(%rsp), %rcx
addq $0x1, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rax)
movq 0x30(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rsp), %rcx
imulq $0xc8, 0x28(%rcx), %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
jmp 0x163b21
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x1639c2
addq $0x38, %rsp
retq
nopl (%rax)