// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq $0x0, 0x58(%rsp)
movq $0x0, 0x50(%rsp)
movl $0x0, 0x4c(%rsp)
movq 0x70(%rsp), %rcx
movb $0x1, %al
cmpq $0x0, 0xa0(%rcx)
movb %al, 0xf(%rsp)
jne 0x2a3d80
movq 0x70(%rsp), %rcx
xorl %eax, %eax
cmpq $0x0, 0x98(%rcx)
movb %al, 0xe(%rsp)
je 0x2a3d78
movq 0x70(%rsp), %rax
movb 0xa8(%rax), %al
xorb $-0x1, %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
andb $0x1, %al
movb %al, 0x4b(%rsp)
movq $0x0, 0x38(%rsp)
cmpq $0x0, 0x70(%rsp)
jne 0x2a3dd3
movq 0x3981fe(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x272267(%rip), %rsi    # 0x516013
leaq 0x2e15db(%rip), %rdx    # 0x58538e
leaq 0x2e15d8(%rip), %rcx    # 0x585392
leaq 0x2e11ef(%rip), %r8     # 0x584fb0
movl $0x7c7, %r9d            # imm = 0x7C7
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a3dd5
jmp 0x2a3dd7
cmpq $0x0, 0x60(%rsp)
je 0x2a3e27
movq 0x60(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x2a3def
jmp 0x2a3e27
movq 0x3981aa(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x272213(%rip), %rsi    # 0x516013
leaq 0x2723b8(%rip), %rdx    # 0x5161bf
leaq 0x2e1584(%rip), %rcx    # 0x585392
leaq 0x2e119b(%rip), %r8     # 0x584fb0
movl $0x7c8, %r9d            # imm = 0x7C8
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a3e29
jmp 0x2a3e2b
movq 0x70(%rsp), %rax
cmpq $0x0, 0x98(%rax)
jne 0x2a3e81
movq 0x70(%rsp), %rax
cmpq $0x0, 0xa0(%rax)
jne 0x2a3e81
movq 0x398150(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2721b9(%rip), %rsi    # 0x516013
leaq 0x2e1554(%rip), %rdx    # 0x5853b5
leaq 0x2e152a(%rip), %rcx    # 0x585392
leaq 0x2e1141(%rip), %r8     # 0x584fb0
movl $0x7c9, %r9d            # imm = 0x7C9
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a3e83
movq 0x70(%rsp), %rax
movq (%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x60(%rsp), %r9
leaq 0x273b9e(%rip), %rsi    # 0x517a3d
leaq 0x282cf7(%rip), %rdx    # 0x526b9d
leaq 0x2e1103(%rip), %rcx    # 0x584fb0
movl $0x7cb, %r8d            # imm = 0x7CB
callq 0xd92c0
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
jne 0x2a3ecd
movl $0xffffffff, 0x4c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x4c(%rsp)
jne 0x2a3f20
movq 0x70(%rsp), %rax
movq (%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x60(%rsp), %r9
leaq 0x273b52(%rip), %rsi    # 0x517a42
leaq 0x282ca6(%rip), %rdx    # 0x526b9d
leaq 0x2e10b2(%rip), %rcx    # 0x584fb0
movl $0x7d0, %r8d            # imm = 0x7D0
callq 0xd92c0
movq %rax, 0x50(%rsp)
cmpq $0x0, 0x50(%rsp)
jne 0x2a3f1e
movl $0xffffffff, 0x4c(%rsp) # imm = 0xFFFFFFFF
jmp 0x2a3f20
cmpl $0x0, 0x4c(%rsp)
jne 0x2a4198
movq $0x0, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $-0x1, 0x18(%rsp)
movq 0x70(%rsp), %rax
cmpq $0x0, 0xa0(%rax)
je 0x2a3f95
movq 0x70(%rsp), %rax
movq 0xa0(%rax), %rdi
callq 0x190c0
movq 0x70(%rsp), %rax
movq 0xb0(%rax), %rdi
addq $0x1, %rdi
leaq 0x2e102a(%rip), %rsi    # 0x584fb0
movl $0x7da, %edx            # imm = 0x7DA
callq 0xe80f0
movq %rax, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq 0x70(%rsp), %rcx
cmpq 0xb8(%rcx), %rax
jae 0x2a413f
movq 0x70(%rsp), %rax
cmpq $0x0, 0x98(%rax)
je 0x2a3fdc
movq 0x70(%rsp), %rax
movq 0x98(%rax), %rdi
callq 0xa4380
movq %rax, 0x30(%rsp)
jmp 0x2a4006
movq 0x30(%rsp), %rdi
movq 0x70(%rsp), %rax
movq 0xb0(%rax), %rax
cltq
addq $0x1, %rax
movl %eax, %esi
movq 0x70(%rsp), %rax
movq 0xa0(%rax), %rdx
callq 0x126a40
cmpq $0x0, 0x68(%rsp)
je 0x2a4047
movq 0x68(%rsp), %rax
movq 0x40(%rsp), %rcx
shrq $0x6, %rcx
movq (%rax,%rcx,8), %rax
movq 0x40(%rsp), %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x2a4047
jmp 0x2a412c
movq 0x30(%rsp), %rdi
callq 0x192b0
movq %rax, 0x28(%rsp)
testb $0x1, 0x4b(%rsp)
je 0x2a40af
jmp 0x2a405f
cmpq $0x0, 0x28(%rsp)
ja 0x2a409f
movq 0x397f32(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x271f9b(%rip), %rsi    # 0x516013
leaq 0x28b4f0(%rip), %rdx    # 0x52f56f
leaq 0x2e130c(%rip), %rcx    # 0x585392
leaq 0x2e0f23(%rip), %r8     # 0x584fb0
movl $0x7ee, %r9d            # imm = 0x7EE
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a40a1
movq 0x28(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x20(%rsp), %rax
jbe 0x2a40c5
movq 0x28(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x38(%rsp)
jbe 0x2a40f4
movq 0x38(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rcx
leaq 0x10(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x126d30
movq 0x30(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x126bb0
testb $0x1, 0x4b(%rsp)
jne 0x2a4119
movq 0x58(%rsp), %rsi
movl $0xa, %edi
callq 0x126b70
movq 0x28(%rsp), %rax
addq $0x1, %rax
addq 0x38(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x2a3f9e
movq 0x58(%rsp), %rcx
leaq 0x20(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x126d30
movq 0x58(%rsp), %rcx
leaq 0x18(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x126d30
movq 0x70(%rsp), %rax
cmpq $0x0, 0xa0(%rax)
je 0x2a4196
movq 0x30(%rsp), %rdi
leaq 0x2e0e24(%rip), %rsi    # 0x584fb0
movl $0x801, %edx            # imm = 0x801
callq 0xe88c0
jmp 0x2a4198
movq 0x58(%rsp), %rdi
callq 0xd9390
movq 0x50(%rsp), %rdi
callq 0xd9390
movl 0x4c(%rsp), %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)