// File: /workspace/github_c_makefile_star2_O3/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 0xc10ce
movq %r14, %rdi
callq 0xfcc32
testb %al, %al
jne 0xc12ab
testq %r15, %r15
je 0xc12a6
subl %ebp, %ebx
movslq %ebp, %rax
leaq (%r12,%rax,8), %rsi
movl %ebx, %edi
callq 0x145cdf
movq %rax, %r13
cmpb $0x1, (%r15)
jne 0xc1102
cmpq $0x0, 0x90(%r15)
je 0xc1102
movq %r13, %rdi
callq 0x145b36
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 0x171fb8
testq %rax, %rax
je 0xc11cb
movq %rax, %r12
movq 0xa8(%r15), %rdi
callq 0x11b0ca
testq %rax, %rax
je 0xc11da
movq 0xa8(%r15), %rdi
callq 0x11b0a1
leaq 0x2d2419(%rip), %rsi    # 0x3935b5
movq %rax, %rdi
movq %r14, %rdx
callq 0xfea8a
movq %rax, 0x48(%rsp)
movq %rax, %rdi
callq 0x14badb
movq %rax, %rbp
leaq 0x18a(%rip), %rsi       # 0xc1348
movq %r12, %rdi
movq %rax, %rdx
callq 0x1720ff
jmp 0xc11f6
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
xorl %edi, %edi
xorl %ebp, %ebp
jmp 0xc127f
leaq 0x17b(%rip), %rsi       # 0xc135c
movq $0x0, 0x48(%rsp)
movq %r12, %rdi
xorl %edx, %edx
callq 0x1720ff
xorl %ebp, %ebp
movsd 0x80(%r15), %xmm0
movq %r12, %rdi
callq 0x1720cd
cmpb $0x1, 0x2(%r15)
movq %r13, 0x50(%rsp)
jne 0xc122c
movq %r12, %rdi
callq 0x1809b5
testb $0x1, 0x2(%r15)
movq %rax, %rbx
movq %r12, %rdi
cmovneq %rax, %rdi
jmp 0xc1231
xorl %ebx, %ebx
movq %r12, %rdi
movq 0x90(%r15), %rsi
callq 0x146fc0
movq %rax, %r13
cmpb $0x1, 0x3(%r15)
jne 0xc124f
movq %r13, %rdi
callq 0x14703c
movq %r13, %rdi
movq %r14, %rsi
callq 0x162f5d
movl %eax, %r14d
movq %r13, %rdi
callq 0x162dee
movq %r12, %rdi
callq 0x162dee
movq %rbx, %rdi
callq 0x162dee
movq 0x50(%rsp), %r13
movq 0x48(%rsp), %rdi
callq 0xff22c
movq %rbp, %rdi
callq 0x1632f2
movq %r13, %rdi
callq 0x162dee
movl %r14d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1e9d9
callq 0x1e9a0