// File: /workspace/github_c_makefile_star2_O1/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 $0xf8, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rsi, 0xb0(%rsp)
movl %edi, %r15d
testq %r8, %r8
je 0x20f9e5
movq %rbx, %rdi
callq 0x101a9a
testb %al, %al
jne 0x210251
movq %r15, 0xd0(%rsp)
testq %r14, %r14
je 0x21024c
movq %rbx, %r9
movq 0x50(%r14), %rax
movq %rax, 0x80(%rsp)
movq 0x58(%r14), %rax
movq %rax, 0xa0(%rsp)
movq 0x60(%r14), %rax
movq %rax, 0x88(%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), %r15d
movq 0x80(%r14), %r12
movl 0xa4(%r14), %r13d
movl 0xa8(%r14), %eax
movl 0xb0(%r14), %r8d
movq 0x10(%r14), %rdi
movq 0x40(%r14), %rsi
movups 0x94(%r14), %xmm2
movq 0x48(%r14), %rdx
movaps %xmm2, 0xe0(%rsp)
movaps 0xe0(%rsp), %xmm2
movups %xmm2, 0x18(%rsp)
movq %r8, 0x68(%rsp)
movl %eax, 0x60(%rsp)
movl %r13d, 0x58(%rsp)
movq %r12, 0x50(%rsp)
movl %r15d, 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 0xa0(%rsp), %r8
movq 0x88(%rsp), %r9
movq 0x80(%rsp), %rcx
callq 0x219d0a
testq %rax, %rax
je 0x20fb14
movq %rax, %rbx
cmpb $0x0, 0xbd(%r14)
movq %r14, %r13
movq %rax, %rdi
je 0x20fb1f
callq 0x219cd1
jmp 0x20fb24
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jmp 0x2101e2
callq 0x219cbe
cmpb $0x0, 0xbe(%r13)
je 0x20fb38
movq %rbx, %rdi
callq 0x219cf7
jmp 0x20fb40
movq %rbx, %rdi
callq 0x219ce4
movq %rbx, %rdi
callq 0x219c97
cmpb $0x1, 0xbc(%r13)
movq %rax, 0x88(%rsp)
jne 0x20fb6e
cmpb $0x1, 0xb9(%r13)
jne 0x20fb7a
movq %rax, %rdi
callq 0x21bd4d
jmp 0x20fb7f
movq %rbx, %rdi
xorl %esi, %esi
callq 0x14e310
jmp 0x20fb8a
callq 0x21bd11
movq %rbx, %rdi
movq %rax, %rsi
callq 0x21b404
movq %rax, %r14
movb $0x1, %r12b
cmpb $0x1, 0xb8(%r13)
jne 0x20fbdc
movq 0x38(%r13), %rdi
callq 0x120d23
leaq 0x13eabf(%rip), %rdx    # 0x34e669
xorl %edi, %edi
movq %rax, %rsi
movq %r15, %rcx
callq 0x1039a2
testq %rax, %rax
je 0x20fbf4
movq %r14, %rdi
movq %rax, 0xa0(%rsp)
movq %rax, %rsi
callq 0x14e310
movq %rax, %rdi
movq %rax, 0x98(%rsp)
jmp 0x20fc0d
xorl %edi, %edi
movq %r14, 0x98(%rsp)
movq $0x0, 0xa0(%rsp)
jmp 0x20fc0d
movq %r14, 0x98(%rsp)
movq $0x0, 0xa0(%rsp)
xorl %r12d, %r12d
xorl %edi, %edi
testb %r12b, %r12b
je 0x20fc8b
movb $0x1, %r12b
cmpb $0x1, 0xb6(%r13)
jne 0x20fc9e
movq %r14, 0xa8(%rsp)
movq %rdi, %r14
movq 0x28(%r13), %rdi
callq 0x120d23
leaq 0x13ea2f(%rip), %rdx    # 0x34e669
xorl %edi, %edi
movq %rax, %rsi
movq %r15, %rcx
callq 0x1039a2
testq %rax, %rax
je 0x20fcac
movq %rax, %rbp
movl $0x3c, %ecx
movq 0x98(%rsp), %rdi
xorl %esi, %esi
movq 0x88(%rsp), %rdx
movq %rax, %r8
callq 0x2189e0
movq %rax, 0x80(%rsp)
movq %rax, 0x98(%rsp)
movq %r14, %rdi
movq 0xa8(%rsp), %r14
jmp 0x20fcc8
movq $0x0, 0x80(%rsp)
xorl %ebp, %ebp
xorl %r12d, %r12d
jmp 0x20fcc8
movq $0x0, 0x80(%rsp)
jmp 0x20fcc6
movq $0x0, 0x80(%rsp)
xorl %r12d, %r12d
movq %r14, %rdi
movq 0xa8(%rsp), %r14
xorl %ebp, %ebp
testb %r12b, %r12b
je 0x20fd51
movb $0x1, %cl
cmpb $0x1, 0xb7(%r13)
jne 0x20fd63
movq %r14, %r12
movq %rdi, %r14
movq 0x30(%r13), %rdi
callq 0x120d23
leaq 0x13e972(%rip), %rdx    # 0x34e669
xorl %edi, %edi
movq %rax, %rsi
movq %r15, %rcx
callq 0x1039a2
testq %rax, %rax
je 0x21003d
movl $0x3c, %ecx
movq %rax, %r8
movq 0x98(%rsp), %rdi
movl $0x1, %esi
movq 0x88(%rsp), %rdx
movq %rax, 0x88(%rsp)
callq 0x2189e0
movq %rax, 0x98(%rsp)
movq %r14, %rdi
movq %r12, %r14
movq 0x80(%rsp), %r12
movb $0x1, %cl
jmp 0x20fd79
xorl %eax, %eax
movq $0x0, 0x88(%rsp)
xorl %ecx, %ecx
jmp 0x20fd71
xorl %eax, %eax
movq $0x0, 0x88(%rsp)
movq 0x80(%rsp), %r12
testb %cl, %cl
movq %rax, 0xd8(%rsp)
je 0x210181
cmpb $0x1, 0xbc(%r13)
jne 0x20fe70
movq %rcx, 0x90(%rsp)
movq %rbp, 0xb8(%rsp)
movq %rdi, 0xc0(%rsp)
movq %r14, 0xa8(%rsp)
movq %r15, 0xc8(%rsp)
movq %rbx, %r14
movq 0xd0(%rsp), %rbx
testl %ebx, %ebx
jle 0x210256
cmpq $0x0, 0xb0(%rsp)
je 0x210256
leaq 0x1b895f(%rip), %rdi    # 0x3c8747
xorl %eax, %eax
callq 0x17070
cmpl $0x2, %ebx
jl 0x20fe33
leal -0x1(%rbx), %ebp
movl %ebx, %ebx
movl $0x1, %r15d
leaq 0x1c23cb(%rip), %r12    # 0x3d21d1
movq 0xb0(%rsp), %rax
movq (%rax,%r15,8), %rsi
movq %r12, %rdi
xorl %eax, %eax
callq 0x17070
cmpq %r15, %rbp
je 0x20fe2b
movl $0x20, %edi
callq 0x17a20
incq %r15
cmpq %r15, %rbx
jne 0x20fe06
movl $0xa, %edi
callq 0x17a20
movq %r14, %rbx
movq 0xc8(%rsp), %r15
movq 0xa8(%rsp), %r14
movq 0xc0(%rsp), %rdi
movq 0xb8(%rsp), %rbp
movq 0x80(%rsp), %r12
movq 0x90(%rsp), %rcx
testb %cl, %cl
je 0x210181
cmpb $0x1, 0xbc(%r13)
jne 0x210125
cmpb $0x1, 0xbb(%r13)
jne 0x210125
movq %rcx, 0x90(%rsp)
movq %rdi, %r12
leaq 0x1b8ab6(%rip), %rdi    # 0x3c895c
callq 0x17bd0
leaq 0x1b8ae2(%rip), %rax    # 0x3c8994
leaq 0x1b8ac6(%rip), %rdi    # 0x3c897f
cmpb $0x0, 0xbb(%r13)
cmovneq %rax, %rdi
callq 0x17bd0
movq 0x10(%r13), %rdi
callq 0x120d23
leaq 0x1b8875(%rip), %rdi    # 0x3c874f
movq %rax, %rsi
xorl %eax, %eax
callq 0x17070
cmpb $0x1, 0xb6(%r13)
jne 0x20ff08
movq 0x28(%r13), %rdi
callq 0x120d23
leaq 0x1b8864(%rip), %rdi    # 0x3c8762
movq %rax, %rsi
xorl %eax, %eax
callq 0x17070
cmpb $0x1, 0xb7(%r13)
jne 0x20ff2c
movq 0x30(%r13), %rdi
callq 0x120d23
leaq 0x1b8854(%rip), %rdi    # 0x3c8776
movq %rax, %rsi
xorl %eax, %eax
callq 0x17070
cmpb $0x1, 0xb8(%r13)
jne 0x20ff50
movq 0x38(%r13), %rdi
callq 0x120d23
leaq 0x1b8851(%rip), %rdi    # 0x3c8797
movq %rax, %rsi
xorl %eax, %eax
callq 0x17070
movl 0x90(%r13), %esi
leaq 0x1b8859(%rip), %rdi    # 0x3c87b7
xorl %eax, %eax
callq 0x17070
movsd 0x88(%r13), %xmm0
leaq 0x1b885b(%rip), %rdi    # 0x3c87d0
movb $0x1, %al
callq 0x17070
movq 0x50(%r13), %rsi
leaq 0x1b8868(%rip), %rdi    # 0x3c87ef
xorl %eax, %eax
callq 0x17070
movl 0x94(%r13), %esi
leaq 0x1b886b(%rip), %rdi    # 0x3c8807
xorl %eax, %eax
callq 0x17070
movl 0x98(%r13), %esi
leaq 0x1b886a(%rip), %rdi    # 0x3c881b
xorl %eax, %eax
callq 0x17070
movl 0x9c(%r13), %esi
leaq 0x1b886c(%rip), %rdi    # 0x3c8832
xorl %eax, %eax
callq 0x17070
movl 0xa0(%r13), %esi
leaq 0x1b886f(%rip), %rdi    # 0x3c884a
xorl %eax, %eax
callq 0x17070
movq 0x58(%r13), %rsi
leaq 0x1b8874(%rip), %rdi    # 0x3c8861
xorl %eax, %eax
callq 0x17070
movq 0x60(%r13), %rsi
leaq 0x1b8879(%rip), %rdi    # 0x3c8878
xorl %eax, %eax
callq 0x17070
movq 0x68(%r13), %rsi
leaq 0x1b887e(%rip), %rdi    # 0x3c888f
xorl %eax, %eax
callq 0x17070
movq 0x70(%r13), %rsi
leaq 0x1b8885(%rip), %rdi    # 0x3c88a8
xorl %eax, %eax
callq 0x17070
cmpb $0x0, 0xb5(%r13)
je 0x210060
leaq 0x1b8992(%rip), %rdi    # 0x3c89cd
jmp 0x21007a
movq $0x0, 0x88(%rsp)
xorl %ecx, %ecx
movq %r14, %rdi
movq %r12, %r14
movq 0x80(%rsp), %r12
xorl %eax, %eax
jmp 0x20fd79
leaq 0x1b8953(%rip), %rax    # 0x3c89ba
leaq 0x1b893a(%rip), %rdi    # 0x3c89a8
cmpb $0x0, 0xb4(%r13)
cmovneq %rax, %rdi
callq 0x17bd0
movl 0xa4(%r13), %esi
leaq 0x1b8834(%rip), %rdi    # 0x3c88c1
xorl %eax, %eax
callq 0x17070
movl 0xa8(%r13), %esi
leaq 0x1b8835(%rip), %rdi    # 0x3c88d7
xorl %eax, %eax
callq 0x17070
movq 0x18(%r13), %rdi
callq 0x120d23
leaq 0x1b8834(%rip), %rdi    # 0x3c88ed
movq %rax, %rsi
xorl %eax, %eax
callq 0x17070
movl 0xac(%r13), %esi
leaq 0x1b8837(%rip), %rdi    # 0x3c8908
xorl %eax, %eax
callq 0x17070
movl 0xb0(%r13), %esi
leaq 0x1b8842(%rip), %rdi    # 0x3c8928
xorl %eax, %eax
callq 0x17070
movq 0x40(%r13), %rsi
testq %rsi, %rsi
movq 0x90(%rsp), %rcx
jne 0x210108
movq %r12, %rdi
cmpq $0x0, 0x48(%r13)
je 0x210125
movq 0x48(%r13), %rdx
leaq 0x1b882a(%rip), %rdi    # 0x3c893d
xorl %eax, %eax
callq 0x17070
movq 0x90(%rsp), %rcx
movq %r12, %rdi
testb %cl, %cl
je 0x210179
cmpb $0x1, 0xbc(%r13)
jne 0x21020a
movq %rcx, 0x90(%rsp)
movq %r14, %r12
movq %rdi, %r14
cmpb $0x1, 0xb9(%r13)
jne 0x2101f7
xorl %edi, %edi
cmpl $0x2, 0xa4(%r13)
setae %dil
xorl %esi, %esi
cmpl $0x4, 0xac(%r13)
setb %sil
callq 0x21b48f
jmp 0x2101fc
movq 0x80(%rsp), %r12
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
callq 0x16ac6e
movq %r14, %rdi
callq 0x16ac6e
movq %r12, %rdi
callq 0x16ac6e
movq 0xd8(%rsp), %rdi
callq 0x16ac6e
movq %rbx, %rdi
callq 0x16ac6e
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x2101c3
callq 0x1040fc
testq %rbp, %rbp
je 0x2101d0
movq %rbp, %rdi
callq 0x1040fc
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x2101e2
callq 0x1040fc
movl %r13d, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x21b409
movq %r14, %rdi
movq %r12, %r14
movq 0x90(%rsp), %rcx
testb %cl, %cl
movq 0x80(%rsp), %r12
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
je 0x210187
movq %r14, %r12
movq %rdi, %r14
movq 0x98(%rsp), %rdi
movq %r15, %rsi
callq 0x16adca
movq %r14, %rdi
movq %r12, %r14
movq 0x80(%rsp), %r12
movl %eax, %r13d
jmp 0x210187
callq 0x8202e
callq 0x81fbc
callq 0x81ff5
nop