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

  /* we still have nodes in the buffer */
  if (gt_sequence_node_out_visitor_node_buffer_size(
                                               fs->sequence_node_out_visitor)) {
    /* return one of them */
    *gn = gt_sequence_node_out_visitor_get_node(fs->sequence_node_out_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->sequence_node_out_visitor, err);
    if (had_err) {
      /* we own the node -> delete it */
      gt_genome_node_delete(*gn);
      *gn = NULL;
      break;
    }
    if (gt_sequence_node_out_visitor_node_buffer_size(
                                               fs->sequence_node_out_visitor)) {
     *gn = gt_sequence_node_out_visitor_get_node(fs->sequence_node_out_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 0x1d6c93
movq 0x18(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x1d6c5b
jmp 0x1d6c93
movq 0x46533e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33f3a7(%rip), %rsi    # 0x516013
leaq 0x33f54c(%rip), %rdx    # 0x5161bf
leaq 0x38ebcc(%rip), %rcx    # 0x565846
leaq 0x38eb9d(%rip), %r8     # 0x56581e
movl $0x2c, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d6c95
callq 0x1d6ba0
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x1b20f0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1d76d0
cmpq $0x0, %rax
je 0x1d6ce6
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1d7710
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x34(%rsp)
jmp 0x1d6e4f
jmp 0x1d6ce8
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 0x1d6d21
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
setne %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
testb $0x1, %al
jne 0x1d6d2e
jmp 0x1d6df9
jmp 0x1d6d30
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
je 0x1d6d42
cmpl $0x0, 0xc(%rsp)
je 0x1d6d7a
movq 0x465257(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33f2c0(%rip), %rsi    # 0x516013
leaq 0x375ea6(%rip), %rdx    # 0x54cc00
leaq 0x38eae5(%rip), %rcx    # 0x565846
leaq 0x38eab6(%rip), %r8     # 0x56581e
movl $0x39, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d6d7c
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 0x1d6dbd
movq 0x20(%rsp), %rax
movq (%rax), %rdi
callq 0x173180
movq 0x20(%rsp), %rax
movq $0x0, (%rax)
jmp 0x1d6df9
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1d76d0
cmpq $0x0, %rax
je 0x1d6df4
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1d7710
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x34(%rsp)
jmp 0x1d6e4f
jmp 0x1d6ce8
jmp 0x1d6dfb
cmpl $0x0, 0xc(%rsp)
jne 0x1d6e45
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
je 0x1d6e45
movq 0x46518c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33f1f5(%rip), %rsi    # 0x516013
leaq 0x36faaf(%rip), %rdx    # 0x5468d4
leaq 0x38ea1a(%rip), %rcx    # 0x565846
leaq 0x38e9eb(%rip), %r8     # 0x56581e
movl $0x49, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d6e47
movl 0xc(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)