// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/encdesc_header_io.c
// Function: encdesc_write_header
int encdesc_write_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_fwrite, err);

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

    if (!had_err && cur_field->is_const) {
      had_err = io_cons_field_header(cur_field, fp, gt_io_error_fwrite, err);
    }
    else if (!had_err) {
      had_err = gt_io_error_fwrite_one(cur_field->is_numeric, fp, err);
      if (!had_err && cur_field->is_numeric) {
        had_err = io_numeric_field_header(cur_field, fp, gt_io_error_fwrite,
                                          err);
      }
      else if (!had_err) {

        had_err = io_field_len_header(cur_field, fp, gt_io_error_fwrite, err);

        if (!had_err)
          had_err = gt_io_error_fwrite(cur_field->data, sizeof (char),
                                       (size_t) cur_field->len, fp, err);

        if (!had_err)
          had_err = write_field_header_bittab(cur_field, fp, err);

        if (!had_err)
          had_err = write_field_char_dists(cur_field, 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 0x3321f(%rip), %rdx     # 0x197850
callq 0x164810
movl %eax, 0x1c(%rsp)
movq $0x0, 0x10(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x1c(%rsp)
movb %al, 0x7(%rsp)
jne 0x164665
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 0x164672
jmp 0x164805
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 0x331ae(%rip), %rdx     # 0x197850
callq 0x164960
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x1646e4
movq 0x8(%rsp), %rax
testb $0x1, 0xbb(%rax)
je 0x1646e4
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rcx
leaq 0x3317a(%rip), %rdx     # 0x197850
callq 0x1649f0
movl %eax, 0x1c(%rsp)
jmp 0x1647f0
cmpl $0x0, 0x1c(%rsp)
jne 0x1647ee
movq 0x8(%rsp), %rdi
addq $0xbf, %rdi
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %r8
movl $0x1, %edx
movq %rdx, %rsi
callq 0x197850
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x16474f
movq 0x8(%rsp), %rax
testb $0x1, 0xbf(%rax)
je 0x16474f
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rcx
leaq 0x3310f(%rip), %rdx     # 0x197850
callq 0x164ad0
movl %eax, 0x1c(%rsp)
jmp 0x1647ec
cmpl $0x0, 0x1c(%rsp)
jne 0x1647ea
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rcx
leaq 0x330e0(%rip), %rdx     # 0x197850
callq 0x164d30
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x1647aa
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 0x197850
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x1647c9
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x164e50
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x1647e8
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x164fa0
movl %eax, 0x1c(%rsp)
jmp 0x1647ea
jmp 0x1647ec
jmp 0x1647ee
jmp 0x1647f0
jmp 0x1647f2
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x164643
movl 0x1c(%rsp), %eax
addq $0x38, %rsp
retq
nop