// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/encdesc.c
// Function: encdesc_init_huffman
static void encdesc_init_huffman(GtEncdesc *encdesc)
{
  DescField *field;
  GtUword field_idx,
                alphabet_size = 0,
                char_idx;
  GtUword const char_alphabet_size = 256UL;
  EncdescHuffDist huffdist;

  for (field_idx = 0;
       field_idx < encdesc->num_of_fields;
       field_idx++) {
    field = &encdesc->fields[field_idx];
    if (!field->is_const) {
      if (field->is_numeric) {
        if (field->use_delta_coding && field->use_hc) {
          huffdist.correction_base = field->min_delta;
          gt_assert(field->delta_values != NULL);
          huffdist.li_ull_hashmap = field->delta_values;
          alphabet_size =
            (GtUword) labs(field->max_delta - field->min_delta) + 1;
        }
        else if (!field->is_value_const && field->use_hc) {
          huffdist.correction_base = field->min_value;
          gt_assert(field->num_values != NULL);
          huffdist.li_ull_hashmap = field->num_values;
          alphabet_size =
            (GtUword) labs(field->max_value - field->min_value) + 1;
        }

        if (field->use_hc) {
          field->huffman_num =
            gt_huffman_new(&huffdist, encdesc_hashmap_distr_get_corrected,
                           alphabet_size);
        }

        if (field->has_zero_padding && !field->fieldlen_is_const) {
          field->huffman_zero_count =
            gt_huffman_new(field->zero_count,
                           encdesc_distri_get_symbol_freq,
                           (GtUword) field->max_zero + 1);
        }
      }
      else {
        field->huffman_chars = gt_calloc((size_t) (field->max_len + 1),
                                         sizeof (field->huffman_chars));
        for (char_idx = 0; char_idx < field->max_len; char_idx++) {
          if (char_idx >= field->len ||
              !gt_bittab_bit_is_set(field->bittab, char_idx)) {
            field->huffman_chars[char_idx] =
              gt_huffman_new(field->chars[char_idx],
                             encdesc_hashmap_distr_get,
                             char_alphabet_size);
          }
        }
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpq $0x0, 0x40(%rdi)
je 0x142d19
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x120c(%rip), %rbp      # 0x143d9f
xorl %r12d, %r12d
movq 0x18(%rbx), %r13
imulq $0xc8, %r15, %rax
cmpb $0x0, 0xbb(%r13,%rax)
jne 0x142d0c
addq %rax, %r13
cmpb $0x1, 0xbf(%r13)
jne 0x142bfc
cmpb $0x1, 0xc1(%r13)
jne 0x142c6c
cmpb $0x1, 0xc2(%r13)
jne 0x142c6c
movq 0x90(%r13), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%r13), %rcx
movl $0x80, %edx
testq %rcx, %rcx
jne 0x142c9e
jmp 0x142d28
movq 0x68(%r13), %rdi
incq %rdi
movl $0x8, %esi
leaq 0x242489(%rip), %rdx    # 0x385098
movl $0x3d0, %ecx            # imm = 0x3D0
callq 0x1093ef
movq %rax, (%r13)
cmpq $0x0, 0x68(%r13)
je 0x142d0c
xorl %r14d, %r14d
cmpq 0x50(%r13), %r14
jae 0x142c41
movq 0x18(%r13), %rdi
movq %r14, %rsi
callq 0xd94c7
testb %al, %al
jne 0x142c5e
movq 0x30(%r13), %rax
movq (%rax,%r14,8), %rdi
movl $0x100, %edx            # imm = 0x100
movq %rbp, %rsi
callq 0x15b8c0
movq (%r13), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
cmpq 0x68(%r13), %r14
jb 0x142c2b
jmp 0x142d0c
cmpb $0x0, 0xc0(%r13)
jne 0x142cb8
cmpb $0x1, 0xc2(%r13)
jne 0x142cb8
movq 0x98(%r13), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%r13), %rcx
movl $0x88, %edx
testq %rcx, %rcx
je 0x142d2d
movq %rcx, 0x8(%rsp)
movq (%r13,%rdx), %rcx
subq %rax, %rcx
movq %rcx, %r12
negq %r12
cmovsq %rcx, %r12
incq %r12
cmpb $0x1, 0xc2(%r13)
jne 0x142cda
leaq 0x8(%rsp), %rdi
leaq 0x109a(%rip), %rsi      # 0x143d68
movq %r12, %rdx
callq 0x15b8c0
movq %rax, 0x8(%r13)
cmpb $0x1, 0xba(%r13)
jne 0x142d0c
cmpb $0x0, 0xb9(%r13)
jne 0x142d0c
movq 0x38(%r13), %rdi
movl 0xb4(%r13), %edx
incq %rdx
leaq 0x1097(%rip), %rsi      # 0x143d9a
callq 0x15b8c0
movq %rax, 0x10(%r13)
incq %r15
cmpq 0x40(%rbx), %r15
jb 0x142b96
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x412f6
callq 0x412bd