// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/gff3_linesorted_out_stream.c
// Function: gff3_linesorted_out_stream_next
static int gff3_linesorted_out_stream_next(GtNodeStream *ns, GtGenomeNode **gn,
                                           GtError *err)
{
  GtGFF3LinesortedOutStream *lsos;
  int had_err = 0;
  GtGenomeNode *node;
  GtFeatureNode *fn = NULL;
  gt_error_check(err);
  lsos = gt_gff3_linesorted_out_stream_cast(ns);

  /* we do not need to pass on any nodes, this is an output stream */
  *gn = NULL;

  while (!(had_err = gt_node_stream_next(lsos->in_stream, &node,
                                          err))) {
     if (node == NULL) {
       /* do not forget to finish last cluster */
       if (!had_err) {
         had_err = gff3_linesorted_out_stream_process_current_cluster(lsos, err);
       }
       break;
     }
     if ((fn = gt_feature_node_try_cast(node))) {
       if (lsos->last_seqid == NULL) {
         lsos->last_seqid = gt_str_clone(gt_genome_node_get_seqid(node));
       }
       if (gt_str_cmp(lsos->last_seqid, gt_genome_node_get_seqid(node)) != 0) {
         /* new sequence reached, finish old cluster and update current seqid;
            we can do this as GenomeTools enforces all features within a CC to
            share the same seqid */
         had_err = gff3_linesorted_out_stream_process_current_cluster(lsos, err);
         if (had_err) {
           return had_err;
         }
         gt_str_reset(lsos->last_seqid);
         gt_str_append_str(lsos->last_seqid, gt_genome_node_get_seqid(node));
       }
       gt_array_add(lsos->cur_node_set, fn);
     } else {
       if (!had_err) {
        gt_str_reset(lsos->buf);
        had_err = gt_genome_node_accept(node, lsos->gff3vis, err);
      }
      if (!had_err) {
        gt_file_xprintf(lsos->outfp, "%s", gt_str_get(lsos->buf));
        gt_genome_node_delete(node);
      } else {
        return had_err;
      }
    }
  }

  return had_err;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movl $0x0, 0x2c(%rsp)
movq $0x0, 0x18(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x175a04
movq 0x38(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x1759cc
jmp 0x175a04
movq 0x4c65cd(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3a0636(%rip), %rsi    # 0x516013
leaq 0x3a07db(%rip), %rdx    # 0x5161bf
leaq 0x3dc34b(%rip), %rcx    # 0x551d36
leaq 0x3dc2b9(%rip), %r8     # 0x551cab
movl $0xcb, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x175a06
callq 0x175870
movq %rax, %rdi
movq 0x48(%rsp), %rsi
callq 0x1b20f0
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq $0x0, (%rax)
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x38(%rsp), %rdx
leaq 0x20(%rsp), %rsi
callq 0x1b1d90
movl %eax, 0x2c(%rsp)
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x175a56
jmp 0x175be6
cmpq $0x0, 0x20(%rsp)
jne 0x175a7d
cmpl $0x0, 0x2c(%rsp)
jne 0x175a78
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x175e00
movl %eax, 0x2c(%rsp)
jmp 0x175be6
movq 0x20(%rsp), %rdi
callq 0x170450
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0x175b61
movq 0x30(%rsp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x175ac0
movq 0x20(%rsp), %rdi
callq 0x171b70
movq %rax, %rdi
callq 0x11e280
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x30(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
callq 0x171b70
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x11e170
cmpl $0x0, %eax
je 0x175b44
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x175e00
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
je 0x175b11
movl 0x2c(%rsp), %eax
movl %eax, 0x54(%rsp)
jmp 0x175bee
movq 0x30(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x11e110
movq 0x30(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
callq 0x171b70
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x11d750
movq 0x30(%rsp), %rax
movq 0x18(%rax), %rdi
leaq 0x18(%rsp), %rsi
movl $0x8, %edx
callq 0x81100
jmp 0x175be1
cmpl $0x0, 0x2c(%rsp)
jne 0x175b92
movq 0x30(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x11e110
movq 0x20(%rsp), %rdi
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rsi
movq 0x38(%rsp), %rdx
callq 0x171f90
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
jne 0x175bd5
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, (%rsp)
movq 0x30(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x11dee0
movq (%rsp), %rdi
movq %rax, %rdx
leaq 0x42645f(%rip), %rsi    # 0x59c021
movb $0x0, %al
callq 0xddca0
movq 0x20(%rsp), %rdi
callq 0x173180
jmp 0x175bdf
movl 0x2c(%rsp), %eax
movl %eax, 0x54(%rsp)
jmp 0x175bee
jmp 0x175be1
jmp 0x175a29
movl 0x2c(%rsp), %eax
movl %eax, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw (%rax,%rax)