// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/reads2twobit.c
// Function: gt_reads2twobit_write_descriptions
int gt_reads2twobit_write_descriptions(GtReads2Twobit *r2t,
    GtBitsequence *skip, GtError *err)
{
  FILE *desfp = NULL, *sdsfp = NULL;
  int had_err = 0;
  bool with_newline = (r2t->descsfp || (r2t->descs && (!r2t->clipdes)));
  GtUword i, startpos = 0;
  gt_assert(r2t);
  gt_error_check(err);
  gt_assert(r2t->descs != NULL || r2t->descsfp != NULL);
  desfp = gt_fa_fopen_with_suffix(gt_str_get(r2t->indexname),
      GT_DESTABFILESUFFIX, "wb", err);
  if (desfp == NULL)
      had_err = -1;
  if (!had_err) {
    sdsfp = gt_fa_fopen_with_suffix(gt_str_get(r2t->indexname),
        GT_SDSTABFILESUFFIX, "wb", err);
    if (sdsfp == NULL)
        had_err = -1;
  }
  if (!had_err) {
    char *desc = NULL;
    GtUword len = 0, longestdesc = 0, fin = ~0UL, posbuf;
    if (r2t->descsfp != NULL)
    {
      rewind(r2t->descsfp);
      desc = gt_malloc((size_t)r2t->longestdesc+(size_t)1);
    }
    for (i = 0; i < r2t->n_descs; i++)
    {
      if (r2t->descs != NULL)
      {
        desc = (char*) gt_desc_buffer_get_next(r2t->descs);
      }
      else
      {
        (void)gt_xfgets(desc, (int)r2t->longestdesc+(size_t)1, r2t->descsfp);
      }
      if (skip && GT_ISIBITSET(skip, i))
        continue;
      /* note: do not use longestdesc = r2t->longestdesc (for diskbased)
         or the value stored in the desc_buffer (for membased), as these
         values are not up to date when <skip> is applied */
      len = (GtUword)strlen(desc);
      if (with_newline)
      {
        gt_assert(len > 0);
        len--;
      }
      if (len > longestdesc)
        longestdesc = len;
      if (startpos > 0)
      {
        posbuf = startpos - (GtUword)1;
        gt_xfwrite_one(&posbuf, sdsfp);
      }
      gt_xfputs(desc, desfp);
      if (!with_newline)
        gt_xfputc((int) '\n', desfp);
      startpos += (len+(GtUword)1);
    }
    gt_xfwrite_one(&longestdesc, desfp);
    gt_xfwrite_one(&fin, desfp);
    if (r2t->descsfp != NULL)
    {
      gt_free(desc);
    }
  }
  gt_fa_fclose(desfp);
  gt_fa_fclose(sdsfp);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movb $0x1, %al
movl %eax, 0xc(%rsp)
cmpq $0x0, 0xa0(%rdi)
jne 0x18b20a
cmpq $0x0, 0x98(%rbx)
je 0x18b202
movb 0xa8(%rbx), %al
xorb $0x1, %al
movl %eax, 0xc(%rsp)
jmp 0x18b20a
movl $0x0, 0xc(%rsp)
testq %r12, %r12
je 0x18b21f
movq %r12, %rdi
callq 0x89eb7
testb %al, %al
jne 0x18b47a
cmpq $0x0, 0x98(%rbx)
jne 0x18b237
cmpq $0x0, 0xa0(%rbx)
je 0x18b4a8
movq (%rbx), %rdi
callq 0xad1fa
leaq 0x15b7df(%rip), %rsi    # 0x2e6a25
leaq 0x16a8a4(%rip), %rdx    # 0x2f5af1
leaq 0x1c7402(%rip), %rcx    # 0x352656
movq %rax, %rdi
movl $0x7cb, %r8d            # imm = 0x7CB
movq %r12, %r9
callq 0x8a449
pushq $-0x1
popq %rbp
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x18b2e7
movq (%rbx), %rdi
callq 0xad1fa
leaq 0x15b7a9(%rip), %rsi    # 0x2e6a2a
leaq 0x16a869(%rip), %rdx    # 0x2f5af1
leaq 0x1c73c7(%rip), %rcx    # 0x352656
movq %rax, %rdi
movl $0x7d0, %r8d            # imm = 0x7D0
movq %r12, %r9
callq 0x8a449
testq %rax, %rax
je 0x18b2e7
andq $0x0, 0x18(%rsp)
orq $-0x1, 0x30(%rsp)
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
movq %rax, 0x20(%rsp)
je 0x18b2ee
callq 0x170d0
movq 0xb0(%rbx), %rdi
incq %rdi
leaq 0x1c737e(%rip), %rsi    # 0x352656
movl $0x7da, %edx            # imm = 0x7DA
callq 0x93160
movq %rax, %r13
jmp 0x18b2f1
xorl %ebx, %ebx
jmp 0x18b41f
xorl %r13d, %r13d
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpq 0xb8(%rbx), %rbp
jae 0x18b3c7
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x18b319
callq 0x6d106
movq %rax, %r13
jmp 0x18b330
movl 0xb0(%rbx), %esi
incl %esi
movq 0xa0(%rbx), %rdx
movq %r13, %rdi
callq 0xb2e81
testq %r14, %r14
je 0x18b34b
movq %rbp, %rax
shrq $0x6, %rax
movq (%r14,%rax,8), %rax
movl %ebp, %ecx
shlq %cl, %rax
shrq $0x3f, %rax
jne 0x18b3bf
movq %r13, %rdi
callq 0x172d0
movq %rax, %r12
cmpb $0x0, 0xc(%rsp)
je 0x18b369
testq %r12, %r12
je 0x18b442
decq %r12
cmpq 0x18(%rsp), %r12
jbe 0x18b375
movq %r12, 0x18(%rsp)
testq %r15, %r15
je 0x18b398
leaq -0x1(%r15), %rax
movq %rax, 0x28(%rsp)
leaq 0x28(%rsp), %rdi
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq 0x20(%rsp), %rcx
callq 0xb302c
movq %r13, %rdi
movq 0x10(%rsp), %rsi
callq 0xb2f4f
cmpb $0x0, 0xc(%rsp)
jne 0x18b3b9
pushq $0xa
popq %rdi
movq 0x10(%rsp), %rsi
callq 0xb2f2e
addq %r12, %r15
incq %r15
incq %rbp
jmp 0x18b2f6
leaq 0x18(%rsp), %rdi
pushq $0x8
popq %r14
pushq $0x1
popq %r12
movq %r14, %rsi
movq %r12, %rdx
movq 0x10(%rsp), %r15
movq %r15, %rcx
callq 0xb302c
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0xb302c
cmpq $0x0, 0xa0(%rbx)
je 0x18b418
leaq 0x1c724b(%rip), %rsi    # 0x352656
movq %r13, %rdi
movl $0x801, %edx            # imm = 0x801
callq 0x936f9
xorl %ebp, %ebp
movq 0x20(%rsp), %rbx
movq 0x10(%rsp), %rdi
callq 0x8a4fd
movq %rbx, %rdi
callq 0x8a4fd
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2acb1f(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x159bc0(%rip), %rsi    # 0x2e5013
leaq 0x172f0d(%rip), %rdx    # 0x2fe367
leaq 0x1c75d3(%rip), %rcx    # 0x352a34
leaq 0x1c71ee(%rip), %r8     # 0x352656
movl $0x7ee, %r9d            # imm = 0x7EE
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x2acae7(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x159b88(%rip), %rsi    # 0x2e5013
leaq 0x159d2d(%rip), %rdx    # 0x2e51bf
leaq 0x1c759b(%rip), %rcx    # 0x352a34
leaq 0x1c71b6(%rip), %r8     # 0x352656
movl $0x7c8, %r9d            # imm = 0x7C8
jmp 0x18b46e
movq 0x2acab9(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x159b5a(%rip), %rsi    # 0x2e5013
leaq 0x1c7597(%rip), %rdx    # 0x352a57
leaq 0x1c756d(%rip), %rcx    # 0x352a34
leaq 0x1c7188(%rip), %r8     # 0x352656
movl $0x7c9, %r9d            # imm = 0x7C9
jmp 0x18b46e