// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/select_stream.c
// Function: select_stream_next
static int select_stream_next(GtNodeStream *ns, GtGenomeNode **gn, GtError *err)
{
  GtSelectStream *fs;
  int had_err;
  gt_error_check(err);
  fs = gt_select_stream_cast(ns);

  /* we still have nodes in the buffer */
  if (gt_select_visitor_node_buffer_size(fs->select_visitor)) {
    /* return one of them */
    *gn = gt_select_visitor_get_node(fs->select_visitor);
    return 0;
  }

  /* no nodes in the buffer -> get new nodes */
  while (!(had_err = gt_node_stream_next(fs->in_stream, gn, err)) && *gn) {
    gt_assert(*gn && !had_err);
    had_err = gt_genome_node_accept(*gn, fs->select_visitor, err);
    if (had_err) {
      /* we own the node -> delete it */
      gt_genome_node_delete(*gn);
      *gn = NULL;
      break;
    }
    if (gt_select_visitor_node_buffer_size(fs->select_visitor)) {
      *gn = gt_select_visitor_get_node(fs->select_visitor);
      return 0;
    }
  }

  /* either we have an error or no new node */
  gt_assert(had_err || !*gn);
  return had_err;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x1d28e3
movq 0x18(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x1d28ab
jmp 0x1d28e3
movq 0x4696ee(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x343757(%rip), %rsi    # 0x516013
leaq 0x3438fc(%rip), %rdx    # 0x5161bf
leaq 0x3966c1(%rip), %rcx    # 0x568f8b
leaq 0x3923db(%rip), %r8     # 0x564cac
movl $0x2a, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d28e5
callq 0x1d27f0
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x1b20f0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1d3c10
cmpq $0x0, %rax
je 0x1d2936
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1d3c50
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x34(%rsp)
jmp 0x1d2a9f
jmp 0x1d2938
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x1b1d90
movl %eax, %ecx
movl %ecx, 0xc(%rsp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0xb(%rsp)
jne 0x1d2971
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
setne %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
testb $0x1, %al
jne 0x1d297e
jmp 0x1d2a49
jmp 0x1d2980
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
je 0x1d2992
cmpl $0x0, 0xc(%rsp)
je 0x1d29ca
movq 0x469607(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x343670(%rip), %rsi    # 0x516013
leaq 0x37a256(%rip), %rdx    # 0x54cc00
leaq 0x3965da(%rip), %rcx    # 0x568f8b
leaq 0x3922f4(%rip), %r8     # 0x564cac
movl $0x36, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d29cc
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rsi
movq 0x18(%rsp), %rdx
callq 0x171f90
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
je 0x1d2a0d
movq 0x20(%rsp), %rax
movq (%rax), %rdi
callq 0x173180
movq 0x20(%rsp), %rax
movq $0x0, (%rax)
jmp 0x1d2a49
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1d3c10
cmpq $0x0, %rax
je 0x1d2a44
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1d3c50
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x34(%rsp)
jmp 0x1d2a9f
jmp 0x1d2938
jmp 0x1d2a4b
cmpl $0x0, 0xc(%rsp)
jne 0x1d2a95
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
je 0x1d2a95
movq 0x46953c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3435a5(%rip), %rsi    # 0x516013
leaq 0x373e5f(%rip), %rdx    # 0x5468d4
leaq 0x39650f(%rip), %rcx    # 0x568f8b
leaq 0x392229(%rip), %r8     # 0x564cac
movl $0x45, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d2a97
movl 0xc(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)