// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/encdesc_header_io.c
// Function: encdesc_read_header
int encdesc_read_header(GtEncdesc *encdesc, FILE *fp, GtError *err)
{
  int had_err = 0;
  GtUword cur_field_num;
  DescField *cur_field;

  had_err = encdesc_header_io_basics(encdesc, fp, gt_io_error_fread, err);

  if (!had_err)
    encdesc->fields = gt_calloc((size_t) encdesc->num_of_fields,
                                sizeof (DescField));

  for (cur_field_num = 0;
       !had_err && cur_field_num < encdesc->num_of_fields;
       cur_field_num++) {
    cur_field = &encdesc->fields[cur_field_num];
    /* cur_field->bits_per_num = 0; */
    /* cur_field->prev_value = 0; */
    had_err = io_field_sep_and_is_const(cur_field, fp, gt_io_error_fread, err);

    if (!had_err && cur_field->is_const) {
      gt_log_log("field " GT_WU " is const", cur_field_num);
      had_err = io_cons_field_header(cur_field, fp, gt_io_error_fread, err);
    }
    else if (!had_err) {
      had_err = gt_io_error_fread_one(cur_field->is_numeric, fp, err);
      if (!had_err && cur_field->is_numeric) {
        gt_log_log("field " GT_WU " is numeric", cur_field_num);
        had_err = io_numeric_field_header(cur_field, fp, gt_io_error_fread,
                                          err);
      }
      else if (!had_err) {
        had_err = io_field_len_header(cur_field, fp, gt_io_error_fread, err);

        if (!had_err) {
          cur_field->bittab = gt_bittab_new(cur_field->len);

          cur_field->data = gt_calloc((size_t) (cur_field->len + 1),
                                      sizeof (char));
          had_err = gt_io_error_fread(cur_field->data, sizeof (char),
                                      (size_t) cur_field->len, fp, err);

        }
        if (!had_err)
          had_err = read_field_header_bittab(cur_field, fp, err);

        if (!had_err) {
          cur_field->chars = gt_calloc((size_t) (cur_field->max_len + 1),
                                       sizeof (cur_field->chars));

          had_err = read_field_char_dists(cur_field, fp, err);
        }
      }
    }
  }
  if (!had_err)
    had_err = gt_io_error_fread_one(encdesc->start_of_samplingtab, fp, err);
  if (!had_err)
    had_err = gt_io_error_fread_one(encdesc->start_of_encoding, fp, err);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
addq $0x38, %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
movl %eax, %r12d
movq 0x38(%r15), %rsi
leaq 0x23e391(%rip), %rdi    # 0x37c872
xorl %eax, %eax
callq 0x103d72
leaq 0x40(%r15), %rbp
testl %r12d, %r12d
je 0x13e505
movq (%rbp), %rsi
leaq 0x23e388(%rip), %rdi    # 0x37c884
xorl %eax, %eax
callq 0x103d72
jmp 0x13e553
movl $0x8, %esi
movl $0x1, %edx
movq %rbp, %rdi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
movl %eax, %r12d
movq (%rbp), %rsi
leaq 0x23e359(%rip), %rdi    # 0x37c884
xorl %eax, %eax
callq 0x103d72
testl %r12d, %r12d
jne 0x13e553
leaq 0x6c(%r15), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
movl %eax, %r12d
leaq 0x23e33d(%rip), %rax    # 0x37c897
leaq 0x23e352(%rip), %rdi    # 0x37c8b3
cmpb $0x0, 0x6c(%r15)
cmovneq %rax, %rdi
xorl %eax, %eax
callq 0x103d72
leaq 0x68(%r15), %r13
testl %r12d, %r12d
je 0x13e591
movl (%r13), %esi
leaq 0x23e348(%rip), %rdi    # 0x37c8cd
xorl %eax, %eax
callq 0x103d72
jmp 0x13e9d3
movl $0x4, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
movl %eax, %r12d
movl (%r13), %esi
leaq 0x23e316(%rip), %rdi    # 0x37c8cd
xorl %eax, %eax
callq 0x103d72
testl %r12d, %r12d
jne 0x13e9d3
movq 0x40(%r15), %rdi
leaq 0x23e257(%rip), %rdx    # 0x37c829
movl $0xc8, %esi
movl $0x260, %ecx            # imm = 0x260
callq 0x10436a
movq %rax, 0x18(%r15)
xorl %ecx, %ecx
movq %r15, (%rsp)
movq %rbp, 0x10(%rsp)
cmpq (%rbp), %rcx
jae 0x13e997
movq 0x18(%r15), %r13
movq %rcx, 0x8(%rsp)
imulq $0xc8, %rcx, %r15
leaq (%r15,%r13), %rdi
addq $0xb8, %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
testl %eax, %eax
jne 0x13e9d0
addq %r15, %r13
leaq 0xbb(%r13), %rbp
movl $0x1, %esi
movl $0x1, %edx
movq %rbp, %rdi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
testl %eax, %eax
jne 0x13e9d0
cmpb $0x1, (%rbp)
jne 0x13e6ed
leaq 0x23e1dd(%rip), %rdi    # 0x37c84a
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x103d72
leaq 0x50(%r13), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
testl %eax, %eax
movq (%rsp), %r15
jne 0x13e9d0
movq 0x40(%r13), %rdi
movq 0x50(%r13), %rsi
incq %rsi
leaq 0x23e179(%rip), %rdx    # 0x37c829
movl $0x4c, %ecx
callq 0x104461
movq %rax, 0x40(%r13)
movq 0x50(%r13), %rcx
movb $0x0, (%rax,%rcx)
movq 0x40(%r13), %rdi
movq 0x50(%r13), %rdx
movl $0x1, %esi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
movl %eax, %r12d
movq 0x10(%rsp), %rbp
movq 0x8(%rsp), %rcx
jmp 0x13e754
leaq 0xbf(%r13), %rbp
movl $0x1, %esi
movl $0x1, %edx
movq %rbp, %rdi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
testl %eax, %eax
movq (%rsp), %r15
jne 0x13e9d0
cmpb $0x1, (%rbp)
jne 0x13e765
leaq 0x23e138(%rip), %rdi    # 0x37c85d
movq 0x8(%rsp), %r12
movq %r12, %rsi
xorl %eax, %eax
callq 0x103d72
movq %r13, %rdi
movq %r14, %rsi
leaq 0x185c2(%rip), %rdx     # 0x156d03
movq %rbx, %rcx
callq 0x13de90
movq %r12, %rcx
movl %eax, %r12d
movq 0x10(%rsp), %rbp
incq %rcx
testl %r12d, %r12d
je 0x13e5f0
jmp 0x13e9d3
leaq 0xb9(%r13), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
testl %eax, %eax
jne 0x13e9d0
leaq 0x50(%r13), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %rdi, 0x18(%rsp)
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
testl %eax, %eax
jne 0x13e9d0
leaq 0x68(%r13), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %rdi, 0x20(%rsp)
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
testl %eax, %eax
jne 0x13e9d0
leaq 0x58(%r13), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
testl %eax, %eax
jne 0x13e9d0
leaq 0xa8(%r13), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
testl %eax, %eax
jne 0x13e9d0
movq 0x50(%r13), %rdi
callq 0xd6a50
movq %rax, 0x18(%r13)
movq 0x50(%r13), %rdi
incq %rdi
movl $0x1, %esi
leaq 0x23dfef(%rip), %rdx    # 0x37c829
movl $0x27c, %ecx            # imm = 0x27C
callq 0x10436a
movq %rax, 0x40(%r13)
movq 0x50(%r13), %rdx
movl $0x1, %esi
movq %rax, %rdi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
testl %eax, %eax
jne 0x13e9d0
movq 0x18(%rsp), %rax
movq (%rax), %r15
testq %r15, %r15
je 0x13e8cd
xorl %ebp, %ebp
movl $0x1, %esi
movl $0x1, %edx
leaq 0x30(%rsp), %rdi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
movl %eax, %r12d
testl %eax, %eax
je 0x13e8a4
incq %rbp
cmpq %r15, %rbp
jne 0x13e876
jmp 0x13e9d3
testb $0x1, 0x30(%rsp)
je 0x13e8b7
movq 0x18(%r13), %rdi
movq %rbp, %rsi
callq 0xd6abc
incq %rbp
cmpq %r15, %rbp
jne 0x13e876
testl %r12d, %r12d
movq (%rsp), %r15
je 0x13e8d1
jmp 0x13e9d3
movq (%rsp), %r15
movq 0x68(%r13), %rdi
incq %rdi
movl $0x8, %esi
leaq 0x23df45(%rip), %rdx    # 0x37c829
movl $0x286, %ecx            # imm = 0x286
callq 0x10436a
movq %rax, 0x30(%r13)
movq %rbx, 0x48(%rsp)
movl $0x0, 0x50(%rsp)
movq %r14, 0x30(%rsp)
xorl %ebp, %ebp
movq 0x20(%rsp), %rax
cmpq (%rax), %rbp
jae 0x13e984
movq 0x18(%rsp), %rax
cmpq (%rax), %rbp
jae 0x13e92d
movq 0x18(%r13), %rdi
movq %rbp, %rsi
callq 0xd6e4a
xorl %r12d, %r12d
testb %al, %al
jne 0x13e977
movl $0x8, %esi
movl $0x1, %edx
leaq 0x28(%rsp), %rdi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
movl %eax, %r12d
movq 0x30(%r13), %rax
movq (%rax,%rbp,8), %rdi
movq 0x28(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rcx
callq 0x13e9e5
movq 0x30(%r13), %rcx
movq %rax, (%rcx,%rbp,8)
movq 0x30(%r13), %rax
cmpq $0x0, (%rax,%rbp,8)
je 0x13e98c
incq %rbp
testl %r12d, %r12d
je 0x13e906
jmp 0x13e6e1
xorl %r12d, %r12d
jmp 0x13e6e1
movl $0x1, %r12d
jmp 0x13e6e1
leaq 0x58(%r15), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
testl %eax, %eax
jne 0x13e9d0
addq $0x60, %r15
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156d03
movl %eax, %r12d
movl %r12d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq