// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movl $0x0, 0x24(%rsp)
movq $0x10, 0x18(%rsp)
cmpq $0x0, 0x30(%rsp)
je 0x492ce9
movq 0x30(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x492cb1
jmp 0x492ce9
movq 0x1a92e8(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x83351(%rip), %rsi     # 0x516013
leaq 0x834f6(%rip), %rdx     # 0x5161bf
leaq 0x1207e5(%rip), %rcx    # 0x5b34b5
leaq 0x1207c5(%rip), %r8     # 0x5b349c
movl $0x80, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x492ceb
callq 0x492bd0
movq %rax, %rdi
movq 0x40(%rsp), %rsi
callq 0x1968d0
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %r8
leaq 0x18(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq *%rax
movl %eax, 0x24(%rsp)
cmpl $0x0, 0x24(%rsp)
jne 0x492d50
cmpq $0x10, 0x18(%rsp)
je 0x492d50
movl $0x1, 0x24(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x12077f(%rip), %rsi    # 0x5b34c8
movb $0x0, %al
callq 0xd88c0
cmpl $0x0, 0x24(%rsp)
jne 0x492f27
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rax
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %r8
movl $0x8, %esi
movl $0x1, %edx
callq *%rax
movl %eax, 0x24(%rsp)
cmpl $0x0, 0x24(%rsp)
jne 0x492dc0
movq 0x28(%rsp), %rax
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %r8
movl $0x8, %esi
movl $0x1, %edx
callq *%rax
movl %eax, 0x24(%rsp)
cmpl $0x0, 0x24(%rsp)
jne 0x492def
movq 0x28(%rsp), %rax
movq 0x8(%rsp), %rdi
addq $0x20, %rdi
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %r8
movl $0x8, %esi
movl $0x1, %edx
callq *%rax
movl %eax, 0x24(%rsp)
cmpl $0x0, 0x24(%rsp)
jne 0x492e1e
movq 0x28(%rsp), %rax
movq 0x8(%rsp), %rdi
addq $0x28, %rdi
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %r8
movl $0x8, %esi
movl $0x1, %edx
callq *%rax
movl %eax, 0x24(%rsp)
cmpl $0x0, 0x24(%rsp)
jne 0x492e4d
movq 0x28(%rsp), %rax
movq 0x8(%rsp), %rdi
addq $0x38, %rdi
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %r8
movl $0x8, %esi
movl $0x1, %edx
callq *%rax
movl %eax, 0x24(%rsp)
cmpl $0x0, 0x24(%rsp)
jne 0x492ebb
movq 0x8(%rsp), %rax
movq $0x10, 0x8(%rax)
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq %cl, %rax
movq %rax, %rcx
addq $0x1, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rsi
addq $0x1, %rsi
shlq $0x3, %rsi
leaq 0x1205f6(%rip), %rdx    # 0x5b349c
movl $0x9a, %ecx
callq 0xe8540
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movq 0x8(%rsp), %rcx
movq (%rcx), %rdi
movq 0x8(%rsp), %rcx
movq 0x30(%rcx), %rdx
addq $0x1, %rdx
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %r8
movl $0x8, %esi
callq *%rax
movl %eax, 0x24(%rsp)
cmpl $0x0, 0x24(%rsp)
jne 0x492f25
movq 0x8(%rsp), %rax
movq (%rax), %rax
cmpq $0x0, (%rax)
je 0x492f25
movl $0x1, 0x24(%rsp)
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rdx
leaq 0x1205e4(%rip), %rsi    # 0x5b3502
movb $0x0, %al
callq 0xd88c0
jmp 0x492f27
cmpl $0x0, 0x24(%rsp)
jne 0x492f8c
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rsi
shlq %rsi
leaq 0x120552(%rip), %rdx    # 0x5b349c
movl $0xa6, %ecx
callq 0xe8540
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x28(%rsp), %rax
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rdi
movq 0x8(%rsp), %rcx
movq 0x28(%rcx), %rdx
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %r8
movl $0x2, %esi
callq *%rax
movl %eax, 0x24(%rsp)
cmpl $0x0, 0x24(%rsp)
je 0x492fa6
movq 0x40(%rsp), %rdi
callq 0x492fb0
movq $0x0, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq