// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq %rdi, %r14
addq $0x38, %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
movq 0x38(%r14), %rsi
leaq 0x2416f0(%rip), %rdi    # 0x385be2
xorl %eax, %eax
callq 0x108e02
testl %r13d, %r13d
jne 0x14451a
leaq 0x40(%r14), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
movq 0x40(%r14), %rsi
leaq 0x2416cf(%rip), %rdi    # 0x385bf4
xorl %eax, %eax
callq 0x108e02
testl %r13d, %r13d
jne 0x14454d
leaq 0x6c(%r14), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
leaq 0x2416b3(%rip), %rax    # 0x385c07
leaq 0x2416c8(%rip), %rdi    # 0x385c23
cmpb $0x0, 0x6c(%r14)
cmovneq %rax, %rdi
xorl %eax, %eax
callq 0x108e02
testl %r13d, %r13d
jne 0x14458c
leaq 0x68(%r14), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
movl 0x68(%r14), %esi
leaq 0x2416a6(%rip), %rdi    # 0x385c3d
xorl %eax, %eax
callq 0x108e02
testl %r13d, %r13d
je 0x1445b5
movl %r13d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x40(%r14)
je 0x1445a3
xorl %ebp, %ebp
movq %rbx, 0x10(%rsp)
movq 0x18(%r14), %rax
imulq $0xc8, %rbp, %rcx
leaq (%rax,%rcx), %r12
leaq (%rax,%rcx), %rdi
addq $0xb8, %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %eax, %eax
jne 0x144619
leaq 0xbb(%r12), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %r13d, %r13d
jne 0x1446c4
cmpb $0x1, 0xbb(%r12)
jne 0x144696
leaq 0x50(%r12), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
testl %eax, %eax
jne 0x144691
movq 0x40(%r12), %rdi
movq 0x50(%r12), %rsi
incq %rsi
leaq 0x24153a(%rip), %rdx    # 0x385b99
movl $0x4c, %ecx
callq 0x1094e6
movq %rax, 0x40(%r12)
movq 0x50(%r12), %rcx
movb $0x0, (%rax,%rcx)
movq 0x40(%r12), %rdi
movq 0x50(%r12), %rdx
movl $0x1, %esi
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
jmp 0x1446c4
movq %rbx, %r8
movq %r12, %rbx
addq $0xbf, %r12
movl $0x1, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %r15, %rcx
callq 0x15e878
testl %eax, %eax
je 0x1446df
movl %eax, %r13d
movq 0x10(%rsp), %rbx
testl %r13d, %r13d
jne 0x1445a3
incq %rbp
cmpq 0x40(%r14), %rbp
jb 0x1445c3
jmp 0x1445a3
movq %rbx, 0x8(%rsp)
cmpb $0x1, (%r12)
jne 0x1447b2
movq %r15, 0x28(%rsp)
movq 0x8(%rsp), %r12
leaq 0xbd(%r12), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r15, %rcx
movq 0x10(%rsp), %rbx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
cmpb $0x1, 0xbd(%r12)
jne 0x144737
leaq 0x221803(%rip), %rdi    # 0x365f33
xorl %eax, %eax
callq 0x108e02
testl %r13d, %r13d
jne 0x144775
leaq 0xbe(%r12), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
cmpb $0x1, 0xbe(%r12)
jne 0x144775
leaq 0x2414e9(%rip), %rdi    # 0x385c57
xorl %eax, %eax
callq 0x108e02
testl %r13d, %r13d
jne 0x144973
addq $0xba, %r12
movl $0x1, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
testl %eax, %eax
je 0x14490c
movl %eax, %r13d
movq 0x8(%rsp), %r12
jmp 0x144973
movq 0x8(%rsp), %r12
leaq 0xb9(%r12), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r15, %rcx
movq 0x10(%rsp), %rbx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %eax, %eax
jne 0x1447fd
leaq 0x50(%r12), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %r13d, %r13d
jne 0x14481f
leaq 0x68(%r12), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %r13d, %r13d
jne 0x144841
leaq 0x58(%r12), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %r13d, %r13d
jne 0x144866
leaq 0xa8(%r12), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %r13d, %r13d
jne 0x144888
movq 0x40(%r12), %rdi
movq 0x50(%r12), %rdx
movl $0x1, %esi
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %r13d, %r13d
jne 0x1449e3
movq %r14, 0x18(%rsp)
movq %r15, %r14
movq %rbx, %r15
movq 0x50(%r12), %rbx
movb $0x0, 0x28(%rsp)
testq %rbx, %rbx
je 0x1449d0
movb $0x1, %al
xorl %r12d, %r12d
testb $0x1, %al
je 0x1448d2
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
movq %r12, %rsi
callq 0xd94c7
testb %al, %al
je 0x1448d2
orb $0x1, 0x28(%rsp)
movl $0x1, %esi
movl $0x1, %edx
leaq 0x28(%rsp), %rdi
movq %r14, %rcx
movq %r15, %r8
callq 0x15e878
movl %eax, %r13d
movb $0x0, 0x28(%rsp)
testl %eax, %eax
sete %al
jne 0x1449d3
incq %r12
cmpq %rbx, %r12
jb 0x1448b4
jmp 0x1449d3
xorl %r13d, %r13d
cmpb $0x1, (%r12)
movq 0x8(%rsp), %r12
jne 0x144973
leaq 0xb9(%r12), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
testl %eax, %eax
jne 0x144970
movzbl 0xb9(%r12), %eax
leaq 0xb4(%r12), %rdi
leaq 0x50(%r12), %rcx
testl %eax, %eax
leaq 0x4(,%rax,4), %rsi
cmovneq %rcx, %rdi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %r13d, %r13d
je 0x144985
movl $0x0, 0x18(%rsp)
jmp 0x144d2d
cmpb $0x1, 0xba(%r12)
jne 0x14499d
movb $0x1, %al
cmpb $0x1, 0xb9(%r12)
jne 0x14499f
xorl %eax, %eax
movl %eax, 0x18(%rsp)
leaq 0x98(%r12), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
testl %eax, %eax
je 0x144af8
movl %eax, %r13d
jmp 0x144b2e
xorl %r13d, %r13d
movq %r15, %rbx
movq %r14, %r15
movq 0x18(%rsp), %r14
movq 0x8(%rsp), %r12
testl %r13d, %r13d
jne 0x1446c4
movq %r15, 0x28(%rsp)
movl $0x0, 0x48(%rsp)
leaq 0x30(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rbx, 0x40(%rsp)
cmpq $0x0, 0x68(%r12)
je 0x144f49
movq %r12, %rbx
xorl %r12d, %r12d
cmpq 0x50(%rbx), %r12
jae 0x144a38
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xd94c7
xorl %r13d, %r13d
testb %al, %al
jne 0x144ad8
movq 0x30(%rbx), %rax
movq (%rax,%r12,8), %rdi
xorl %eax, %eax
movq %rax, 0x50(%rsp)
leaq 0x50(%rsp), %rcx
movq %rcx, 0x58(%rsp)
leaq 0x1456(%rip), %rcx      # 0x145eae
movq %rcx, 0x60(%rsp)
movq %rax, 0x68(%rsp)
leaq 0x13c9(%rip), %rsi      # 0x145e32
leaq 0x58(%rsp), %rdx
xorl %ecx, %ecx
callq 0x106adc
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0x8, %esi
movl $0x1, %edx
leaq 0x20(%rsp), %rdi
movq %r15, %rcx
movq 0x10(%rsp), %r8
callq 0x15e878
movl %eax, %r13d
testl %eax, %eax
jne 0x144ac6
movq 0x30(%rbx), %rax
movq (%rax,%r12,8), %rdi
movq 0x20(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq 0x10(%rsp), %rcx
callq 0x145c14
movq 0x30(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
movq 0x30(%rbx), %rax
cmpq $0x0, (%rax,%r12,8)
movl $0x1, %eax
cmovel %eax, %r13d
testl %r13d, %r13d
jne 0x1446bf
incq %r12
movq 0x8(%rsp), %rbx
cmpq 0x68(%rbx), %r12
jb 0x144a1b
jmp 0x1446bf
leaq 0x88(%r12), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
movq 0x98(%r12), %rax
cmpq 0x88(%r12), %rax
jg 0x14504a
testl %r13d, %r13d
jne 0x144b53
leaq 0x90(%r12), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %r13d, %r13d
jne 0x144b8e
leaq 0x80(%r12), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
movq 0x90(%r12), %rax
cmpq 0x80(%r12), %rax
jg 0x145045
testl %r13d, %r13d
jne 0x144bd8
leaq 0xc0(%r12), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
cmpb $0x1, 0xc0(%r12)
jne 0x144bd5
leaq 0x78(%r12), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %r13d, %r13d
jne 0x144c29
cmpb $0x1, 0xc0(%r12)
jne 0x144c09
movq 0x78(%r12), %rax
cmpq %rax, 0x98(%r12)
jne 0x14504f
cmpq %rax, 0x88(%r12)
jne 0x145054
leaq 0xbc(%r12), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %r13d, %r13d
jne 0x144c7a
xorl %r13d, %r13d
cmpb $0x1, 0xbc(%r12)
jne 0x144c7a
leaq 0x70(%r12), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
movq 0x70(%r12), %rax
cmpq %rax, 0x90(%r12)
jne 0x145059
cmpq %rax, 0x80(%r12)
jne 0x14505e
testl %r13d, %r13d
jne 0x144c9f
leaq 0xc1(%r12), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %r13d, %r13d
jne 0x144cc1
leaq 0x48(%r12), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %r13d, %r13d
jne 0x144ce3
leaq 0x60(%r12), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %r13d, %r13d
jne 0x144d08
leaq 0xac(%r12), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %r13d, %r13d
jne 0x144d2d
leaq 0xb0(%r12), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %rbx, %r8
callq 0x15e878
movl %eax, %r13d
testl %r13d, %r13d
je 0x144d3a
xorl %r12d, %r12d
jmp 0x144e4e
movb $0x0, 0xc2(%r12)
cmpb $0x1, 0xc1(%r12)
jne 0x144d92
xorl %r13d, %r13d
cmpb $0x0, 0xbc(%r12)
movq %r12, %rbx
movl $0x0, %r12d
jne 0x144dd7
movq 0x48(%rbx), %rsi
xorl %r13d, %r13d
cmpq $0x400, %rsi            # imm = 0x400
ja 0x144dd7
movb $0x1, 0xc2(%rbx)
xorl %r12d, %r12d
leaq 0x241005(%rip), %rdi    # 0x385d8b
xorl %eax, %eax
callq 0x108e02
movb $0x1, %r13b
jmp 0x144dd7
xorl %r13d, %r13d
cmpb $0x0, 0xc0(%r12)
movq %r12, %rbx
movl $0x0, %r12d
jne 0x144dd7
movq 0x60(%rbx), %rsi
leaq -0x1(%rsi), %rax
xorl %r13d, %r13d
cmpq $0x3ff, %rax            # imm = 0x3FF
ja 0x144dd7
movb $0x1, 0xc2(%rbx)
xorl %r13d, %r13d
leaq 0x240fd5(%rip), %rdi    # 0x385da2
xorl %eax, %eax
callq 0x108e02
movb $0x1, %r12b
cmpb $0x1, 0xc2(%rbx)
jne 0x144dee
leaq 0x240e84(%rip), %rdi    # 0x385c6b
xorl %eax, %eax
callq 0x108e02
movl %r13d, %ebx
movq 0x8(%rsp), %rax
cmpb $0x1, 0xc1(%rax)
jne 0x144e0d
leaq 0x240e72(%rip), %rdi    # 0x385c78
xorl %eax, %eax
callq 0x108e02
xorl %r13d, %r13d
testb %bl, %bl
je 0x144e49
movq 0x8(%rsp), %rbx
movq 0x28(%rbx), %rdi
movq 0x48(%rbx), %rsi
leaq 0x28(%rsp), %rdx
movq 0x10(%rsp), %r13
movq %r13, %rcx
callq 0x145c14
movq %rax, 0x28(%rbx)
movq %r13, %rbx
cmpq $0x1, %rax
movl $0x0, %r13d
sbbl %r13d, %r13d
jmp 0x144e4e
movq 0x10(%rsp), %rbx
testl %r13d, %r13d
jne 0x1446c4
testb %r12b, %r12b
je 0x144e81
movq 0x8(%rsp), %rbx
movq 0x20(%rbx), %rdi
movq 0x60(%rbx), %rsi
leaq 0x28(%rsp), %rdx
movq 0x10(%rsp), %rcx
callq 0x145c14
movq %rax, 0x20(%rbx)
movq 0x10(%rsp), %rbx
xorl %r13d, %r13d
cmpb $0x0, 0x18(%rsp)
je 0x1446c4
movq 0x8(%rsp), %r12
movq 0x38(%r12), %r13
testq %r13, %r13
je 0x144f51
movq $0x0, 0x30(%rsp)
movq %rbx, 0x40(%rsp)
movl $0x0, 0x48(%rsp)
movq %r13, %rdi
leaq 0xf88(%rip), %rsi       # 0x145e4a
leaq 0x28(%rsp), %rdx
callq 0xe9bdf
cmpl $0x0, 0x48(%rsp)
jne 0x144edd
movq 0x30(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x28(%rsp), %rcx
movl $0x8, %esi
movl $0x1, %edx
leaq 0x58(%rsp), %rdi
movq %rbx, %r8
callq 0x15e878
movl %eax, 0x48(%rsp)
testl %eax, %eax
jne 0x144f2e
movq $0x0, 0x30(%rsp)
movq %r13, %rdi
leaq 0xf3b(%rip), %rsi       # 0x145e4f
leaq 0x28(%rsp), %rdx
callq 0xe9bdf
movq 0x30(%rsp), %rax
cmpq 0x58(%rsp), %rax
jne 0x145063
cmpl $0x0, 0x48(%rsp)
je 0x14502e
movq %r13, %rdi
callq 0xe9ff6
xorl %r13d, %r13d
jmp 0x14502e
xorl %r13d, %r13d
jmp 0x1446bf
movq %r14, 0x18(%rsp)
movq %r15, 0x70(%rsp)
movq 0x28(%rsp), %r12
callq 0xe99dc
movq %rax, %r14
movl $0x8, %esi
movl $0x1, %edx
leaq 0x20(%rsp), %rdi
movq %r12, %rcx
movq %rbx, %r15
movq %rbx, %r8
callq 0x15e8b7
testl %eax, %eax
sete %bl
jne 0x145003
cmpq $0x0, 0x20(%rsp)
je 0x145003
movl $0x1, %r13d
movl $0x8, %esi
movl $0x1, %edx
leaq 0x58(%rsp), %rdi
movq %r12, %rcx
movq %r15, %rbx
movq %r15, %r8
callq 0x15e8b7
testl %eax, %eax
je 0x144fbf
xorl %ebx, %ebx
jmp 0x144fde
movl $0x8, %esi
movl $0x1, %edx
leaq 0x50(%rsp), %rdi
movq %r12, %rcx
movq %rbx, %r8
callq 0x15e8b7
testl %eax, %eax
sete %bl
testb %bl, %bl
je 0x144ff4
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %r14, %rdi
callq 0xe9a01
cmpq 0x20(%rsp), %r13
setb %al
incq %r13
testb %al, %bl
jne 0x144f9a
testb %bl, %bl
je 0x145011
movq 0x8(%rsp), %r12
movq %r14, %r13
jmp 0x145021
movq %r14, %rdi
callq 0xe9ff6
xorl %r13d, %r13d
movq 0x8(%rsp), %r12
movq %r15, %rbx
movq 0x70(%rsp), %r15
movq 0x18(%rsp), %r14
movq %r13, 0x38(%r12)
cmpq $0x1, %r13
movl $0x0, %r13d
sbbl %r13d, %r13d
jmp 0x1446c4
callq 0x41c75
callq 0x41cae
callq 0x41b58
callq 0x41b91
callq 0x41bca
callq 0x41c03
callq 0x41c3c