// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/tools/gt_tir.c
// Function: gt_tir_runner
static int gt_tir_runner(GT_UNUSED int argc, GT_UNUSED const char **argv,
                         GT_UNUSED int parsed_args, void *tool_arguments,
                         GtError *err)
{
  GtTirArguments *arguments = tool_arguments;
  GtNodeStream *tir_stream = NULL,
               *pdom_stream = NULL,
               *gff3_out_stream = NULL,
               *match_stream = NULL,
               *last_stream = NULL;
  GtPdomModelSet *ms = NULL;
  GtRegionMapping *rmap = NULL;
  int had_err = 0;

  gt_error_check(err);
  gt_assert(arguments);

  tir_stream = gt_tir_stream_new(arguments->str_indexname,
                                 arguments->min_seed_length,
                                 arguments->min_TIR_length,
                                 arguments->max_TIR_length,
                                 arguments->min_TIR_distance,
                                 arguments->max_TIR_distance,
                                 arguments->arbit_scores,
                                 arguments->xdrop_belowscore,
                                 arguments->similarity_threshold,
                                 arguments->best_overlaps,
                                 arguments->longest_overlaps,
                                 arguments->no_overlaps,
                                 arguments->min_TSD_length,
                                 arguments->max_TSD_length,
                                 arguments->vicinity,
                                 err);

  if (tir_stream == NULL)
    return -1;
  last_stream = tir_stream;

  if (!arguments->md5)
    gt_tir_stream_disable_md5_seqids((GtTIRStream*) tir_stream);
  else
    gt_tir_stream_enable_md5_seqids((GtTIRStream*) tir_stream);
  if (!arguments->seqids)
    gt_tir_stream_disable_seqids((GtTIRStream*) tir_stream);
  else
    gt_tir_stream_enable_seqids((GtTIRStream*) tir_stream);

  /* re-load unmirrored encseq */
  GtEncseqLoader *el = gt_encseq_loader_new();
  GtEncseq *unm_es = gt_encseq_loader_load(el,
                                           gt_str_get(arguments->str_indexname),
                                           err);
  rmap = gt_region_mapping_new_encseq(unm_es, true, false);
  gt_assert(rmap);

  if (!had_err && gt_str_array_size(arguments->hmm_files) > 0)
  {
    if (!strcmp(gt_str_get(arguments->cutoffs), "GA")) {
      arguments->cutoff = GT_PHMM_CUTOFF_GA;
    } else if (!strcmp(gt_str_get(arguments->cutoffs), "TC")) {
      arguments->cutoff = GT_PHMM_CUTOFF_TC;
    } else if (!strcmp(gt_str_get(arguments->cutoffs), "NONE")) {
      arguments->cutoff = GT_PHMM_CUTOFF_NONE;
    } else {
      gt_error_set(err, "invalid cutoff setting!");
      had_err = -1;
    }
  }

  if (!had_err && gt_str_array_size(arguments->hmm_files) > 0) {
    GtNodeVisitor *pdom_v;
    ms = gt_pdom_model_set_new(arguments->hmm_files, false, err);
    if (ms != NULL) {
      pdom_v = gt_ltrdigest_pdom_visitor_new(ms, arguments->evalue_cutoff,
                                             arguments->chain_max_gap_length,
                                             arguments->cutoff, rmap,
                                             err);
      if (pdom_v == NULL)
        had_err = -1;
      if (!had_err) {
        last_stream = pdom_stream = gt_visitor_stream_new(last_stream, pdom_v);
        gt_ltrdigest_pdom_visitor_set_root_type((GtLTRdigestPdomVisitor*)
                                                                        pdom_v,
                                        gt_ft_terminal_inverted_repeat_element);
        gt_ltrdigest_pdom_visitor_set_source_tag((GtLTRdigestPdomVisitor*)
                                                                        pdom_v,
                                                 "TIRvish");
      }
    } else had_err = -1;
  }

  if (!had_err && gt_str_length(arguments->refseq_file) > 0) {
    match_stream = gt_ltr_refseq_match_stream_new_with_mapping(
                                      last_stream,
                                      gt_str_get(arguments->refseq_file),
                                      rmap,
                                      0.0001, /* double evalue, */
                                      true, /* bool dust, */
                                      12, /* int word_size, */
                                      GT_UNDEF_INT, /* int gapopen, */
                                      GT_UNDEF_INT, /* int gapextend, */
                                      GT_UNDEF_INT, /* int penalty, */
                                      GT_UNDEF_INT, /* int reward, */
                                      2, /* int num_threads, */
                                      GT_UNDEF_DOUBLE, /* double xdrop, */
                                      GT_UNDEF_DOUBLE, /* double identity, */
                                      NULL, /* const char *moreblast, */
                                      false, /* bool flcands, */
                                      10, /* double min_ali_len_perc, */
                                      GT_UNDEF_UWORD, /* GtUword params_id, */
                                      "TIRvish",
                                      err);
    if (!match_stream)
      had_err = -1;
    else
      last_stream = match_stream;
  }

  gff3_out_stream = gt_gff3_out_stream_new(last_stream, NULL);
  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);

  gt_node_stream_delete(tir_stream);
  gt_node_stream_delete(pdom_stream);
  gt_node_stream_delete(gff3_out_stream);
  gt_node_stream_delete(match_stream);
  gt_region_mapping_delete(rmap);
  gt_pdom_model_set_delete(ms);
  gt_encseq_delete(unm_es);
  gt_encseq_loader_delete(el);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movq %rcx, %rbp
testq %r8, %r8
je 0xd2178
movq %rbx, %rdi
callq 0x101a9a
testb %al, %al
jne 0xd2503
testq %rbp, %rbp
je 0xd24fe
movq (%rbp), %rdi
movq 0x20(%rbp), %rsi
movq 0x28(%rbp), %rdx
movq 0x30(%rbp), %rcx
movq 0x38(%rbp), %r8
movq 0x40(%rbp), %r9
movl 0x70(%rbp), %eax
movsd 0x78(%rbp), %xmm0
movzbl 0x88(%rbp), %r10d
movzbl 0x8a(%rbp), %r11d
movzbl 0x89(%rbp), %r14d
movups 0x48(%rbp), %xmm1
movq 0x58(%rbp), %r15
subq $0x50, %rsp
movups 0x60(%rbp), %xmm2
movups %xmm2, (%rsp)
movq %rbx, 0x48(%rsp)
movq %r15, 0x40(%rsp)
movups %xmm1, 0x30(%rsp)
movl %r14d, 0x28(%rsp)
movl %r11d, 0x20(%rsp)
movl %r10d, 0x18(%rsp)
movl %eax, 0x10(%rsp)
callq 0x18aab7
addq $0x50, %rsp
testq %rax, %rax
je 0xd2213
movq %rax, %r13
cmpb $0x0, 0x8c(%rbp)
je 0xd221e
movq %r13, %rdi
callq 0x18ad6d
jmp 0xd2226
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0xd24ec
movq %r13, %rdi
callq 0x18ad5a
cmpb $0x0, 0x8b(%rbp)
je 0xd2239
movq %r13, %rdi
callq 0x18ad93
jmp 0xd2241
movq %r13, %rdi
callq 0x18ad80
callq 0xf36ef
movq %rax, %r14
movq (%rbp), %rdi
callq 0x120d23
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0xf374b
movq %rax, %r15
movq %rax, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x1759b6
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0xd2508
movq 0xa0(%rbp), %rdi
callq 0x121e78
testq %rax, %rax
movq %r14, 0x20(%rsp)
movq %r15, 0x18(%rsp)
je 0xd2322
movq 0x8(%rbp), %rdi
callq 0x120d23
leaq 0x299476(%rip), %rsi    # 0x36b725
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xd230c
movq 0x8(%rbp), %rdi
callq 0x120d23
leaq 0x2943ad(%rip), %rsi    # 0x366678
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xd2313
movq 0x8(%rbp), %rdi
callq 0x120d23
leaq 0x29438c(%rip), %rsi    # 0x366673
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xd2317
leaq 0x2949d6(%rip), %rsi    # 0x366cd0
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1019cf
jmp 0xd23b4
movl $0x1, %eax
jmp 0xd231c
xorl %eax, %eax
jmp 0xd231c
movl $0x2, %eax
movl %eax, 0xa8(%rbp)
movq 0xa0(%rbp), %rdi
callq 0x121e78
movb $0x1, %r12b
testq %rax, %rax
je 0xd23bc
movq 0xa0(%rbp), %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x21be50
movq %rax, %r15
testq %rax, %rax
je 0xd23b4
movsd 0x80(%rbp), %xmm0
movl 0x90(%rbp), %esi
movl 0xa8(%rbp), %edx
movq %r15, (%rsp)
movq %r15, %rdi
movq 0x8(%rsp), %rcx
movq %rbx, %r8
callq 0x215b23
testq %rax, %rax
je 0xd23c6
movq %rax, %r15
movq %r13, %rdi
movq %rax, %rsi
callq 0x18c917
movq %rax, %r14
leaq 0x294950(%rip), %rsi    # 0x366ce8
movq %r15, %rdi
callq 0x215abf
leaq 0x294962(%rip), %rsi    # 0x366d09
movq %r15, %rdi
callq 0x215ae3
movq %r14, %rax
jmp 0xd23ce
movq %r13, %r14
xorl %r12d, %r12d
jmp 0xd23c2
xorl %r15d, %r15d
movq %r13, %r14
xorl %eax, %eax
jmp 0xd23d2
xorl %r12d, %r12d
movq %r13, %r14
xorl %eax, %eax
movq (%rsp), %r15
movq %rax, 0x10(%rsp)
testb %r12b, %r12b
movq %r15, (%rsp)
je 0xd2471
movq 0x18(%rbp), %rdi
callq 0x120d4c
testq %rax, %rax
je 0xd2478
movq 0x18(%rbp), %rdi
callq 0x120d23
subq $0x8, %rsp
leaq 0x2948ff(%rip), %r11    # 0x366d09
movl $0x80000000, %r10d      # imm = 0x80000000
movsd 0x294240(%rip), %xmm0   # 0x366658
movsd 0x27e8f0(%rip), %xmm1   # 0x350d10
movsd 0x28bbb0(%rip), %xmm3   # 0x35dfd8
movq %r14, %rdi
movq %rax, %rsi
movq 0x10(%rsp), %rdx
movl $0x1, %ecx
movl $0xc, %r8d
movl $0x80000000, %r9d       # imm = 0x80000000
movaps %xmm1, %xmm2
pushq %rbx
pushq %r11
pushq $-0x1
pushq $0x0
pushq $0x0
pushq $0x2
pushq %r10
pushq %r10
pushq %r10
callq 0x212891
addq $0x50, %rsp
movq %rax, %rbp
testq %rax, %rax
setne %r12b
cmovneq %rax, %r14
jmp 0xd247d
xorl %ebp, %ebp
xorl %r12d, %r12d
jmp 0xd247d
movb $0x1, %r12b
xorl %ebp, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x14e310
movq %rax, %r15
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testb %r12b, %r12b
je 0xd24a3
movq %r15, %rdi
movq %rbx, %rsi
callq 0x16adca
movl %eax, %r14d
movq %r13, %rdi
callq 0x16ac6e
movq 0x10(%rsp), %rdi
callq 0x16ac6e
movq %r15, %rdi
callq 0x16ac6e
movq %rbp, %rdi
callq 0x16ac6e
movq 0x8(%rsp), %rdi
callq 0x1758da
movq (%rsp), %rdi
callq 0x21c4a1
movq 0x18(%rsp), %rdi
callq 0xee90c
movq 0x20(%rsp), %rdi
callq 0xf424d
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x21d65
callq 0x21cf3
callq 0x21d2c
nopl (%rax)