// File: /workspace/github_c_makefile_star2_O2/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
movq %rdi, %rbx
xorl %r14d, %r14d
leaq 0x14e1(%rip), %r12      # 0xd3dce
xorl %r13d, %r13d
cmpq 0x40(%rbx), %r13
jae 0xd2a61
movq 0x18(%rbx), %rbp
imulq $0xc8, %r13, %rax
cmpb $0x0, 0xbb(%rbp,%rax)
je 0xd2914
incq %r13
jmp 0xd28f0
addq %rax, %rbp
cmpb $0x1, 0xbf(%rbp)
jne 0xd295e
cmpb $0x1, 0xc1(%rbp)
jne 0xd29be
movb 0xc2(%rbp), %al
cmpb $0x1, %al
jne 0xd29be
movq 0x90(%rbp), %rcx
movq %rcx, 0x10(%rsp)
movq 0x28(%rbp), %rdx
movl $0x80, %esi
testq %rdx, %rdx
jne 0xd29ef
jmp 0xd2a70
movq 0x68(%rbp), %rdi
incq %rdi
pushq $0x8
popq %rsi
leaq 0x249759(%rip), %rdx    # 0x31c0c8
movl $0x3d0, %ecx            # imm = 0x3D0
callq 0x9334a
movq %rax, (%rbp)
xorl %r15d, %r15d
cmpq 0x68(%rbp), %r15
jae 0xd290f
cmpq 0x50(%rbp), %r15
jae 0xd299c
movq 0x18(%rbp), %rdi
movq %r15, %rsi
callq 0x5e839
testb %al, %al
jne 0xd29b9
movq 0x30(%rbp), %rax
movq (%rax,%r15,8), %rdi
movl $0x100, %edx            # imm = 0x100
movq %r12, %rsi
callq 0xf04b4
movq (%rbp), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
jmp 0xd2980
movb 0xc2(%rbp), %al
cmpb $0x0, 0xc0(%rbp)
jne 0xd2a09
testb $0x1, %al
je 0xd2a09
movq 0x98(%rbp), %rcx
movq %rcx, 0x10(%rsp)
movq 0x20(%rbp), %rdx
movl $0x88, %esi
testq %rdx, %rdx
je 0xd2a9e
movq %rdx, 0x8(%rsp)
movq (%rbp,%rsi), %rdx
subq %rcx, %rdx
movq %rdx, %r14
negq %r14
cmovsq %rdx, %r14
incq %r14
testb $0x1, %al
je 0xd2a25
leaq 0x8(%rsp), %rdi
leaq 0x1355(%rip), %rsi      # 0xd3d6e
movq %r14, %rdx
callq 0xf04b4
movq %rax, 0x8(%rbp)
cmpb $0x1, 0xba(%rbp)
jne 0xd290f
cmpb $0x0, 0xb9(%rbp)
jne 0xd290f
movq 0x38(%rbp), %rdi
movl 0xb4(%rbp), %edx
incq %rdx
leaq 0x1376(%rip), %rsi      # 0xd3dc9
callq 0xf04b4
movq %rax, 0x10(%rbp)
jmp 0xd290f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3654f1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x212592(%rip), %rsi    # 0x2e5013
leaq 0x249d13(%rip), %rdx    # 0x31c79b
leaq 0x249d28(%rip), %rcx    # 0x31c7b7
leaq 0x249632(%rip), %r8     # 0x31c0c8
movl $0x3b4, %r9d            # imm = 0x3B4
jmp 0xd2aca
movq 0x3654c3(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x212564(%rip), %rsi    # 0x2e5013
leaq 0x249d16(%rip), %rdx    # 0x31c7cc
leaq 0x249cfa(%rip), %rcx    # 0x31c7b7
leaq 0x249604(%rip), %r8     # 0x31c0c8
movl $0x3bb, %r9d            # imm = 0x3BB
xorl %eax, %eax
callq 0x17a50
callq 0x17390