// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/tools/gt_gff3.c
// Function: gt_gff3_runner
static int gt_gff3_runner(int argc, const char **argv, int parsed_args,
                          void *tool_arguments, GtError *err)
{
  GFF3Arguments *arguments = tool_arguments;
  GtTypeChecker *type_checker = NULL;
  GtXRFChecker *xrf_checker = NULL;
  GtNodeStream *gff3_in_stream,
               *sort_stream = NULL,
               *load_stream = NULL,
               *merge_feature_stream = NULL,
               *add_introns_stream = NULL,
               *set_source_stream = NULL,
               *gff3_out_stream = NULL,
               *last_stream;
  int had_err = 0;

  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);
  if (arguments->checkids)
    gt_gff3_in_stream_check_id_attributes((GtGFF3InStream*) gff3_in_stream);
  if (!arguments->addids)
    gt_gff3_in_stream_disable_add_ids(gff3_in_stream);

  last_stream = gff3_in_stream;

  /* set different type checker if necessary */
  if (gt_typecheck_info_option_used(arguments->tci)) {
    type_checker = gt_typecheck_info_create_type_checker(arguments->tci, err);
    if (!type_checker)
      had_err = -1;
    if (!had_err)
      gt_gff3_in_stream_set_type_checker(gff3_in_stream, type_checker);
  }

  /* set XRF checker if necessary */
  if (gt_xrfcheck_info_option_used(arguments->xci)) {
    xrf_checker = gt_xrfcheck_info_create_xrf_checker(arguments->xci, err);
    if (!xrf_checker)
      had_err = -1;
    if (!had_err)
      gt_gff3_in_stream_set_xrf_checker(gff3_in_stream, xrf_checker);
  }

  /* set offset (if necessary) */
  if (!had_err && arguments->offset != GT_UNDEF_WORD)
    gt_gff3_in_stream_set_offset(gff3_in_stream, arguments->offset);

  /* set offsetfile (if necessary) */
  if (!had_err && gt_str_length(arguments->offsetfile)) {
    had_err = gt_gff3_in_stream_set_offsetfile(gff3_in_stream,
                                               arguments->offsetfile, err);
  }

  /* enable strict mode (if necessary) */
  if (!had_err && arguments->strict)
    gt_gff3_in_stream_enable_strict_mode((GtGFF3InStream*) gff3_in_stream);
  /* enable tidy mode (if necessary) */
  if (!had_err && arguments->tidy)
    gt_gff3_in_stream_enable_tidy_mode((GtGFF3InStream*) gff3_in_stream);

  if (!had_err && arguments->fixboundaries)
    gt_gff3_in_stream_fix_region_boundaries((GtGFF3InStream*) gff3_in_stream);

  /* create load stream (if necessary) */
  if (!had_err && arguments->load) {
    load_stream = gt_load_stream_new(last_stream);
    last_stream = load_stream;
  }

  /* create sort stream (if necessary) */
  if (!had_err && (arguments->sort || arguments->sortlines ||
                   arguments->sortnum)) {
    sort_stream = gt_sort_stream_new(last_stream);
    last_stream = sort_stream;
  }

  /* create merge feature stream (if necessary) */
  if (!had_err && arguments->mergefeat) {
    gt_assert(sort_stream);
    merge_feature_stream = gt_merge_feature_stream_new(sort_stream);
    last_stream = merge_feature_stream;
  }

  /* create addintrons stream (if necessary) */
  if (!had_err && arguments->addintrons) {
    gt_assert(last_stream);
    add_introns_stream = gt_add_introns_stream_new(last_stream);
    last_stream = add_introns_stream;
  }

  /* create setsource stream (if necessary) */
  if (!had_err && gt_str_length(arguments->newsource) > 0) {
    gt_assert(last_stream);
    GtNodeVisitor *ssv = gt_set_source_visitor_new(arguments->newsource);
    set_source_stream = gt_visitor_stream_new(last_stream, ssv);
    last_stream = set_source_stream;
  }

  /* create gff3 output stream */
  if (!had_err && arguments->show) {
    if (arguments->sortlines) {
      gff3_out_stream = gt_gff3_linesorted_out_stream_new(last_stream,
                                                          arguments->outfp);
      gt_gff3_linesorted_out_stream_set_fasta_width(
                                   (GtGFF3LinesortedOutStream*) gff3_out_stream,
                                   arguments->width);
      if (arguments->retainids)
        gt_gff3_linesorted_out_stream_retain_id_attributes(
                                  (GtGFF3LinesortedOutStream*) gff3_out_stream);
    } else if (arguments->sortnum) {
      gff3_out_stream = gt_gff3_numsorted_out_stream_new(last_stream,
                                                          arguments->outfp);
      gt_gff3_numsorted_out_stream_set_fasta_width(
                                   (GtGFF3NumsortedOutStream*) gff3_out_stream,
                                   arguments->width);
      if (arguments->retainids)
        gt_gff3_numsorted_out_stream_retain_id_attributes(
                                  (GtGFF3NumsortedOutStream*) gff3_out_stream);
    } else {
      gff3_out_stream = gt_gff3_out_stream_new(last_stream, arguments->outfp);
      gt_gff3_out_stream_set_fasta_width((GtGFF3OutStream*) gff3_out_stream,
                                         arguments->width);
      if (arguments->retainids)
        gt_gff3_out_stream_retain_id_attributes((GtGFF3OutStream*)
                                                               gff3_out_stream);
    }
    gt_assert(gff3_out_stream);
    last_stream = gff3_out_stream;
  }

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

  /* free */
  gt_node_stream_delete(gff3_out_stream);
  gt_node_stream_delete(sort_stream);
  gt_node_stream_delete(load_stream);
  gt_node_stream_delete(merge_feature_stream);
  gt_node_stream_delete(add_introns_stream);
  gt_node_stream_delete(set_source_stream);
  gt_node_stream_delete(gff3_in_stream);
  gt_type_checker_delete(type_checker);
  gt_xrf_checker_delete(xrf_checker);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, %r15
movq %rcx, %r13
movl %edx, %ebp
movq %rsi, %r14
movl %edi, %ebx
testq %r8, %r8
je 0xaa784
movq %r15, %rdi
callq 0xfcc32
testb %al, %al
jne 0xaab45
testq %r13, %r13
je 0xaab40
subl %ebp, %ebx
movslq %ebp, %rax
leaq (%r14,%rax,8), %rsi
movl %ebx, %edi
callq 0x145cdf
movq %rax, %rbx
cmpb $0x1, 0x9(%r13)
jne 0xaa7b6
cmpq $0x0, 0x48(%r13)
je 0xaa7b6
movq %rbx, %rdi
callq 0x145b36
cmpb $0x1, 0x5(%r13)
jne 0xaa7c5
movq %rbx, %rdi
callq 0x145b22
cmpb $0x0, 0x6(%r13)
jne 0xaa7d4
movq %rbx, %rdi
callq 0x145c53
movq 0x30(%r13), %rdi
callq 0x1833be
testb %al, %al
movq %rbx, 0x40(%rsp)
je 0xaa80b
movq 0x30(%r13), %rdi
movq %r15, %rsi
callq 0x1833e7
testq %rax, %rax
je 0xaa947
movq %rax, %rbp
movq %rbx, %rdi
movq %rax, %rsi
callq 0x145b4a
jmp 0xaa80d
xorl %ebp, %ebp
movq 0x38(%r13), %rdi
callq 0x1860ea
testb %al, %al
je 0xaa851
leaq 0x38(%r13), %rax
movb $0x1, %r14b
movq (%rax), %rdi
movq %r15, %rsi
callq 0x186102
testq %rax, %rax
sete %cl
xorb $0x1, %r14b
orb %cl, %r14b
movq %rax, 0x18(%rsp)
jne 0xaa8df
movq %rbx, %rdi
movq %rax, %rsi
callq 0x145b81
jmp 0xaa85a
movq $0x0, 0x18(%rsp)
movq 0x10(%r13), %rsi
movq %rsi, %rax
negq %rax
jo 0xaa86e
movq %rbx, %rdi
callq 0x145be0
movq 0x18(%r13), %rdi
callq 0x11b0ca
testq %rax, %rax
movq %rbp, 0x10(%rsp)
je 0xaa899
movq 0x18(%r13), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x145c17
testl %eax, %eax
je 0xaa899
movl %eax, %r12d
jmp 0xaa8ea
cmpb $0x1, 0xa(%r13)
jne 0xaa8a8
movq %rbx, %rdi
callq 0x145c80
cmpb $0x1, 0xb(%r13)
jne 0xaa8b7
movq %rbx, %rdi
callq 0x145c94
cmpb $0x1, 0xd(%r13)
jne 0xaa8c6
movq %rbx, %rdi
callq 0x145cb5
cmpb $0x1, 0x3(%r13)
jne 0xaa8fe
movq %rbx, %rdi
callq 0x15c078
movq %rax, %r12
movq %rax, 0x8(%rsp)
jmp 0xaa90a
movq %rbp, 0x10(%rsp)
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %edi, %edi
xorl %r15d, %r15d
xorl %r14d, %r14d
xorl %r13d, %r13d
xorl %ebx, %ebx
xorl %ebp, %ebp
jmp 0xaaae3
movq $0x0, 0x8(%rsp)
movq %rbx, %r12
cmpb $0x0, (%r13)
jne 0xaa91f
cmpb $0x0, 0x1(%r13)
jne 0xaa91f
cmpb $0x1, 0x2(%r13)
jne 0xaa98e
movq %r12, %rdi
callq 0x175d64
movq %rax, %r14
cmpb $0x0, 0x7(%r13)
je 0xaa968
testq %r14, %r14
je 0xaab4f
movq %r14, %rdi
callq 0x16115c
movq %rax, %r12
jmp 0xaa99e
movq 0x38(%r13), %rdi
callq 0x1860ea
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %ebp, %ebp
testb %al, %al
je 0xaa96f
leaq 0x38(%r13), %rax
xorl %r14d, %r14d
jmp 0xaa821
xorl %eax, %eax
movq %r14, %r12
jmp 0xaa99e
movq $0x0, 0x10(%rsp)
xorl %edi, %edi
xorl %r15d, %r15d
xorl %r14d, %r14d
movq $0x0, 0x18(%rsp)
jmp 0xaa8f2
cmpb $0x0, 0x7(%r13)
jne 0xaab4f
xorl %r14d, %r14d
xorl %eax, %eax
cmpb $0x1, 0x8(%r13)
jne 0xaa9c3
testq %r12, %r12
je 0xaab54
movq %rax, %rbx
movq %r12, %rdi
callq 0x120894
movq %rax, %r12
movq %rax, 0x28(%rsp)
jmp 0xaa9cf
movq %rax, %rbx
movq $0x0, 0x28(%rsp)
movq 0x20(%r13), %rdi
callq 0x11b0ca
testq %rax, %rax
movq %r15, 0x38(%rsp)
je 0xaaa04
testq %r12, %r12
je 0xaab4a
movq 0x20(%r13), %rdi
callq 0x174584
movq %r12, %rdi
movq %rax, %rsi
callq 0x1841d5
movq %rax, %r12
jmp 0xaaa06
xorl %eax, %eax
cmpb $0x1, 0xc(%r13)
movq %rax, 0x30(%rsp)
jne 0xaaa45
cmpb $0x1, 0x1(%r13)
jne 0xaaa55
movq 0x48(%r13), %rsi
movq %r12, %rdi
callq 0x14680a
movq %rax, %r15
movq 0x28(%r13), %rsi
movq %rax, %rdi
callq 0x1468b1
cmpb $0x1, 0x4(%r13)
jne 0xaaaae
movq %r15, %rdi
callq 0x1468c5
jmp 0xaaaae
movq $0x0, 0x20(%rsp)
movq 0x8(%rsp), %r13
jmp 0xaaac4
movq 0x48(%r13), %rsi
cmpb $0x1, 0x2(%r13)
jne 0xaaa88
movq %r12, %rdi
callq 0x146e4f
movq %rax, %r15
movq 0x28(%r13), %rsi
movq %rax, %rdi
callq 0x146ec3
cmpb $0x1, 0x4(%r13)
jne 0xaaaae
movq %r15, %rdi
callq 0x146ed7
jmp 0xaaaae
movq %r12, %rdi
callq 0x146fc0
movq %rax, %r15
movq 0x28(%r13), %rsi
movq %rax, %rdi
callq 0x147028
cmpb $0x1, 0x4(%r13)
jne 0xaaaae
movq %r15, %rdi
callq 0x14703c
movq 0x8(%rsp), %r13
movq %r15, %r12
movq %r15, 0x20(%rsp)
testq %r15, %r15
je 0xaab59
movq %r12, %rdi
movq 0x38(%rsp), %rsi
callq 0x162f5d
movl %eax, %r12d
movq 0x28(%rsp), %r15
movq 0x30(%rsp), %rbp
movq 0x20(%rsp), %rdi
callq 0x162dee
movq %r14, %rdi
callq 0x162dee
movq %r13, %rdi
callq 0x162dee
movq %rbx, %rdi
callq 0x162dee
movq %r15, %rdi
callq 0x162dee
movq %rbp, %rdi
callq 0x162dee
movq 0x40(%rsp), %rdi
callq 0x162dee
movq 0x10(%rsp), %rdi
callq 0x183173
movq 0x18(%rsp), %rdi
callq 0x185fde
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1b7e4
callq 0x1b6c7
callq 0x1b700
callq 0x1b7ab
callq 0x1b772
callq 0x1b739
nop