// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/intset_16.c
// Function: gt_intset_16_io_fp
GtIntset *gt_intset_16_io_fp(GtIntset *intset, FILE *fp, GtError *err,
                                    GtIOFunc io_func)
{
  int had_err = 0;
  GtUword type = (GtUword) GT_INTSET_16_TYPE;
  GtIntset16 *intset_16;
  GtIntsetMembers *members;

  gt_error_check(err);

  intset_16 = gt_intset_16_cast(intset);

  had_err = gt_intset_16_io_one(type);
  if (!had_err && type != GT_INTSET_16_TYPE) {
    /* only applies to reading */
    had_err = 1;
    gt_error_set(err, "Trying to read GtIntset16 from file,"
                 " type does not match!");
  }
  if (!had_err) {
    members = intset->members;
    had_err = gt_intset_16_io_one(members->currentsectionnum);
    if (!had_err)
      had_err = gt_intset_16_io_one(members->maxelement);
    if (!had_err)
      had_err = gt_intset_16_io_one(members->nextfree);
    if (!had_err)
      had_err = gt_intset_16_io_one(members->num_of_elems);
    if (!had_err)
      had_err = gt_intset_16_io_one(members->previouselem);
    if (!had_err) {
      members->logsectionsize = GT_BITS_FOR_TYPE(uint16_t);
      members->numofsections = GT_ELEM2SECTION_M(members->maxelement) + 1;
      members->sectionstart = gt_realloc(members->sectionstart,
                sizeof (*members->sectionstart) * (members->numofsections + 1));
    }
    had_err = io_func(members->sectionstart, sizeof (*members->sectionstart),
                      (size_t) (members->numofsections + 1), fp, err);
    if (!had_err && members->sectionstart[0] != 0) {
      had_err = 1;
      gt_error_set(err, "Unexpected value in sectionstart[0]: "
                   GT_WU " expected 0!", members->sectionstart[0]);
    }
  }
  if (!had_err) {
    intset_16->elements = gt_realloc(intset_16->elements,
                  sizeof (*intset_16->elements) * members->num_of_elems);
    had_err = io_func(intset_16->elements,
                      sizeof (*intset_16->elements),
                      (size_t) members->num_of_elems, fp, err);
  }
  if (had_err) {
    gt_intset_16_delete(intset);
    intset = NULL;
  }
  return intset;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq $0x10, 0x8(%rsp)
testq %rdx, %rdx
je 0x309266
movq %r15, %rdi
callq 0x101a9a
testb %al, %al
jne 0x309433
callq 0x3091a6
movq %rax, %rdi
movq %rbx, %rsi
callq 0x15e2b0
movq %rax, 0x10(%rsp)
leaq 0x8(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r12, %rcx
movq %r15, %r8
callq *%r14
testl %eax, %eax
jne 0x3092b5
cmpq $0x10, 0x8(%rsp)
je 0x3092b5
leaq 0xde516(%rip), %rsi     # 0x3e77bc
movq %r15, %rdi
xorl %eax, %eax
callq 0x1019cf
movl $0x1, %eax
testl %eax, %eax
je 0x3092c1
xorl %r13d, %r13d
jmp 0x3093d4
movq 0x8(%rbx), %rbp
leaq 0x10(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r12, %rcx
movq %r15, %r8
callq *%r14
testl %eax, %eax
jne 0x30938d
leaq 0x18(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r12, %rcx
movq %r15, %r8
callq *%r14
testl %eax, %eax
jne 0x30938d
leaq 0x20(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r12, %rcx
movq %r15, %r8
callq *%r14
testl %eax, %eax
jne 0x30938d
leaq 0x28(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r12, %rcx
movq %r15, %r8
callq *%r14
testl %eax, %eax
jne 0x30938d
leaq 0x38(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r12, %rcx
movq %r15, %r8
callq *%r14
testl %eax, %eax
jne 0x30938d
movq $0x10, 0x8(%rbp)
movq (%rbp), %rdi
movq 0x18(%rbp), %rax
shrq $0x10, %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x30(%rbp)
leaq 0x10(,%rax,8), %rsi
leaq 0xde411(%rip), %rdx     # 0x3e7790
movl $0x9a, %ecx
callq 0x1094e6
movq %rax, (%rbp)
movq (%rbp), %rdi
movq 0x30(%rbp), %rdx
incq %rdx
movl $0x8, %esi
movq %r12, %rcx
movq %r15, %r8
callq *%r14
testl %eax, %eax
je 0x3093af
xorl %r13d, %r13d
jmp 0x3093d4
movq (%rbp), %rax
movq (%rax), %rdx
testq %rdx, %rdx
je 0x3093d1
leaq 0xde434(%rip), %rsi     # 0x3e77f6
xorl %r13d, %r13d
movq %r15, %rdi
xorl %eax, %eax
callq 0x1019cf
jmp 0x3093d4
movb $0x1, %r13b
testb %r13b, %r13b
je 0x309417
movq 0x10(%rsp), %r13
movq 0x10(%r13), %rdi
movq 0x28(%rbp), %rsi
addq %rsi, %rsi
leaq 0xde3a0(%rip), %rdx     # 0x3e7790
movl $0xa6, %ecx
callq 0x1094e6
movq %rax, 0x10(%r13)
movq 0x28(%rbp), %rdx
movl $0x2, %esi
movq %rax, %rdi
movq %r12, %rcx
movq %r15, %r8
callq *%r14
testl %eax, %eax
je 0x309421
movq %rbx, %rdi
callq 0x309438
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x8dc6d