// File: /workspace/github_c_makefile_star2_O3/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 $0xe8, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rsi, 0xb0(%rsp)
movq %rdi, 0xc8(%rsp)
testq %r8, %r8
je 0x206238
movq %rbx, %rdi
callq 0xfcc32
testb %al, %al
jne 0x20698c
testq %r14, %r14
je 0x206987
movq %rbx, %r9
movq 0x50(%r14), %rax
movq %rax, 0x88(%rsp)
movq 0x58(%r14), %rax
movq %rax, 0x78(%rsp)
movq 0x60(%r14), %rax
movq %rax, 0x80(%rsp)
movups 0x68(%r14), %xmm1
movsd 0x88(%r14), %xmm0
movl 0x90(%r14), %ecx
movq 0xf0(%r14), %r10
movzbl 0xbb(%r14), %r11d
movzbl 0xb5(%r14), %ebx
movzbl 0xb4(%r14), %ebp
movzbl 0xba(%r14), %r8d
movq 0x80(%r14), %r12
movl 0xa4(%r14), %r13d
movl 0xa8(%r14), %eax
movl 0xb0(%r14), %r15d
movq 0x10(%r14), %rdi
movq 0x40(%r14), %rsi
movups 0x94(%r14), %xmm2
movq 0x48(%r14), %rdx
movaps %xmm2, 0xd0(%rsp)
movaps 0xd0(%rsp), %xmm2
movups %xmm2, 0x18(%rsp)
movq %r15, 0x68(%rsp)
movl %eax, 0x60(%rsp)
movl %r13d, 0x58(%rsp)
movq %r12, 0x50(%rsp)
movl %r8d, 0x48(%rsp)
movl %ebp, 0x40(%rsp)
movl %ebx, 0x38(%rsp)
movl %r11d, 0x30(%rsp)
movq %r10, 0x28(%rsp)
movl %ecx, 0x10(%rsp)
movq %r9, %r15
movq %r9, 0x70(%rsp)
movups %xmm1, (%rsp)
movq 0x78(%rsp), %r8
movq 0x80(%rsp), %r9
movq 0x88(%rsp), %rcx
callq 0x210275
testq %rax, %rax
je 0x206359
movq %rax, %r13
cmpb $0x0, 0xbd(%r14)
movq %r14, %rbx
movq %rax, %rdi
je 0x206363
callq 0x21023c
jmp 0x206368
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x206973
callq 0x210229
cmpb $0x0, 0xbe(%rbx)
je 0x20637b
movq %r13, %rdi
callq 0x210262
jmp 0x206383
movq %r13, %rdi
callq 0x21024f
movq %r13, %rdi
callq 0x210202
movq %rax, %r12
cmpb $0x1, 0xbc(%rbx)
jne 0x2063aa
cmpb $0x1, 0xb9(%rbx)
jne 0x2063b6
movq %r12, %rdi
callq 0x212066
jmp 0x2063bb
movq %r13, %rdi
xorl %esi, %esi
callq 0x146fc0
jmp 0x2063c6
callq 0x21202a
movq %r13, %rdi
movq %rax, %rsi
callq 0x211744
movq %rax, 0x88(%rsp)
cmpb $0x1, 0xb8(%rbx)
jne 0x206418
movq 0x38(%rbx), %rdi
callq 0x11b0a1
leaq 0x13f282(%rip), %rdx    # 0x345669
xorl %edi, %edi
movq %rax, %rsi
movq %r15, %rcx
callq 0xfead5
testq %rax, %rax
je 0x206795
movq %rax, %rbp
movq 0x88(%rsp), %rdi
movq %rax, %rsi
callq 0x146fc0
movq %rax, %rcx
movq %rax, %r14
jmp 0x206424
xorl %ecx, %ecx
movq 0x88(%rsp), %r14
xorl %ebp, %ebp
cmpb $0x1, 0xb6(%rbx)
movq %rbp, 0x80(%rsp)
jne 0x20648b
movq %rcx, %rbp
movq 0x28(%rbx), %rdi
callq 0x11b0a1
leaq 0x13f221(%rip), %rdx    # 0x345669
xorl %edi, %edi
movq %rax, %rsi
movq %r15, %rcx
callq 0xfead5
testq %rax, %rax
je 0x2067b5
movl $0x3c, %ecx
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rax, %r8
movq %rax, 0x90(%rsp)
callq 0x20effc
movq %rax, %r14
movq %rbp, %rcx
movq 0x80(%rsp), %rbp
jmp 0x206499
xorl %eax, %eax
movq $0x0, 0x90(%rsp)
movq %rax, 0xa0(%rsp)
cmpb $0x1, 0xb7(%rbx)
movq %rcx, 0xa8(%rsp)
jne 0x20651a
movq %r12, 0x78(%rsp)
movq 0x30(%rbx), %rdi
callq 0x11b0a1
leaq 0x13f1a2(%rip), %rdx    # 0x345669
xorl %edi, %edi
movq %rax, %rsi
movq %r15, %r12
movq %r15, %rcx
callq 0xfead5
testq %rax, %rax
je 0x2067dc
movq %rax, %rbp
movl $0x3c, %ecx
movq %r14, %rdi
movl $0x1, %esi
movq 0x78(%rsp), %rdx
movq %rax, %r8
callq 0x20effc
movq %rax, %r14
movq %rax, 0x98(%rsp)
movq %rbp, 0x78(%rsp)
movq 0x80(%rsp), %rbp
movq %r12, %r15
jmp 0x20652f
movq $0x0, 0x98(%rsp)
movq $0x0, 0x78(%rsp)
movb 0xbc(%rbx), %al
cmpb $0x1, %al
jne 0x2065e6
movq %r14, 0xb8(%rsp)
movq %rbx, 0xc0(%rsp)
movq 0xc8(%rsp), %rbx
testl %ebx, %ebx
jle 0x206991
cmpq $0x0, 0xb0(%rsp)
je 0x206991
leaq 0x1b8b54(%rip), %rdi    # 0x3bf0c7
xorl %eax, %eax
callq 0x17070
cmpl $0x2, %ebx
jb 0x2065be
leal -0x1(%rbx), %ebp
movl %ebx, %ebx
movl $0x1, %r14d
leaq 0x1c2518(%rip), %r12    # 0x3c8aa9
movq 0xb0(%rsp), %rax
movq (%rax,%r14,8), %rsi
movq %r12, %rdi
xorl %eax, %eax
callq 0x17070
cmpq %r14, %rbp
je 0x2065b6
movl $0x20, %edi
callq 0x17a20
incq %r14
cmpq %r14, %rbx
jne 0x206591
movl $0xa, %edi
callq 0x17a20
movq 0xc0(%rsp), %rbx
movb 0xbc(%rbx), %al
movq 0x80(%rsp), %rbp
movq 0xb8(%rsp), %r14
testb $0x1, %al
je 0x2068b8
cmpb $0x1, 0xbb(%rbx)
jne 0x2068b8
leaq 0x1b8cda(%rip), %rdi    # 0x3bf2dc
callq 0x17bd0
leaq 0x1b8d06(%rip), %rax    # 0x3bf314
leaq 0x1b8cea(%rip), %rdi    # 0x3bf2ff
cmpb $0x0, 0xbb(%rbx)
cmovneq %rax, %rdi
callq 0x17bd0
movq 0x10(%rbx), %rdi
callq 0x11b0a1
leaq 0x1b8a9a(%rip), %rdi    # 0x3bf0cf
movq %rax, %rsi
xorl %eax, %eax
callq 0x17070
cmpb $0x1, 0xb6(%rbx)
jne 0x206662
movq 0x28(%rbx), %rdi
callq 0x11b0a1
leaq 0x1b8a8a(%rip), %rdi    # 0x3bf0e2
movq %rax, %rsi
xorl %eax, %eax
callq 0x17070
cmpb $0x1, 0xb7(%rbx)
jne 0x206685
movq 0x30(%rbx), %rdi
callq 0x11b0a1
leaq 0x1b8a7b(%rip), %rdi    # 0x3bf0f6
movq %rax, %rsi
xorl %eax, %eax
callq 0x17070
cmpb $0x1, 0xb8(%rbx)
jne 0x2066a8
movq 0x38(%rbx), %rdi
callq 0x11b0a1
leaq 0x1b8a79(%rip), %rdi    # 0x3bf117
movq %rax, %rsi
xorl %eax, %eax
callq 0x17070
movl 0x90(%rbx), %esi
leaq 0x1b8a82(%rip), %rdi    # 0x3bf137
xorl %eax, %eax
callq 0x17070
movsd 0x88(%rbx), %xmm0
leaq 0x1b8a85(%rip), %rdi    # 0x3bf150
movb $0x1, %al
callq 0x17070
movq 0x50(%rbx), %rsi
leaq 0x1b8a92(%rip), %rdi    # 0x3bf16f
xorl %eax, %eax
callq 0x17070
movl 0x94(%rbx), %esi
leaq 0x1b8a96(%rip), %rdi    # 0x3bf187
xorl %eax, %eax
callq 0x17070
movl 0x98(%rbx), %esi
leaq 0x1b8a96(%rip), %rdi    # 0x3bf19b
xorl %eax, %eax
callq 0x17070
movl 0x9c(%rbx), %esi
leaq 0x1b8a99(%rip), %rdi    # 0x3bf1b2
xorl %eax, %eax
callq 0x17070
movl 0xa0(%rbx), %esi
leaq 0x1b8a9d(%rip), %rdi    # 0x3bf1ca
xorl %eax, %eax
callq 0x17070
movq 0x58(%rbx), %rsi
leaq 0x1b8aa2(%rip), %rdi    # 0x3bf1e1
xorl %eax, %eax
callq 0x17070
movq 0x60(%rbx), %rsi
leaq 0x1b8aa7(%rip), %rdi    # 0x3bf1f8
xorl %eax, %eax
callq 0x17070
movq 0x68(%rbx), %rsi
leaq 0x1b8aac(%rip), %rdi    # 0x3bf20f
xorl %eax, %eax
callq 0x17070
movq 0x70(%rbx), %rsi
leaq 0x1b8ab3(%rip), %rdi    # 0x3bf228
xorl %eax, %eax
callq 0x17070
cmpb $0x0, 0xb5(%rbx)
je 0x206812
leaq 0x1b8bbd(%rip), %rdi    # 0x3bf34d
jmp 0x20682b
movq $0x0, 0x78(%rsp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r12d, %r12d
xorl %ebp, %ebp
xorl %edi, %edi
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x20691d
movq $0x0, 0x78(%rsp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r12d, %r12d
xorl %r14d, %r14d
xorl %r15d, %r15d
movq %rbp, %rdi
movq 0x80(%rsp), %rbp
jmp 0x20691d
movq $0x0, 0x78(%rsp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r12d, %r12d
movq 0x80(%rsp), %rbp
movq 0xa8(%rsp), %rdi
movq 0x90(%rsp), %r15
movq 0xa0(%rsp), %r14
jmp 0x20691d
leaq 0x1b8b21(%rip), %rax    # 0x3bf33a
leaq 0x1b8b08(%rip), %rdi    # 0x3bf328
cmpb $0x0, 0xb4(%rbx)
cmovneq %rax, %rdi
callq 0x17bd0
movl 0xa4(%rbx), %esi
leaq 0x1b8a04(%rip), %rdi    # 0x3bf241
xorl %eax, %eax
callq 0x17070
movl 0xa8(%rbx), %esi
leaq 0x1b8a06(%rip), %rdi    # 0x3bf257
xorl %eax, %eax
callq 0x17070
movq 0x18(%rbx), %rdi
callq 0x11b0a1
leaq 0x1b8a05(%rip), %rdi    # 0x3bf26d
movq %rax, %rsi
xorl %eax, %eax
callq 0x17070
movl 0xac(%rbx), %esi
leaq 0x1b8a09(%rip), %rdi    # 0x3bf288
xorl %eax, %eax
callq 0x17070
movl 0xb0(%rbx), %esi
leaq 0x1b8a15(%rip), %rdi    # 0x3bf2a8
xorl %eax, %eax
callq 0x17070
movq 0x40(%rbx), %rsi
movq 0x48(%rbx), %rdx
movq %rsi, %rax
orq %rdx, %rax
je 0x2068b8
leaq 0x1b8a0c(%rip), %rdi    # 0x3bf2bd
xorl %eax, %eax
callq 0x17070
cmpb $0x1, 0xbc(%rbx)
jne 0x2068f0
cmpb $0x1, 0xb9(%rbx)
jne 0x2068eb
xorl %edi, %edi
cmpl $0x2, 0xa4(%rbx)
setae %dil
xorl %esi, %esi
cmpl $0x4, 0xac(%rbx)
setb %sil
callq 0x2117cf
jmp 0x2068f0
callq 0x211749
movq %r14, %rdi
movq %r15, %rsi
callq 0x162f5d
movl %eax, %ebx
movq 0x90(%rsp), %r15
movq 0xa0(%rsp), %r14
movq 0x98(%rsp), %r12
movq 0xa8(%rsp), %rdi
callq 0x162dee
movq 0x88(%rsp), %rdi
callq 0x162dee
movq %r14, %rdi
callq 0x162dee
movq %r12, %rdi
callq 0x162dee
movq %r13, %rdi
callq 0x162dee
testq %rbp, %rbp
je 0x206954
movq %rbp, %rdi
callq 0xff22c
testq %r15, %r15
movq 0x78(%rsp), %r14
je 0x206966
movq %r15, %rdi
callq 0xff22c
testq %r14, %r14
je 0x206973
movq %r14, %rdi
callq 0xff22c
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x80179
callq 0x80107
callq 0x80140
nop