// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
addq $0x38, %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
movl %eax, %r13d
movq 0x38(%r12), %rsi
leaq 0x23ee73(%rip), %rdi    # 0x37c872
xorl %eax, %eax
callq 0x103d72
leaq 0x40(%r12), %r15
testl %r13d, %r13d
je 0x13da23
movq (%r15), %rsi
leaq 0x23ee6a(%rip), %rdi    # 0x37c884
xorl %eax, %eax
callq 0x103d72
jmp 0x13da71
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
movl %eax, %r13d
movq (%r15), %rsi
leaq 0x23ee3c(%rip), %rdi    # 0x37c884
xorl %eax, %eax
callq 0x103d72
testl %r13d, %r13d
jne 0x13da71
leaq 0x6c(%r12), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
movl %eax, %r13d
leaq 0x23ee1f(%rip), %rax    # 0x37c897
leaq 0x23ee34(%rip), %rdi    # 0x37c8b3
cmpb $0x0, 0x6c(%r12)
cmovneq %rax, %rdi
xorl %eax, %eax
callq 0x103d72
leaq 0x68(%r12), %rdi
testl %r13d, %r13d
je 0x13daaf
movl (%rdi), %esi
leaq 0x23ee2a(%rip), %rdi    # 0x37c8cd
xorl %eax, %eax
callq 0x103d72
jmp 0x13de79
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
movl %eax, %r13d
movl 0x68(%r12), %esi
leaq 0x23edfa(%rip), %rdi    # 0x37c8cd
xorl %eax, %eax
callq 0x103d72
testl %r13d, %r13d
jne 0x13de79
xorl %eax, %eax
movq %r12, (%rsp)
movq %r15, 0x20(%rsp)
cmpq (%r15), %rax
jae 0x13de8b
movq 0x18(%r12), %rbp
movq %rax, 0x28(%rsp)
imulq $0xc8, %rax, %r15
leaq (%r15,%rbp), %rdi
addq $0xb8, %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
testl %eax, %eax
jne 0x13de76
addq %r15, %rbp
leaq 0xbb(%rbp), %r12
movl $0x1, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
testl %eax, %eax
jne 0x13de76
cmpb $0x1, (%r12)
jne 0x13dbc4
leaq 0x50(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
testl %eax, %eax
jne 0x13de76
movq 0x40(%rbp), %rdi
movq 0x50(%rbp), %rsi
incq %rsi
leaq 0x23ec95(%rip), %rdx    # 0x37c829
movl $0x4c, %ecx
callq 0x104461
movq %rax, 0x40(%rbp)
movq 0x50(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq 0x40(%rbp), %rdi
movq 0x50(%rbp), %rdx
movl $0x1, %esi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
jmp 0x13dc0d
leaq 0xbf(%rbp), %r12
movl $0x1, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
testl %eax, %eax
movl $0x0, %r15d
jne 0x13de76
cmpb $0x1, (%r12)
jne 0x13dc2f
movq %rbp, %rdi
movq %r14, %rsi
leaq 0x190bf(%rip), %rdx     # 0x156cc4
movq %rbx, %rcx
callq 0x13de90
movl %eax, %r13d
movq (%rsp), %r12
movq 0x28(%rsp), %rax
incq %rax
testl %r13d, %r13d
movq 0x20(%rsp), %r15
je 0x13daee
jmp 0x13de79
leaq 0xb9(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
testl %eax, %eax
jne 0x13de76
leaq 0x50(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %rdi, 0x8(%rsp)
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
testl %eax, %eax
jne 0x13de76
leaq 0x68(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %rdi, 0x30(%rsp)
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
testl %eax, %eax
jne 0x13de76
leaq 0x58(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
testl %eax, %eax
jne 0x13de76
leaq 0xa8(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
testl %eax, %eax
jne 0x13de76
movq 0x40(%rbp), %rdi
movq 0x50(%rbp), %rdx
movl $0x1, %esi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
testl %eax, %eax
jne 0x13de76
movq 0x8(%rsp), %rax
movq (%rax), %r12
movb $0x0, 0x38(%rsp)
testq %r12, %r12
je 0x13dd70
movl $0x1, %r15d
leaq -0x1(%r15), %rsi
movq 0x18(%rbp), %rdi
callq 0xd6e4a
testb %al, %al
je 0x13dd32
orb $0x1, 0x38(%rsp)
movl $0x1, %esi
movl $0x1, %edx
leaq 0x38(%rsp), %rdi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
movl %eax, %r13d
movb $0x0, 0x38(%rsp)
cmpq %r12, %r15
jae 0x13dd61
incq %r15
testl %r13d, %r13d
je 0x13dd1c
testl %r13d, %r13d
movl $0x0, %r15d
jne 0x13de79
movq %r14, 0x38(%rsp)
movl $0x0, 0x58(%rsp)
leaq 0x40(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rbx, 0x50(%rsp)
xorl %r12d, %r12d
movq 0x30(%rsp), %rax
cmpq (%rax), %r12
jae 0x13de63
movq 0x8(%rsp), %rax
cmpq (%rax), %r12
jae 0x13ddbf
movq 0x18(%rbp), %rdi
movq %r12, %rsi
callq 0xd6e4a
xorl %r13d, %r13d
testb %al, %al
jne 0x13de52
movq 0x30(%rbp), %rax
movq (%rax,%r12,8), %rdi
movq %r15, 0x18(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0xe64(%rip), %rax       # 0x13ec41
movq %rax, 0x68(%rsp)
movq %r15, 0x70(%rsp)
leaq 0xdd7(%rip), %rsi       # 0x13ebc5
leaq 0x60(%rsp), %rdx
xorl %ecx, %ecx
callq 0x101b64
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movl $0x8, %esi
movl $0x1, %edx
leaq 0x10(%rsp), %rdi
movq %r14, %rcx
movq %rbx, %r8
callq 0x156cc4
movl %eax, %r13d
testl %eax, %eax
jne 0x13de47
movq 0x30(%rbp), %rax
movq (%rax,%r12,8), %rdi
movq 0x10(%rsp), %rsi
leaq 0x38(%rsp), %rdx
movq %rbx, %rcx
callq 0x13e9e5
movq 0x30(%rbp), %rcx
movq %rax, (%rcx,%r12,8)
movq 0x30(%rbp), %rax
cmpq $0x0, (%rax,%r12,8)
je 0x13de6b
incq %r12
testl %r13d, %r13d
je 0x13dd90
jmp 0x13dc10
xorl %r13d, %r13d
jmp 0x13dc10
movl $0x1, %r13d
jmp 0x13dc10
movl %eax, %r13d
movl %r13d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r13d, %r13d
jmp 0x13de79