// File: /workspace/github_c_makefile_star2_O1/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 0xd4a9a
movq %rax, %r15
testq %r14, %r14
je 0x14dc32
movq %r14, %rdi
callq 0x101a9a
testb %al, %al
jne 0x14dd60
testq %r15, %r15
je 0x14dd4d
movq 0x28(%rbx), %rdi
callq 0x120db4
xorl %r12d, %r12d
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xd47ba
movq (%rax), %r13
movq 0x38(%rbx), %rsi
movq %r13, %rdi
movq %r14, %rdx
callq 0x14b992
movl %eax, %ebp
movq %r13, %rdi
callq 0x14c43a
testl %ebp, %ebp
jne 0x14dc7b
incq %r12
cmpq %r15, %r12
jb 0x14dc47
movq 0x18(%rbx), %rdi
callq 0xd4ad3
movq 0x28(%rbx), %rdi
movq 0x30(%rbx), %r14
callq 0x120d23
movq %rax, %r15
movq 0x28(%rbx), %rdi
callq 0x120d4c
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
movl $0xa, %ecx
callq 0x11f0c7
movq 0x30(%rbx), %rdi
callq 0x11f2e4
movq %rax, %r14
movq 0x30(%rbx), %rdi
callq 0x11f299
movq %rax, 0x48(%rbx)
leaq 0x95(%rip), %r8         # 0x14dd65
movl $0x8, %edx
movq %rax, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x1118d4
decq %r14
movq %r14, (%rsp)
je 0x14dd42
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x48(%rbx), %rax
movq (%rax,%r12,8), %r13
cmpb $0x0, (%r13)
je 0x14dd39
leaq 0x23ae27(%rip), %rdi    # 0x388b2e
movq %r13, %rsi
callq 0x17a40
testl %eax, %eax
je 0x14dd18
movl %r15d, %r14d
jmp 0x14dd21
movb $0x1, %r14b
testb $0x1, %r15b
jne 0x14dd39
movq 0x20(%rbx), %rdi
leaq 0x211130(%rip), %rsi    # 0x35ee5c
movq %r13, %rdx
xorl %eax, %eax
callq 0x103d21
movl %r14d, %r15d
incq %r12
cmpq %r12, (%rsp)
jne 0x14dcf1
movq 0x30(%rbx), %rdi
callq 0x11f2c1
jmp 0x14dd4f
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x45577