// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/gff3_in_stream_plain.c
// Function: gff3_in_stream_plain_next
static int gff3_in_stream_plain_next(GtNodeStream *ns, GtGenomeNode **gn,
                                     GtError *err)
{
  GtGFF3InStreamPlain *is = gff3_in_stream_plain_cast(ns);
  GtStr *filenamestr;
  int had_err = 0, status_code;

  gt_error_check(err);

  if (gt_queue_size(is->genome_node_buffer) > 1) {
    /* we still have at least two nodes in the buffer -> serve from there */
    *gn = gt_queue_get(is->genome_node_buffer);
    return 0;
  }

  /* the buffer is empty or has one element */
  gt_assert(gt_queue_size(is->genome_node_buffer) <= 1);

  for (;;) {
    /* open file if necessary */
    if (!is->file_is_open) {
      if (gt_str_array_size(is->files) &&
          is->next_file == gt_str_array_size(is->files)) {
        break;
      }
      if (gt_str_array_size(is->files)) {
        if (strcmp(gt_str_array_get(is->files, is->next_file), "-") == 0) {
          if (is->stdin_argument) {
            gt_error_set(err, "multiple specification of argument file \"-\"");
            had_err = -1;
            break;
          }
          is->fpin = gt_file_xopen(NULL, "r");
          is->file_is_open = true;
          is->stdin_argument = true;
        }
        else {
          is->fpin = gt_file_xopen(gt_str_array_get(is->files,
                                                       is->next_file), "r");
          is->file_is_open = true;
        }
        is->next_file++;
      }
      else {
        if (is->stdin_processed)
          break;
        is->fpin = NULL;
        is->file_is_open = true;
      }
      is->line_number = 0;

      if (!had_err && is->progress_bar) {
        printf("processing file \"%s\"\n", gt_str_array_size(is->files)
               ? gt_str_array_get(is->files, is->next_file-1) : "stdin");
      }
      if (!had_err && is->fpin && is->progress_bar) {
        gt_progressbar_start(&is->line_number,
                            gt_file_number_of_lines(gt_str_array_get(is->files,
                                                             is->next_file-1)));
      }
    }

    gt_assert(is->file_is_open);

    filenamestr = gt_str_array_size(is->files)
                  ? gt_str_array_get_str(is->files, is->next_file-1)
                  : is->stdinstr;
    /* read two nodes */
    had_err = gt_gff3_parser_parse_genome_nodes(is->gff3_parser, &status_code,
                                                is->genome_node_buffer,
                                                is->used_types, filenamestr,
                                                &is->line_number, is->fpin,
                                                err);
    if (had_err)
      break;
    if (status_code != EOF) {
      had_err = gt_gff3_parser_parse_genome_nodes(is->gff3_parser, &status_code,
                                                  is->genome_node_buffer,
                                                  is->used_types, filenamestr,
                                                  &is->line_number, is->fpin,
                                                  err);
      if (had_err)
        break;
    }

    if (status_code == EOF) {
      /* end of current file */
      if (is->progress_bar) gt_progressbar_stop();
      gt_file_delete(is->fpin);
      is->fpin = NULL;
      is->file_is_open = false;
      gt_gff3_parser_reset(is->gff3_parser);
      if (!gt_str_array_size(is->files)) {
        is->stdin_processed = true;
        break;
      }
      continue;
    }

    gt_assert(gt_queue_size(is->genome_node_buffer));

    /* make sure the parsed nodes are sorted */
    if (is->ensure_sorting && gt_queue_size(is->genome_node_buffer) > 1) {
      GtGenomeNode *last_node = NULL;
      /* a sorted stream can have at most one input file */
      gt_assert(gt_str_array_size(is->files) == 0 ||
                gt_str_array_size(is->files) == 1);
      had_err = gt_queue_iterate(is->genome_node_buffer, buffer_is_sorted,
                                 &last_node, err);
    }
    if (!had_err) {
      *gn = gt_queue_get(is->genome_node_buffer);
    }
    return had_err;
  }
  gt_assert(!gt_queue_size(is->genome_node_buffer));
  *gn = NULL;
  return had_err;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
callq 0x27ac0
movq %rax, %rdi
movq 0x68(%rsp), %rsi
callq 0x34af0
movq %rax, 0x50(%rsp)
movl $0x0, 0x44(%rsp)
cmpq $0x0, 0x58(%rsp)
je 0x27c32
movq 0x58(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x27bfa
jmp 0x27c32
movq 0x18c3d7(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x13645b(%rip), %rsi    # 0x15e066
leaq 0x136a36(%rip), %rdx    # 0x15e648
leaq 0x13b82f(%rip), %rcx    # 0x163448
leaq 0x13b65d(%rip), %r8     # 0x16327d
movl $0x51, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x27c34
movq 0x50(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x90d30
cmpq $0x1, %rax
jbe 0x27c6e
movq 0x50(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x90c50
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x74(%rsp)
jmp 0x2824c
jmp 0x27c70
movq 0x50(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x90d30
cmpq $0x1, %rax
jbe 0x27cbc
movq 0x18c34d(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x1363d1(%rip), %rsi    # 0x15e066
leaq 0x13b7c6(%rip), %rdx    # 0x163462
leaq 0x13b7a5(%rip), %rcx    # 0x163448
leaq 0x13b5d3(%rip), %r8     # 0x16327d
movl $0x5a, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x27cbe
jmp 0x27cc0
movq 0x50(%rsp), %rax
testb $0x1, 0x2b(%rax)
jne 0x27ef7
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1b720
cmpq $0x0, %rax
je 0x27d11
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1b720
movq %rax, %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
jne 0x27d11
jmp 0x281e8
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1b720
cmpq $0x0, %rax
je 0x27dfd
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rsi
callq 0x1b320
movq %rax, %rdi
leaq 0x143392(%rip), %rsi    # 0x16b0dc
callq 0xb850
cmpl $0x0, %eax
jne 0x27daf
movq 0x50(%rsp), %rax
testb $0x1, 0x29(%rax)
je 0x27d7f
movq 0x58(%rsp), %rdi
leaq 0x13b722(%rip), %rsi    # 0x16348d
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x281e8
xorl %eax, %eax
movl %eax, %edi
leaq 0x144482(%rip), %rsi    # 0x16c20c
callq 0x834c0
movq %rax, %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x50(%rsp), %rax
movb $0x1, 0x2b(%rax)
movq 0x50(%rsp), %rax
movb $0x1, 0x29(%rax)
jmp 0x27dea
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rsi
callq 0x1b320
movq %rax, %rdi
leaq 0x14443c(%rip), %rsi    # 0x16c20c
callq 0x834c0
movq %rax, %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x50(%rsp), %rax
movb $0x1, 0x2b(%rax)
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
jmp 0x27e23
movq 0x50(%rsp), %rax
testb $0x1, 0x2a(%rax)
je 0x27e0d
jmp 0x281e8
movq 0x50(%rsp), %rax
movq $0x0, 0x30(%rax)
movq 0x50(%rsp), %rax
movb $0x1, 0x2b(%rax)
movq 0x50(%rsp), %rax
movq $0x0, 0x38(%rax)
cmpl $0x0, 0x44(%rsp)
jne 0x27e99
movq 0x50(%rsp), %rax
testb $0x1, 0x2c(%rax)
je 0x27e99
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1b720
cmpq $0x0, %rax
je 0x27e78
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rsi
subq $0x1, %rsi
callq 0x1b320
movq %rax, 0x28(%rsp)
jmp 0x27e86
leaq 0x14311d(%rip), %rax    # 0x16af9c
movq %rax, 0x28(%rsp)
jmp 0x27e86
movq 0x28(%rsp), %rsi
leaq 0x13b627(%rip), %rdi    # 0x1634b9
movb $0x0, %al
callq 0xb070
cmpl $0x0, 0x44(%rsp)
jne 0x27ef5
movq 0x50(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x27ef5
movq 0x50(%rsp), %rax
testb $0x1, 0x2c(%rax)
je 0x27ef5
movq 0x50(%rsp), %rax
addq $0x38, %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rsi
subq $0x1, %rsi
callq 0x1b320
movq %rax, %rdi
callq 0x845b0
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x8f2c0
jmp 0x27ef7
jmp 0x27ef9
movq 0x50(%rsp), %rax
testb $0x1, 0x2b(%rax)
jne 0x27f3c
movq 0x18c0cd(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x136151(%rip), %rsi    # 0x15e066
leaq 0x13b5b3(%rip), %rdx    # 0x1634cf
leaq 0x13b525(%rip), %rcx    # 0x163448
leaq 0x13b353(%rip), %r8     # 0x16327d
movl $0x88, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x27f3e
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1b720
cmpq $0x0, %rax
je 0x27f74
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rsi
subq $0x1, %rsi
callq 0x1b3c0
movq %rax, 0x18(%rsp)
jmp 0x27f82
movq 0x50(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq 0x48(%rax), %rdi
movq 0x50(%rsp), %rax
movq 0x40(%rax), %rdx
movq 0x50(%rsp), %rax
movq 0x50(%rax), %rcx
movq 0x48(%rsp), %r8
movq 0x50(%rsp), %r9
addq $0x38, %r9
movq 0x50(%rsp), %rax
movq 0x30(%rax), %r10
movq 0x58(%rsp), %rax
leaq 0x40(%rsp), %rsi
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x29740
movl %eax, 0x44(%rsp)
cmpl $0x0, 0x44(%rsp)
je 0x27fe6
jmp 0x281e8
cmpl $-0x1, 0x40(%rsp)
je 0x28049
movq 0x50(%rsp), %rax
movq 0x48(%rax), %rdi
movq 0x50(%rsp), %rax
movq 0x40(%rax), %rdx
movq 0x50(%rsp), %rax
movq 0x50(%rax), %rcx
movq 0x48(%rsp), %r8
movq 0x50(%rsp), %r9
addq $0x38, %r9
movq 0x50(%rsp), %rax
movq 0x30(%rax), %r10
movq 0x58(%rsp), %rax
leaq 0x40(%rsp), %rsi
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x29740
movl %eax, 0x44(%rsp)
cmpl $0x0, 0x44(%rsp)
je 0x28047
jmp 0x281e8
jmp 0x28049
cmpl $-0x1, 0x40(%rsp)
jne 0x280b9
movq 0x50(%rsp), %rax
testb $0x1, 0x2c(%rax)
je 0x28060
callq 0x8fcb0
movq 0x50(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x83f40
movq 0x50(%rsp), %rax
movq $0x0, 0x30(%rax)
movq 0x50(%rsp), %rax
movb $0x0, 0x2b(%rax)
movq 0x50(%rsp), %rax
movq 0x48(%rax), %rdi
callq 0x2ba00
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1b720
cmpq $0x0, %rax
jne 0x280b4
movq 0x50(%rsp), %rax
movb $0x1, 0x2a(%rax)
jmp 0x281e8
jmp 0x27cc0
jmp 0x280bb
movq 0x50(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x90d30
cmpq $0x0, %rax
jne 0x28107
movq 0x18bf02(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x135f86(%rip), %rsi    # 0x15e066
leaq 0x13b441(%rip), %rdx    # 0x163528
leaq 0x13b35a(%rip), %rcx    # 0x163448
leaq 0x13b188(%rip), %r8     # 0x16327d
movl $0xad, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x28109
movq 0x50(%rsp), %rax
testb $0x1, 0x28(%rax)
je 0x281be
movq 0x50(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x90d30
cmpq $0x1, %rax
jbe 0x281be
movq $0x0, 0x38(%rsp)
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1b720
cmpq $0x0, %rax
je 0x28199
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1b720
cmpq $0x1, %rax
je 0x28199
movq 0x18be70(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x135ef4(%rip), %rsi    # 0x15e066
leaq 0x13b367(%rip), %rdx    # 0x1634e0
leaq 0x13b2c8(%rip), %rcx    # 0x163448
leaq 0x13b0f6(%rip), %r8     # 0x16327d
movl $0xb4, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x2819b
movq 0x50(%rsp), %rax
movq 0x40(%rax), %rdi
movq 0x58(%rsp), %rcx
leaq 0x710(%rip), %rsi       # 0x288c0
leaq 0x38(%rsp), %rdx
callq 0x912f0
movl %eax, 0x44(%rsp)
cmpl $0x0, 0x44(%rsp)
jne 0x281de
movq 0x50(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x90c50
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, (%rax)
movl 0x44(%rsp), %eax
movl %eax, 0x74(%rsp)
jmp 0x2824c
jmp 0x281ea
movq 0x50(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x90d30
cmpq $0x0, %rax
je 0x28236
movq 0x18bdd3(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x135e57(%rip), %rsi    # 0x15e066
leaq 0x13b311(%rip), %rdx    # 0x163527
leaq 0x13b22b(%rip), %rcx    # 0x163448
leaq 0x13b059(%rip), %r8     # 0x16327d
movl $0xbd, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x28238
movq 0x60(%rsp), %rax
movq $0x0, (%rax)
movl 0x44(%rsp), %eax
movl %eax, 0x74(%rsp)
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)