// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/ltr/gt_ltrharvest.c
// Function: gt_ltrharvest_runner
static int gt_ltrharvest_runner(GT_UNUSED int argc,
                                  GT_UNUSED const char **argv,
                                  GT_UNUSED int parsed_args,
                                  void *tool_arguments, GtError *err)
{
  GtNodeStream *ltrh_stream,
               *gff3_out_stream = NULL,
               *out_stream = NULL,
               *fasta_out_stream = NULL,
               *fasta_inner_out_stream = NULL,
               *last_stream;
  GtFile *gff3file = NULL,
         *fastaoutfile = NULL,
         *fastainneroutfile = NULL;
  LTRharvestArguments *arguments = tool_arguments;
  const GtEncseq *encseq = NULL;
  int had_err = 0;

  gt_error_check(err);
  gt_assert(arguments);

  /* create a LTRharvest stream */
  ltrh_stream = gt_ltrharvest_stream_new(arguments->str_indexname,
                                         arguments->searchrange,
                                         arguments->minseedlength,
                                         arguments->minltrlength,
                                         arguments->maxltrlength,
                                         arguments->mindistance,
                                         arguments->maxdistance,
                                         arguments->similaritythreshold,
                                         arguments->xdropbelowscore,
                                         arguments->arbitscores,
                                         arguments->motif,
                                         arguments->verbosemode,
                                         arguments->nooverlaps,
                                         arguments->bestoverlaps,
                                         arguments->scan,
                                         arguments->offset,
                                         arguments->minlengthTSD,
                                         arguments->maxlengthTSD,
                                         (GtUword) arguments->vicinity,
                                         err);
  if (ltrh_stream == NULL)
    return -1;
  if (!arguments->md5)
    gt_ltrharvest_stream_disable_md5_seqids((GtLTRharvestStream*) ltrh_stream);
  else
    gt_ltrharvest_stream_enable_md5_seqids((GtLTRharvestStream*) ltrh_stream);
  if (!arguments->seqids)
    gt_ltrharvest_stream_disable_seqids((GtLTRharvestStream*) ltrh_stream);
  else
    gt_ltrharvest_stream_enable_seqids((GtLTRharvestStream*) ltrh_stream);
  last_stream = ltrh_stream;

  encseq = gt_ltrharvest_stream_get_encseq(ltrh_stream);

  if (arguments->tabout) {
    GtNodeVisitor *tabout_visitor = NULL;
    /* set visitors according to output parameter */
    if (!had_err && arguments->longoutput) {
      tabout_visitor = gt_ltrharvest_tabout_visitor_new_longoutput(encseq);
    } else {
      tabout_visitor = gt_ltrharvest_tabout_visitor_new();
    }

    /* create tabular output stream (traditional LTRharvest format) */
    out_stream = gt_ltrharvest_tabout_stream_new(last_stream, tabout_visitor);
  } else {
    out_stream = gt_gff3_out_stream_new(last_stream, NULL);
  }
  last_stream = out_stream;

  /* attach GFF3 output stream if requested */
  if (!had_err && arguments->gff3output) {
    gff3file = gt_file_open(GT_FILE_MODE_UNCOMPRESSED,
                            gt_str_get(arguments->str_gff3filename),
                            "w+",
                            err);
    if (gff3file == NULL) {
      had_err = -1;
    } else {
      gff3_out_stream = gt_gff3_out_stream_new(last_stream, gff3file);
      last_stream = gff3_out_stream;
    }
  }

  /* attach FASTA output stream if requested */
  if (!had_err && arguments->fastaoutput) {
    fastaoutfile = gt_file_open(GT_FILE_MODE_UNCOMPRESSED,
                                gt_str_get(arguments->str_fastaoutputfilename),
                                "w+",
                                err);
    if (fastaoutfile == NULL) {
      had_err = -1;
    } else {
      fasta_out_stream = gt_ltrharvest_fasta_out_stream_new(last_stream,
                                                            false,
                                                            encseq,
                                                            60UL,
                                                            fastaoutfile);
      last_stream = fasta_out_stream;
    }
  }

  /* attach FASTA inner region output stream if requested */
  if (!had_err && arguments->fastaoutputinnerregion) {
    fastainneroutfile = gt_file_open(GT_FILE_MODE_UNCOMPRESSED,
                      gt_str_get(arguments->str_fastaoutputfilenameinnerregion),
                      "w+", err);
    if (fastainneroutfile == NULL) {
      had_err = -1;
    } else {
      fasta_inner_out_stream = gt_ltrharvest_fasta_out_stream_new(last_stream,
                                                             true,
                                                             encseq,
                                                             60UL,
                                                             fastainneroutfile);
      last_stream = fasta_inner_out_stream;
    }
  }

  /* output arguments line */
  if (!had_err && arguments->tabout)
    gt_ltrharvest_showargsline(argc, argv);

  /* show long parameters */
  if (!had_err && arguments->tabout && arguments->verbosemode)
    gt_ltrharvest_showopts(arguments);

  /* print tabular output header */
  if (!had_err && arguments->tabout) {
    if (arguments->longoutput) {
      gt_ltrharvest_tabout_stream_printlongheader(arguments->minlengthTSD > 1U,
                                             arguments->allowedmismatches < 4U);
    } else {
      gt_ltrharvest_tabout_stream_printshortheader();
    }
  }

  /* 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(out_stream);
  gt_node_stream_delete(fasta_out_stream);
  gt_node_stream_delete(fasta_inner_out_stream);
  gt_node_stream_delete(ltrh_stream);

  if (gff3file != NULL) gt_file_delete(gff3file);
  if (fastaoutfile != NULL) gt_file_delete(fastaoutfile);
  if (fastainneroutfile != NULL) gt_file_delete(fastainneroutfile);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movl %edi, 0x150(%rsp)
movq %rsi, 0x148(%rsp)
movl %edx, 0x144(%rsp)
movq %rcx, 0x138(%rsp)
movq %r8, 0x130(%rsp)
movq $0x0, 0x120(%rsp)
movq $0x0, 0x118(%rsp)
movq $0x0, 0x110(%rsp)
movq $0x0, 0x108(%rsp)
movq $0x0, 0xf8(%rsp)
movq $0x0, 0xf0(%rsp)
movq $0x0, 0xe8(%rsp)
movq 0x138(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq $0x0, 0xd8(%rsp)
movl $0x0, 0xd4(%rsp)
cmpq $0x0, 0x130(%rsp)
je 0x2fd148
movq 0x130(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x2fd110
jmp 0x2fd148
movq 0x33ee89(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x218ef2(%rip), %rsi    # 0x516013
leaq 0x219097(%rip), %rdx    # 0x5161bf
leaq 0x2950e6(%rip), %rcx    # 0x592215
leaq 0x294c5d(%rip), %r8     # 0x591d93
movl $0x25e, %r9d            # imm = 0x25E
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2fd14a
jmp 0x2fd14c
cmpq $0x0, 0xe0(%rsp)
jne 0x2fd18f
movq 0x33ee42(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x218eab(%rip), %rsi    # 0x516013
leaq 0x27d9f0(%rip), %rdx    # 0x57ab5f
leaq 0x29509f(%rip), %rcx    # 0x592215
leaq 0x294c16(%rip), %r8     # 0x591d93
movl $0x25f, %r9d            # imm = 0x25F
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2fd191
movq 0xe0(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0xe0(%rsp), %rdx
movq 0xe0(%rsp), %rax
movq 0x50(%rax), %rcx
movq 0xe0(%rsp), %rax
movq 0x58(%rax), %r8
movq 0xe0(%rsp), %rax
movq 0x60(%rax), %r9
movq 0xe0(%rsp), %rax
movq 0x68(%rax), %rax
movq %rax, 0x88(%rsp)
movq 0xe0(%rsp), %rax
movq 0x70(%rax), %rax
movq %rax, 0x90(%rsp)
movq 0xe0(%rsp), %rax
movsd 0x88(%rax), %xmm0
movq 0xe0(%rsp), %rax
movl 0x90(%rax), %eax
movl %eax, 0x9c(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0xe0(%rsp), %rsi
movq 0xf0(%rsi), %rsi
movq %rsi, 0xa8(%rsp)
movq 0xe0(%rsp), %rsi
movb 0xbb(%rsi), %r13b
movq 0xe0(%rsp), %rsi
movb 0xb5(%rsi), %r12b
movq 0xe0(%rsp), %rsi
movb 0xb4(%rsi), %r15b
movq 0xe0(%rsp), %rsi
movb 0xba(%rsi), %bpl
movq 0xe0(%rsp), %rsi
movq 0x80(%rsi), %r14
movq 0xe0(%rsp), %rsi
movl 0xa4(%rsi), %ebx
movq 0xe0(%rsp), %rsi
movl 0xa8(%rsi), %r11d
movq 0xe0(%rsp), %rsi
movl 0xb0(%rsi), %esi
movl %esi, %r10d
movq 0x130(%rsp), %rsi
movq %rsi, 0xb0(%rsp)
movq 0x40(%rdx), %rsi
movq 0x48(%rdx), %rdx
movq 0x94(%rax), %rax
movq %rax, 0xc0(%rsp)
movq 0x80(%rsp), %rax
movq 0x9c(%rax), %rax
movq %rax, 0xc8(%rsp)
leaq 0xc0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0x88(%rsp), %rax
andb $0x1, %r13b
andb $0x1, %r12b
andb $0x1, %r15b
andb $0x1, %bpl
movq %rax, (%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x9c(%rsp), %eax
movl %eax, 0x10(%rsp)
movq 0xa0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0xa0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xb0(%rsp), %rax
movzbl %r13b, %r13d
movl %r13d, 0x30(%rsp)
movzbl %r12b, %r12d
movl %r12d, 0x38(%rsp)
movzbl %r15b, %r15d
movl %r15d, 0x40(%rsp)
movzbl %bpl, %ebp
movl %ebp, 0x48(%rsp)
movq %r14, 0x50(%rsp)
movl %ebx, 0x58(%rsp)
movl %r11d, 0x60(%rsp)
movq %r10, 0x68(%rsp)
movq %rax, 0x70(%rsp)
callq 0x30f7b0
movq %rax, 0x128(%rsp)
cmpq $0x0, 0x128(%rsp)
jne 0x2fd3d1
movl $0xffffffff, 0x154(%rsp) # imm = 0xFFFFFFFF
jmp 0x2fd874
movq 0xe0(%rsp), %rax
testb $0x1, 0xbd(%rax)
jne 0x2fd3f1
movq 0x128(%rsp), %rdi
callq 0x30f630
jmp 0x2fd3fe
movq 0x128(%rsp), %rdi
callq 0x30f690
movq 0xe0(%rsp), %rax
testb $0x1, 0xbe(%rax)
jne 0x2fd41e
movq 0x128(%rsp), %rdi
callq 0x30f6f0
jmp 0x2fd42b
movq 0x128(%rsp), %rdi
callq 0x30f750
movq 0x128(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x128(%rsp), %rdi
callq 0x30f5b0
movq %rax, 0xd8(%rsp)
movq 0xe0(%rsp), %rax
testb $0x1, 0xbc(%rax)
je 0x2fd4cb
movq $0x0, 0xb8(%rsp)
cmpl $0x0, 0xd4(%rsp)
jne 0x2fd49f
movq 0xe0(%rsp), %rax
testb $0x1, 0xb9(%rax)
je 0x2fd49f
movq 0xd8(%rsp), %rdi
callq 0x3141b0
movq %rax, 0xb8(%rsp)
jmp 0x2fd4ac
callq 0x314120
movq %rax, 0xb8(%rsp)
movq 0x100(%rsp), %rdi
movq 0xb8(%rsp), %rsi
callq 0x313270
movq %rax, 0x118(%rsp)
jmp 0x2fd4e4
movq 0x100(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x176d50
movq %rax, 0x118(%rsp)
movq 0x118(%rsp), %rax
movq %rax, 0x100(%rsp)
cmpl $0x0, 0xd4(%rsp)
jne 0x2fd58c
movq 0xe0(%rsp), %rax
testb $0x1, 0xb8(%rax)
je 0x2fd58c
movq 0xe0(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0x11dee0
movq %rax, %rsi
movq 0x130(%rsp), %rcx
xorl %edi, %edi
leaq 0x21916c(%rip), %rdx    # 0x5166a4
callq 0xdd3f0
movq %rax, 0xf8(%rsp)
cmpq $0x0, 0xf8(%rsp)
jne 0x2fd55d
movl $0xffffffff, 0xd4(%rsp) # imm = 0xFFFFFFFF
jmp 0x2fd58a
movq 0x100(%rsp), %rdi
movq 0xf8(%rsp), %rsi
callq 0x176d50
movq %rax, 0x120(%rsp)
movq 0x120(%rsp), %rax
movq %rax, 0x100(%rsp)
jmp 0x2fd58c
cmpl $0x0, 0xd4(%rsp)
jne 0x2fd637
movq 0xe0(%rsp), %rax
testb $0x1, 0xb6(%rax)
je 0x2fd637
movq 0xe0(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x11dee0
movq %rax, %rsi
movq 0x130(%rsp), %rcx
xorl %edi, %edi
leaq 0x2190d0(%rip), %rdx    # 0x5166a4
callq 0xdd3f0
movq %rax, 0xf0(%rsp)
cmpq $0x0, 0xf0(%rsp)
jne 0x2fd5f9
movl $0xffffffff, 0xd4(%rsp) # imm = 0xFFFFFFFF
jmp 0x2fd635
movq 0x100(%rsp), %rdi
movq 0xd8(%rsp), %rdx
movq 0xf0(%rsp), %r8
xorl %esi, %esi
movl $0x3c, %ecx
callq 0x30d7b0
movq %rax, 0x110(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x100(%rsp)
jmp 0x2fd637
cmpl $0x0, 0xd4(%rsp)
jne 0x2fd6e5
movq 0xe0(%rsp), %rax
testb $0x1, 0xb7(%rax)
je 0x2fd6e5
movq 0xe0(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x11dee0
movq %rax, %rsi
movq 0x130(%rsp), %rcx
xorl %edi, %edi
leaq 0x219025(%rip), %rdx    # 0x5166a4
callq 0xdd3f0
movq %rax, 0xe8(%rsp)
cmpq $0x0, 0xe8(%rsp)
jne 0x2fd6a4
movl $0xffffffff, 0xd4(%rsp) # imm = 0xFFFFFFFF
jmp 0x2fd6e3
movq 0x100(%rsp), %rdi
movq 0xd8(%rsp), %rdx
movq 0xe8(%rsp), %r8
movl $0x1, %esi
movl $0x3c, %ecx
callq 0x30d7b0
movq %rax, 0x108(%rsp)
movq 0x108(%rsp), %rax
movq %rax, 0x100(%rsp)
jmp 0x2fd6e5
cmpl $0x0, 0xd4(%rsp)
jne 0x2fd714
movq 0xe0(%rsp), %rax
testb $0x1, 0xbc(%rax)
je 0x2fd714
movl 0x150(%rsp), %edi
movq 0x148(%rsp), %rsi
callq 0x2fd890
cmpl $0x0, 0xd4(%rsp)
jne 0x2fd74d
movq 0xe0(%rsp), %rax
testb $0x1, 0xbc(%rax)
je 0x2fd74d
movq 0xe0(%rsp), %rax
testb $0x1, 0xbb(%rax)
je 0x2fd74d
movq 0xe0(%rsp), %rdi
callq 0x2fd970
cmpl $0x0, 0xd4(%rsp)
jne 0x2fd7b7
movq 0xe0(%rsp), %rax
testb $0x1, 0xbc(%rax)
je 0x2fd7b7
movq 0xe0(%rsp), %rax
testb $0x1, 0xb9(%rax)
je 0x2fd7b0
movq 0xe0(%rsp), %rax
cmpl $0x1, 0xa4(%rax)
seta %cl
movq 0xe0(%rsp), %rax
cmpl $0x4, 0xac(%rax)
setb %al
movzbl %cl, %edi
andl $0x1, %edi
movzbl %al, %esi
andl $0x1, %esi
callq 0x313340
jmp 0x2fd7b5
callq 0x3132a0
jmp 0x2fd7b7
cmpl $0x0, 0xd4(%rsp)
jne 0x2fd7dd
movq 0x100(%rsp), %rdi
movq 0x130(%rsp), %rsi
callq 0x1b1f90
movl %eax, 0xd4(%rsp)
movq 0x120(%rsp), %rdi
callq 0x1b1cb0
movq 0x118(%rsp), %rdi
callq 0x1b1cb0
movq 0x110(%rsp), %rdi
callq 0x1b1cb0
movq 0x108(%rsp), %rdi
callq 0x1b1cb0
movq 0x128(%rsp), %rdi
callq 0x1b1cb0
cmpq $0x0, 0xf8(%rsp)
je 0x2fd836
movq 0xf8(%rsp), %rdi
callq 0xde430
cmpq $0x0, 0xf0(%rsp)
je 0x2fd84e
movq 0xf0(%rsp), %rdi
callq 0xde430
cmpq $0x0, 0xe8(%rsp)
je 0x2fd866
movq 0xe8(%rsp), %rdi
callq 0xde430
movl 0xd4(%rsp), %eax
movl %eax, 0x154(%rsp)
movl 0x154(%rsp), %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)