// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq %rcx, %rbp
testq %r8, %r8
je 0xcfb6a
movq %r14, %rdi
callq 0xfcc32
testb %al, %al
jne 0xcff0b
testq %rbp, %rbp
je 0xcff06
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), %ebx
movups 0x48(%rbp), %xmm1
movq 0x58(%rbp), %r15
subq $0x50, %rsp
movups 0x60(%rbp), %xmm2
movups %xmm2, (%rsp)
movq %r14, 0x48(%rsp)
movq %r15, 0x40(%rsp)
movups %xmm1, 0x30(%rsp)
movl %ebx, 0x28(%rsp)
movl %r11d, 0x20(%rsp)
movl %r10d, 0x18(%rsp)
movl %eax, 0x10(%rsp)
callq 0x1823a3
addq $0x50, %rsp
testq %rax, %rax
je 0xcfc03
movq %rax, %rbx
cmpb $0x0, 0x8c(%rbp)
je 0xcfc0d
movq %rbx, %rdi
callq 0x182655
jmp 0xcfc15
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xcfef5
movq %rbx, %rdi
callq 0x182642
cmpb $0x0, 0x8b(%rbp)
je 0xcfc28
movq %rbx, %rdi
callq 0x18267b
jmp 0xcfc30
movq %rbx, %rdi
callq 0x182668
callq 0xef0cd
movq %rax, %r13
movq (%rbp), %rdi
callq 0x11b0a1
movq %r13, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0xef129
movq %rax, %r12
movq %rax, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x16d72e
testq %rax, %rax
je 0xcff10
movq %rax, %r15
movq 0xa0(%rbp), %rdi
callq 0x11c131
testq %rax, %rax
movq %r12, 0x20(%rsp)
movq %r15, 0x18(%rsp)
je 0xcfd10
movq 0x8(%rbp), %rdi
callq 0x11b0a1
cmpb $0x47, (%rax)
jne 0xcfca6
cmpb $0x41, 0x1(%rax)
jne 0xcfca6
cmpb $0x0, 0x2(%rax)
je 0xcfd01
movq 0x8(%rbp), %rdi
callq 0x11b0a1
cmpb $0x54, (%rax)
jne 0xcfcc0
cmpb $0x43, 0x1(%rax)
jne 0xcfcc0
cmpb $0x0, 0x2(%rax)
je 0xcfd08
movq 0x8(%rbp), %rdi
callq 0x11b0a1
leaq 0x28d8d3(%rip), %rsi    # 0x35d5a3
movq %rax, %rdi
callq 0x17a40
testl %eax, %eax
je 0xcfcfa
leaq 0x28df1d(%rip), %rsi    # 0x35dc00
movq $0x0, (%rsp)
movq %r14, %rdi
xorl %eax, %eax
callq 0xfcb67
jmp 0xcfe6c
movl $0x2, %eax
jmp 0xcfd0a
movl $0x1, %eax
jmp 0xcfd0a
xorl %eax, %eax
movl %eax, 0xa8(%rbp)
movq 0xa0(%rbp), %rdi
callq 0x11c131
testq %rax, %rax
je 0xcfda9
movq 0xa0(%rbp), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x212168
testq %rax, %rax
je 0xcfe64
movsd 0x80(%rbp), %xmm0
movl 0x90(%rbp), %esi
movl 0xa8(%rbp), %edx
movq %rax, (%rsp)
movq %rax, %rdi
movq %r15, %rcx
movq %r14, %r8
callq 0x20c151
testq %rax, %rax
je 0xcfe6c
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1841d5
movq %rax, %r12
leaq 0x28de92(%rip), %rsi    # 0x35dc18
movq %r15, %rdi
callq 0x20c0ed
leaq 0x28dea4(%rip), %rsi    # 0x35dc39
movq %r15, %rdi
callq 0x20c111
movq %r12, 0x8(%rsp)
movq 0x18(%rsp), %r15
jmp 0xcfdbd
movq $0x0, (%rsp)
movq %rbx, %r12
movq $0x0, 0x8(%rsp)
movq %r13, 0x10(%rsp)
movq 0x18(%rbp), %rdi
callq 0x11b0ca
testq %rax, %rax
je 0xcfe86
movq 0x18(%rbp), %rdi
callq 0x11b0a1
subq $0x8, %rsp
leaq 0x28de51(%rip), %r11    # 0x35dc39
movl $0x80000000, %r10d      # imm = 0x80000000
movsd 0x28d792(%rip), %xmm0   # 0x35d588
movsd 0x277f12(%rip), %xmm1   # 0x347d10
movsd 0x28519a(%rip), %xmm3   # 0x354fa0
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
movl $0x1, %ecx
movl $0xc, %r8d
movl $0x80000000, %r9d       # imm = 0x80000000
movaps %xmm1, %xmm2
pushq %r14
pushq %r11
pushq $-0x1
pushq $0x0
pushq $0x0
pushq $0x2
pushq %r10
pushq %r10
pushq %r10
callq 0x20928e
addq $0x50, %rsp
movq %rax, %r13
testq %rax, %rax
cmovneq %rax, %r12
xorl %r15d, %r15d
movq %r12, %rdi
xorl %esi, %esi
callq 0x146fc0
movq %rax, %r12
testq %r13, %r13
jne 0xcfe96
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xcfea6
movq $0x0, (%rsp)
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x146fc0
movq %rax, %r12
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r14d, %r14d
jmp 0xcfeb0
xorl %r13d, %r13d
movq %r12, %rdi
xorl %esi, %esi
callq 0x146fc0
movq %rax, %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x162f5d
movl %eax, %ebp
movq %r13, %r15
movq 0x10(%rsp), %r13
movq 0x8(%rsp), %r14
movq %rbx, %rdi
callq 0x162dee
movq %r14, %rdi
callq 0x162dee
movq %r12, %rdi
callq 0x162dee
movq %r15, %rdi
callq 0x162dee
movq 0x18(%rsp), %rdi
callq 0x16d652
movq (%rsp), %rdi
callq 0x2127a0
movq 0x20(%rsp), %rdi
callq 0xea375
movq %r13, %rdi
callq 0xefbe3
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x218f7
callq 0x21885
callq 0x218be
nopl (%rax)