// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/tools/gt_select.c
// Function: gt_select_runner
static int gt_select_runner(int argc, const char **argv, int parsed_args,
                            void *tool_arguments, GtError *err)
{
  SelectArguments *arguments = tool_arguments;
  GtNodeStream *gff3_in_stream, *select_stream,
               *targetbest_select_stream = NULL, *gff3_out_stream;
  int had_err;
  GtFile *drop_file = NULL;
  GtNodeVisitor *gff3outvis = NULL;
  gt_error_check(err);
  gt_assert(arguments);

  /* create a gff3 input stream */
  gff3_in_stream = gt_gff3_in_stream_new_unsorted(argc - parsed_args,
                                                  argv + parsed_args);
  if (arguments->verbose && arguments->outfp)
    gt_gff3_in_stream_show_progress_bar((GtGFF3InStream*) gff3_in_stream);

  /* create a filter stream */
  select_stream = gt_select_stream_new(gff3_in_stream, arguments->seqid,
                                       arguments->source,
                                       &arguments->contain_range,
                                       &arguments->overlap_range,
                                       arguments->strand,
                                       arguments->targetstrand,
                                       arguments->has_CDS,
                                       arguments->max_gene_length,
                                       arguments->max_gene_num,
                                       arguments->min_gene_score,
                                       arguments->max_gene_score,
                                       arguments->min_average_splice_site_prob,
                                       arguments->feature_num,
                                       arguments->filter_files,
                                       arguments->filter_logic,
                                       err);

  if (select_stream) {
    GtSelectStream *fs = (GtSelectStream*) select_stream;

    if (gt_str_length(arguments->dropped_file) > 0) {
      drop_file = gt_file_new(gt_str_get(arguments->dropped_file), "w", err);
      gff3outvis = gt_gff3_visitor_new(drop_file);
      gt_select_stream_set_drophandler(fs, print_to_file_drophandler,
                                       (void*) gff3outvis);
    } else {
      gt_select_stream_set_drophandler(fs, default_drophandler, NULL);
    }

    gt_select_stream_set_single_intron_factor(select_stream,
                                              arguments->single_intron_factor);

    if (arguments->targetbest)
      targetbest_select_stream = gt_targetbest_select_stream_new(select_stream);

    /* create a gff3 output stream */
    gff3_out_stream = gt_gff3_out_stream_new(arguments->targetbest
                                             ? targetbest_select_stream
                                             : select_stream,
                                             arguments->outfp);

    if (arguments->retainids)
      gt_gff3_out_stream_retain_id_attributes((GtGFF3OutStream*)
                                                               gff3_out_stream);

    /* pull the features through the stream and free them afterwards */
    had_err = gt_node_stream_pull(gff3_out_stream, err);

    /* free */
    gt_node_stream_delete(gff3_out_stream);
    gt_node_stream_delete(select_stream);
    gt_node_stream_delete(targetbest_select_stream);
  } else {
    had_err = -1;
  }
  gt_file_delete(drop_file);
  gt_node_visitor_delete(gff3outvis);
  gt_node_stream_delete(gff3_in_stream);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %r14
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %r12
movl %edi, %ebx
testq %r8, %r8
je 0xc31bd
movq %r14, %rdi
callq 0x101a9a
testb %al, %al
jne 0xc3397
testq %r15, %r15
je 0xc3392
subl %ebp, %ebx
movslq %ebp, %rax
leaq (%r12,%rax,8), %rsi
movl %ebx, %edi
callq 0x14d00b
movq %rax, %r13
cmpb $0x1, (%r15)
jne 0xc31f1
cmpq $0x0, 0x90(%r15)
je 0xc31f1
movq %r13, %rdi
callq 0x14ce62
movq 0x8(%r15), %rsi
movq 0x10(%r15), %rdx
leaq 0x28(%r15), %rcx
leaq 0x38(%r15), %r8
movl 0x48(%r15), %r9d
movl 0x4c(%r15), %eax
movzbl 0x1(%r15), %edi
movups 0x50(%r15), %xmm3
movsd 0x68(%r15), %xmm0
movsd 0x70(%r15), %xmm1
movsd 0x78(%r15), %xmm2
movq 0x60(%r15), %r10
movq 0x98(%r15), %r11
movq 0xa0(%r15), %rbx
movq %r14, 0x38(%rsp)
movq %rbx, 0x30(%rsp)
movq %r11, 0x28(%rsp)
movq %r10, 0x20(%rsp)
movups %xmm3, 0x10(%rsp)
movl %edi, 0x8(%rsp)
movl %eax, (%rsp)
movq %r13, %rdi
callq 0x17a37e
testq %rax, %rax
je 0xc32ba
movq %rax, %r12
movq 0xa8(%r15), %rdi
callq 0x120d4c
testq %rax, %rax
je 0xc32c9
movq 0xa8(%r15), %rdi
callq 0x120d23
leaq 0x2d97a6(%rip), %rsi    # 0x39ca31
movq %rax, %rdi
movq %r14, %rdx
callq 0x103957
movq %rax, 0x48(%rsp)
movq %rax, %rdi
callq 0x1530bc
movq %rax, %rbp
leaq 0x182(%rip), %rsi       # 0xc342f
movq %r12, %rdi
movq %rax, %rdx
callq 0x17a4c5
jmp 0xc32e5
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
xorl %edi, %edi
xorl %ebp, %ebp
jmp 0xc336b
leaq 0x173(%rip), %rsi       # 0xc3443
movq $0x0, 0x48(%rsp)
movq %r12, %rdi
xorl %edx, %edx
callq 0x17a4c5
xorl %ebp, %ebp
movsd 0x80(%r15), %xmm0
movq %r12, %rdi
callq 0x17a493
cmpb $0x1, 0x2(%r15)
movq %r13, 0x50(%rsp)
jne 0xc330f
movq %r12, %rdi
callq 0x18906c
movq %rax, %rbx
jmp 0xc3311
xorl %ebx, %ebx
cmpb $0x0, 0x2(%r15)
movq %r12, %rdi
cmovneq %rbx, %rdi
movq 0x90(%r15), %rsi
callq 0x14e310
movq %rax, %r13
cmpb $0x1, 0x3(%r15)
jne 0xc333b
movq %r13, %rdi
callq 0x14e38c
movq %r13, %rdi
movq %r14, %rsi
callq 0x16adca
movl %eax, %r14d
movq %r13, %rdi
callq 0x16ac6e
movq %r12, %rdi
callq 0x16ac6e
movq %rbx, %rdi
callq 0x16ac6e
movq 0x50(%rsp), %r13
movq 0x48(%rsp), %rdi
callq 0x1040fc
movq %rbp, %rdi
callq 0x16b162
movq %r13, %rdi
callq 0x16ac6e
movl %r14d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1ed63
callq 0x1ed2a