// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rcx
leaq 0x3279f(%rip), %rdx     # 0x1978e0
callq 0x164810
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x16517c
movq 0x30(%rsp), %rax
movq 0x40(%rax), %rdi
movl $0xc8, %esi
leaq 0x3e9c6e(%rip), %rdx    # 0x54edd4
movl $0x260, %ecx            # imm = 0x260
callq 0xe83c0
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x18(%rax)
movq $0x0, 0x10(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x1c(%rsp)
movb %al, 0x7(%rsp)
jne 0x1651a7
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq 0x40(%rcx), %rax
setb %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x1651b4
jmp 0x1653e5
movq 0x30(%rsp), %rax
movq 0x18(%rax), %rax
imulq $0xc8, 0x10(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rcx
leaq 0x326fc(%rip), %rdx     # 0x1978e0
callq 0x164960
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x165239
movq 0x8(%rsp), %rax
testb $0x1, 0xbb(%rax)
je 0x165239
movq 0x10(%rsp), %rsi
leaq 0x3e9be7(%rip), %rdi    # 0x54edf5
movb $0x0, %al
callq 0xe7740
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rcx
leaq 0x326b5(%rip), %rdx     # 0x1978e0
callq 0x1649f0
movl %eax, 0x1c(%rsp)
jmp 0x1653d0
cmpl $0x0, 0x1c(%rsp)
jne 0x1653ce
movq 0x8(%rsp), %rdi
addq $0xbf, %rdi
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %r8
movl $0x1, %edx
movq %rdx, %rsi
callq 0x1978e0
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x1652b7
movq 0x8(%rsp), %rax
testb $0x1, 0xbf(%rax)
je 0x1652b7
movq 0x10(%rsp), %rsi
leaq 0x3e9b7c(%rip), %rdi    # 0x54ee08
movb $0x0, %al
callq 0xe7740
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rcx
leaq 0x32637(%rip), %rdx     # 0x1978e0
callq 0x164ad0
movl %eax, 0x1c(%rsp)
jmp 0x1653cc
cmpl $0x0, 0x1c(%rsp)
jne 0x1653ca
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rcx
leaq 0x32608(%rip), %rdx     # 0x1978e0
callq 0x164d30
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x16535b
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rdi
callq 0x89a20
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rdi
addq $0x1, %rdi
movl $0x1, %esi
leaq 0x3e9ab9(%rip), %rdx    # 0x54edd4
movl $0x27c, %ecx            # imm = 0x27C
callq 0xe83c0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rdi
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rdx
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %r8
movl $0x1, %esi
callq 0x1978e0
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x16537a
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x165450
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x1653c8
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rdi
addq $0x1, %rdi
movl $0x8, %esi
leaq 0x3e9a3a(%rip), %rdx    # 0x54edd4
movl $0x286, %ecx            # imm = 0x286
callq 0xe83c0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x165570
movl %eax, 0x1c(%rsp)
jmp 0x1653ca
jmp 0x1653cc
jmp 0x1653ce
jmp 0x1653d0
jmp 0x1653d2
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x165185
cmpl $0x0, 0x1c(%rsp)
jne 0x165412
movq 0x30(%rsp), %rdi
addq $0x58, %rdi
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %r8
movl $0x8, %esi
movl $0x1, %edx
callq 0x1978e0
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x16543f
movq 0x30(%rsp), %rdi
addq $0x60, %rdi
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %r8
movl $0x8, %esi
movl $0x1, %edx
callq 0x1978e0
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)