// File: /workspace/github_c_makefile_star2_O3/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 0x1c84b3
movq %rdi, %rbx
movq 0x38(%rdi), %rsi
testq %rsi, %rsi
je 0x1c84ab
movq 0x18(%rbx), %rdi
callq 0x125b21
movq 0x40(%rbx), %rdi
leaq 0x1e5d49(%rip), %rsi    # 0x3adf44
callq 0x11acf3
movq 0x40(%rbx), %rdi
movq 0x50(%rbx), %rsi
callq 0x11ae72
movq 0x38(%rbx), %rax
movq 0x40(%rbx), %rdi
movq %rax, 0x80(%rbx)
leaq 0x1e5d29(%rip), %rsi    # 0x3adf4c
callq 0x11acf3
movq 0x40(%rbx), %rdi
movq 0x80(%rbx), %rsi
callq 0x11ae72
movq 0x40(%rbx), %rdi
leaq 0x1e5d12(%rip), %rsi    # 0x3adf55
callq 0x11acf3
movq 0x40(%rbx), %rdi
movq 0x78(%rbx), %rsi
callq 0x11ae72
movq 0x98(%rbx), %rax
testq %rax, %rax
je 0x1c82d4
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 0x1e5ca7(%rip), %rsi    # 0x3adf5d
callq 0x11acf3
movq 0x40(%rbx), %rdi
xorps %xmm0, %xmm0
cvtss2sd 0x8c(%rbx), %xmm0
movl $0x2, %esi
callq 0x11afba
leaq 0x78(%rbx), %r14
cmpb $0x1, 0x11(%rbx)
jne 0x1c83ba
cmpq $0x0, 0x98(%rbx)
je 0x1c82f6
movss 0x8c(%rbx), %xmm2
jmp 0x1c832a
movq (%r14), %rax
xorps %xmm2, %xmm2
cmpq $0x3, %rax
jb 0x1c832a
addq $-0x2, %rax
js 0x1c8312
xorps %xmm2, %xmm2
cvtsi2ss %rax, %xmm2
jmp 0x1c832a
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm2, %xmm2
cvtsi2ss %rax, %xmm2
addss %xmm2, %xmm2
mulss 0x1e5b7e(%rip), %xmm2   # 0x3adeb0
movq 0x38(%rbx), %rax
incq %rax
subq 0x68(%rbx), %rax
jbe 0x1c837f
movq %rax, %xmm0
punpckldq 0x17f594(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x17f59c(%rip), %xmm0   # 0x3478f0
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 0x1c8385
movss %xmm2, 0x4(%rsp)
movq 0x40(%rbx), %rdi
leaq 0x1e5bd1(%rip), %rsi    # 0x3adf61
callq 0x11acf3
movq 0x40(%rbx), %rdi
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movl $0x6, %esi
callq 0x11afba
movss 0x4(%rsp), %xmm0
movss %xmm0, 0x94(%rbx)
movq 0x40(%rbx), %rdi
leaq 0x1f9d5b(%rip), %rsi    # 0x3c2120
callq 0x11acf3
cmpb $0x0, 0x10(%rbx)
jne 0x1c8434
cmpq $0x2, (%r14)
jb 0x1c8434
movq 0x48(%rbx), %rdi
leaq 0x1e5b8e(%rip), %rax    # 0x3adf6f
leaq 0x1e5b81(%rip), %rsi    # 0x3adf69
cmoveq %rax, %rsi
callq 0x11acf3
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 0x11ae72
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 0x11af23
movq 0x40(%rbx), %rdi
movq 0x48(%rbx), %rsi
callq 0x11adc1
movq 0x40(%rbx), %rdi
callq 0x11b0a1
movq 0x8(%rbx), %r8
movq 0x28(%rbx), %rsi
movq 0x38(%rbx), %rdx
movl $0x3c, %ecx
movq %rax, %rdi
callq 0xfe000
movq 0xa0(%rbx), %rcx
testq %rcx, %rcx
je 0x1c8481
movl $0x20, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x11f89c
incq 0x50(%rbx)
movq $0x0, 0x38(%rbx)
movq 0x40(%rbx), %rdi
callq 0x11b132
movq 0x48(%rbx), %rdi
callq 0x11b132
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x6a57e