// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/rdj-contigs-writer.c
// Function: gt_contigs_writer_write
void gt_contigs_writer_write(GtContigsWriter *contigs_writer)
{
  gt_assert(contigs_writer != NULL);

  if (contigs_writer->contig.nextfreechar > 0)
  {
    gt_assembly_stats_calculator_add(contigs_writer->asc,
        contigs_writer->contig.nextfreechar);
    /* build description */
    gt_str_append_cstr(contigs_writer->contig_desc, "contig_");
    gt_str_append_uword(contigs_writer->contig_desc,
        contigs_writer->contignum);
    contigs_writer->depthinfo.length = contigs_writer->contig.nextfreechar;
    gt_str_append_cstr(contigs_writer->contig_desc, " length=");
    gt_str_append_uword(contigs_writer->contig_desc,
        contigs_writer->depthinfo.length);
    gt_str_append_cstr(contigs_writer->contig_desc, " depth=");
    gt_str_append_uword(contigs_writer->contig_desc,
        contigs_writer->depthinfo.depth);
    if (contigs_writer->rcn != NULL)
    {
      contigs_writer->depthinfo.internal_copynum -= (float)contigs_writer->rcn[
        GT_CONTIGS_WRITER_READNUM(contigs_writer->lastseqnum,
            contigs_writer->nofseqs)];
      contigs_writer->depthinfo.lastread_copynum = (float)contigs_writer->rcn[
        GT_CONTIGS_WRITER_READNUM(contigs_writer->lastseqnum,
            contigs_writer->nofseqs)];
      gt_str_append_cstr(contigs_writer->contig_desc, " k=");
      gt_str_append_double(contigs_writer->contig_desc,
          (double)contigs_writer->depthinfo.internal_copynum, 2);
    }
    if (contigs_writer->calculate_astat)
    {
      float astat;
      float k = (float)0;
      if (contigs_writer->rcn != NULL)
        k = contigs_writer->depthinfo.internal_copynum;
      else
      {
        if (contigs_writer->depthinfo.depth > 2UL)
          k = (float)(contigs_writer->depthinfo.depth - 2UL);
      }
      astat = - (k * (float)log((double)2));
      if (contigs_writer->contig.nextfreechar + 1UL > contigs_writer->rlen)
      {
        astat += contigs_writer->arrival_rate * (
            contigs_writer->contig.nextfreechar + 1UL - contigs_writer->rlen);
      }
      gt_str_append_cstr(contigs_writer->contig_desc, " astat=");
      gt_str_append_double(contigs_writer->contig_desc, (double)astat, 6);
      contigs_writer->depthinfo.astat = astat;
    }
    gt_str_append_cstr(contigs_writer->contig_desc, " ");
    if (!contigs_writer->show_paths && contigs_writer->depthinfo.depth > 1UL)
    {
      /* show path summary only */
      gt_str_append_cstr(contigs_writer->path_desc,
          contigs_writer->depthinfo.depth > 2UL ? "-->...-->" :
          "-->");
      gt_str_append_uword(contigs_writer->path_desc,
          GT_CONTIGS_WRITER_READNUM(contigs_writer->lastseqnum,
              contigs_writer->nofseqs));
      gt_str_append_char(contigs_writer->path_desc,
          GT_CONTIGS_WRITER_LETTER(contigs_writer->lastseqnum,
              contigs_writer->nofseqs));
    }
    gt_str_append_str(contigs_writer->contig_desc, contigs_writer->path_desc);

    gt_fasta_show_entry(gt_str_get(contigs_writer->contig_desc),
        contigs_writer->contig.spacechar, contigs_writer->contig.nextfreechar,
        60UL, contigs_writer->outfp);
    if (contigs_writer->depthinfo_fp != NULL)
    {
      gt_xfwrite(&contigs_writer->depthinfo,
          sizeof (contigs_writer->depthinfo), (size_t)1,
          contigs_writer->depthinfo_fp);
    }
    contigs_writer->contignum++;
    gt_contigs_writer_reset_buffers(contigs_writer);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1d170f
movq %rdi, %rbx
movq 0x38(%rdi), %rsi
testq %rsi, %rsi
je 0x1d1707
movq 0x18(%rbx), %rdi
callq 0x12b941
movq 0x40(%rbx), %rdi
leaq 0x1e60ed(%rip), %rsi    # 0x3b7544
callq 0x12097f
movq 0x40(%rbx), %rdi
movq 0x50(%rbx), %rsi
callq 0x120af4
movq 0x38(%rbx), %rax
movq 0x40(%rbx), %rdi
movq %rax, 0x80(%rbx)
leaq 0x1e60cd(%rip), %rsi    # 0x3b754c
callq 0x12097f
movq 0x40(%rbx), %rdi
movq 0x80(%rbx), %rsi
callq 0x120af4
movq 0x40(%rbx), %rdi
leaq 0x1e60b6(%rip), %rsi    # 0x3b7555
callq 0x12097f
movq 0x40(%rbx), %rdi
movq 0x78(%rbx), %rsi
callq 0x120af4
movq 0x98(%rbx), %rax
testq %rax, %rax
je 0x1d1530
movq 0x40(%rbx), %rdi
movq 0x58(%rbx), %rcx
movq 0x60(%rbx), %rdx
movq %rcx, %rsi
notq %rsi
addq %rdx, %rsi
shrq %rdx
cmpq %rdx, %rcx
cmovbq %rcx, %rsi
movzbl (%rax,%rsi), %ecx
cvtsi2ss %ecx, %xmm0
movss 0x8c(%rbx), %xmm1
subss %xmm0, %xmm1
movss %xmm1, 0x8c(%rbx)
movzbl (%rax,%rsi), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x90(%rbx)
leaq 0x1e604b(%rip), %rsi    # 0x3b755d
callq 0x12097f
movq 0x40(%rbx), %rdi
xorps %xmm0, %xmm0
cvtss2sd 0x8c(%rbx), %xmm0
movl $0x2, %esi
callq 0x120c3c
leaq 0x78(%rbx), %r14
cmpb $0x1, 0x11(%rbx)
jne 0x1d1616
cmpq $0x0, 0x98(%rbx)
je 0x1d1552
movss 0x8c(%rbx), %xmm2
jmp 0x1d1586
movq (%r14), %rax
xorps %xmm2, %xmm2
cmpq $0x3, %rax
jb 0x1d1586
addq $-0x2, %rax
js 0x1d156e
xorps %xmm2, %xmm2
cvtsi2ss %rax, %xmm2
jmp 0x1d1586
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm2, %xmm2
cvtsi2ss %rax, %xmm2
addss %xmm2, %xmm2
mulss 0x1e5f22(%rip), %xmm2   # 0x3b74b0
movq 0x38(%rbx), %rax
incq %rax
subq 0x68(%rbx), %rax
jbe 0x1d15db
movq %rax, %xmm0
punpckldq 0x17f338(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x17f340(%rip), %xmm0   # 0x3508f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x70(%rbx), %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x4(%rsp)
jmp 0x1d15e1
movss %xmm2, 0x4(%rsp)
movq 0x40(%rbx), %rdi
leaq 0x1e5f75(%rip), %rsi    # 0x3b7561
callq 0x12097f
movq 0x40(%rbx), %rdi
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movl $0x6, %esi
callq 0x120c3c
movss 0x4(%rsp), %xmm0
movss %xmm0, 0x94(%rbx)
movq 0x40(%rbx), %rdi
leaq 0x1fa227(%rip), %rsi    # 0x3cb848
callq 0x12097f
cmpb $0x0, 0x10(%rbx)
jne 0x1d1690
cmpq $0x2, (%r14)
jb 0x1d1690
movq 0x48(%rbx), %rdi
leaq 0x1e5f32(%rip), %rax    # 0x3b756f
leaq 0x1e5f25(%rip), %rsi    # 0x3b7569
cmoveq %rax, %rsi
callq 0x12097f
movq 0x48(%rbx), %rdi
movq 0x58(%rbx), %rax
movq 0x60(%rbx), %rcx
movq %rax, %rsi
notq %rsi
addq %rcx, %rsi
shrq %rcx
cmpq %rcx, %rax
cmovbq %rax, %rsi
callq 0x120af4
movq 0x48(%rbx), %rdi
movq 0x60(%rbx), %rax
shrq %rax
xorl %ecx, %ecx
cmpq %rax, 0x58(%rbx)
setb %cl
leal (%rcx,%rcx,2), %esi
addl $0x42, %esi
callq 0x120ba5
movq 0x40(%rbx), %rdi
movq 0x48(%rbx), %rsi
callq 0x120a43
movq 0x40(%rbx), %rdi
callq 0x120d23
movq 0x8(%rbx), %r8
movq 0x28(%rbx), %rsi
movq 0x38(%rbx), %rdx
movl $0x3c, %ecx
movq %rax, %rdi
callq 0x102ec0
movq 0xa0(%rbx), %rcx
testq %rcx, %rcx
je 0x1d16dd
movl $0x20, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x125658
incq 0x50(%rbx)
movq $0x0, 0x38(%rbx)
movq 0x40(%rbx), %rdi
callq 0x120db4
movq 0x48(%rbx), %rdi
callq 0x120db4
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x6be58