// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/gff3_linesorted_out_stream.c
// Function: gff3_linesorted_out_stream_process_current_cluster
static int gff3_linesorted_out_stream_process_current_cluster(
                                               GtGFF3LinesortedOutStream *lsos,
                                               GtError *err)
{
  int had_err = 0;
  GtUword i;
  bool shown_sep = false;
  GtUword nof_nodes = gt_array_size(lsos->cur_node_set), nof_lines;
  gt_error_check(err);

  /* do not waste time on empty clusters */
  if (nof_nodes == 0) return had_err;

  /* collect and free output */
  gt_str_reset(lsos->buf);
  for (i = 0; !had_err && i < nof_nodes; i++) {
    GtGenomeNode *n = *(GtGenomeNode**) gt_array_get(lsos->cur_node_set, i);
    had_err = gt_genome_node_accept(n, lsos->gff3vis, err);
    gt_genome_node_delete(n);
  }
  gt_array_reset(lsos->cur_node_set);

  /* split buffered lines */
  gt_splitter_split(lsos->splitter, gt_str_get(lsos->buf),
                    gt_str_length(lsos->buf), '\n');
  nof_lines = gt_splitter_size(lsos->splitter);

  /* sort lines by start positions */
  lsos->outstrings = gt_splitter_get_tokens(lsos->splitter);
  gt_qsort_r(lsos->outstrings, nof_lines, sizeof (char*),
             NULL, gt_linesorted_gff3_cmp);

  /* output */
  for (i = 0; i < nof_lines-1; i++) {
    if (strlen(lsos->outstrings[i]) > 0) {
      if (strcmp(GT_GFF_TERMINATOR, lsos->outstrings[i]) == 0) {
        if (shown_sep)
          continue;
        else
          shown_sep = true;
      }
      gt_file_xprintf(lsos->outfp, "%s\n", lsos->outstrings[i]);
    }
  }

  /* cleanup */
  gt_splitter_reset(lsos->splitter);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0xd24e0
movq %rax, %r15
testq %r14, %r14
je 0x14690b
movq %r14, %rdi
callq 0xfcc32
testb %al, %al
jne 0x146a42
testq %r15, %r15
je 0x146a2f
movq 0x28(%rbx), %rdi
callq 0x11b132
xorl %r12d, %r12d
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xd2207
movq (%rax), %r13
movq 0x38(%rbx), %rsi
movq %r13, %rdi
movq %r14, %rdx
callq 0x14472c
movl %eax, %ebp
movq %r13, %rdi
callq 0x1451a0
testl %ebp, %ebp
jne 0x146954
incq %r12
cmpq %r15, %r12
jb 0x146920
movq 0x18(%rbx), %rdi
callq 0xd2519
movq 0x28(%rbx), %rdi
movq 0x30(%rbx), %r14
callq 0x11b0a1
movq %rax, %r15
movq 0x28(%rbx), %rdi
callq 0x11b0ca
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
movl $0xa, %ecx
callq 0x119493
movq 0x30(%rbx), %rdi
callq 0x1196b0
movq %rax, %r14
movq 0x30(%rbx), %rdi
callq 0x119665
movq %rax, 0x48(%rbx)
leaq 0x9e(%rip), %r8         # 0x146a47
movl $0x8, %edx
movq %rax, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x10c638
decq %r14
movq %r14, (%rsp)
je 0x146a24
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x48(%rbx), %rax
movq (%rax,%r12,8), %r13
cmpb $0x0, (%r13)
je 0x146a15
leaq 0x238dbe(%rip), %rdi    # 0x37f79e
movq %r13, %rsi
callq 0x17a40
testl %eax, %eax
sete %cl
movb $0x1, %r14b
testb %r15b, %cl
jne 0x146a18
testl %eax, %eax
sete %r14b
orb %r15b, %r14b
movq 0x20(%rbx), %rdi
leaq 0x20f427(%rip), %rsi    # 0x355e30
movq %r13, %rdx
xorl %eax, %eax
callq 0xfee51
jmp 0x146a18
movl %r15d, %r14d
incq %r12
movl %r14d, %r15d
cmpq %r12, (%rsp)
jne 0x1469ca
movq 0x30(%rbx), %rdi
callq 0x11968d
jmp 0x146a31
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x448c8