// File: /workspace/github_c_makefile_star2_O0/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 $0xf8, %rsp
movl %edi, 0xf0(%rsp)
movq %rsi, 0xe8(%rsp)
movl %edx, 0xe4(%rsp)
movq %rcx, 0xd8(%rsp)
movq %r8, 0xd0(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq $0x0, 0xc0(%rsp)
movq $0x0, 0xb8(%rsp)
movq $0x0, 0xb0(%rsp)
movq $0x0, 0xa8(%rsp)
movq $0x0, 0xa0(%rsp)
movq $0x0, 0x98(%rsp)
movq $0x0, 0x90(%rsp)
movl $0x0, 0x8c(%rsp)
cmpq $0x0, 0xd0(%rsp)
je 0x7c01c
movq 0xd0(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x7bfe4
jmp 0x7c01c
movq 0x5bffb5(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x49a01e(%rip), %rsi    # 0x516013
leaq 0x49a1c3(%rip), %rdx    # 0x5161bf
leaq 0x4b2d7f(%rip), %rcx    # 0x52ed82
leaq 0x4b2716(%rip), %r8     # 0x52e720
movl $0x186, %r9d            # imm = 0x186
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x7c01e
jmp 0x7c020
cmpq $0x0, 0xc8(%rsp)
jne 0x7c063
movq 0x5bff6e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x499fd7(%rip), %rsi    # 0x516013
leaq 0x4feb1c(%rip), %rdx    # 0x57ab5f
leaq 0x4b2d38(%rip), %rcx    # 0x52ed82
leaq 0x4b26cf(%rip), %r8     # 0x52e720
movl $0x187, %r9d            # imm = 0x187
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x7c065
movq 0xc8(%rsp), %rax
movq (%rax), %rdi
movq 0xc8(%rsp), %rax
movq 0x20(%rax), %rsi
movq 0xc8(%rsp), %rax
movq 0x28(%rax), %rdx
movq 0xc8(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0xc8(%rsp), %rax
movq 0x38(%rax), %r8
movq 0xc8(%rsp), %rax
movq 0x40(%rax), %r9
movq 0xc8(%rsp), %r13
addq $0x60, %r13
movq 0xc8(%rsp), %rax
movl 0x70(%rax), %r12d
movq 0xc8(%rsp), %rax
movsd 0x78(%rax), %xmm0
movq 0xc8(%rsp), %rax
movb 0x88(%rax), %r15b
movq 0xc8(%rsp), %rax
movb 0x8a(%rax), %r14b
movq 0xc8(%rsp), %rax
movb 0x89(%rax), %bpl
movq 0xc8(%rsp), %rax
movq 0x48(%rax), %rbx
movq 0xc8(%rsp), %rax
movq 0x50(%rax), %r11
movq 0xc8(%rsp), %rax
movq 0x58(%rax), %r10
movq 0xd0(%rsp), %rax
movq %rax, 0x68(%rsp)
andb $0x1, %r15b
andb $0x1, %r14b
andb $0x1, %bpl
movq (%r13), %rax
movq %rax, (%rsp)
movq 0x68(%rsp), %rax
movq 0x8(%r13), %r13
movq %r13, 0x8(%rsp)
movl %r12d, 0x10(%rsp)
movzbl %r15b, %r15d
movl %r15d, 0x18(%rsp)
movzbl %r14b, %r14d
movl %r14d, 0x20(%rsp)
movzbl %bpl, %ebp
movl %ebp, 0x28(%rsp)
movq %rbx, 0x30(%rsp)
movq %r11, 0x38(%rsp)
movq %r10, 0x40(%rsp)
movq %rax, 0x48(%rsp)
callq 0x1f0490
movq %rax, 0xc0(%rsp)
cmpq $0x0, 0xc0(%rsp)
jne 0x7c1ac
movl $0xffffffff, 0xf4(%rsp) # imm = 0xFFFFFFFF
jmp 0x7c6ac
movq 0xc0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xc8(%rsp), %rax
testb $0x1, 0x8c(%rax)
jne 0x7c1dc
movq 0xc0(%rsp), %rdi
callq 0x1f0920
jmp 0x7c1e9
movq 0xc0(%rsp), %rdi
callq 0x1f0980
movq 0xc8(%rsp), %rax
testb $0x1, 0x8b(%rax)
jne 0x7c209
movq 0xc0(%rsp), %rdi
callq 0x1f09e0
jmp 0x7c216
movq 0xc0(%rsp), %rdi
callq 0x1f0a40
callq 0xb7a40
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0xc8(%rsp), %rax
movq (%rax), %rdi
callq 0x11dee0
movq 0x60(%rsp), %rdi
movq %rax, %rsi
movq 0xd0(%rsp), %rdx
callq 0xb7aa0
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x1c7d90
movq %rax, 0x90(%rsp)
cmpq $0x0, 0x90(%rsp)
jne 0x7c2b6
movq 0x5bfd1b(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x499d84(%rip), %rsi    # 0x516013
leaq 0x5172fe(%rip), %rdx    # 0x593594
leaq 0x4b2ae5(%rip), %rcx    # 0x52ed82
leaq 0x4b247c(%rip), %r8     # 0x52e720
movl $0x1ad, %r9d            # imm = 0x1AD
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x7c2b8
cmpl $0x0, 0x8c(%rsp)
jne 0x7c3b9
movq 0xc8(%rsp), %rax
movq 0xa0(%rax), %rdi
callq 0x11fcc0
cmpq $0x0, %rax
jbe 0x7c3b9
movq 0xc8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
leaq 0x4b7578(%rip), %rsi    # 0x533877
callq 0x19980
cmpl $0x0, %eax
jne 0x7c320
movq 0xc8(%rsp), %rax
movl $0x1, 0xa8(%rax)
jmp 0x7c3b7
movq 0xc8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
leaq 0x4b23fd(%rip), %rsi    # 0x52e738
callq 0x19980
cmpl $0x0, %eax
jne 0x7c359
movq 0xc8(%rsp), %rax
movl $0x0, 0xa8(%rax)
jmp 0x7c3b5
movq 0xc8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
leaq 0x4b23bf(%rip), %rsi    # 0x52e733
callq 0x19980
cmpl $0x0, %eax
jne 0x7c392
movq 0xc8(%rsp), %rax
movl $0x2, 0xa8(%rax)
jmp 0x7c3b3
movq 0xd0(%rsp), %rdi
leaq 0x4b29ef(%rip), %rsi    # 0x52ed90
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x7c3b5
jmp 0x7c3b7
jmp 0x7c3b9
cmpl $0x0, 0x8c(%rsp)
jne 0x7c4d8
movq 0xc8(%rsp), %rax
movq 0xa0(%rax), %rdi
callq 0x11fcc0
cmpq $0x0, %rax
jbe 0x7c4d8
movq 0xc8(%rsp), %rax
movq 0xa0(%rax), %rdi
movq 0xd0(%rsp), %rdx
xorl %esi, %esi
callq 0x3143c0
movq %rax, 0x98(%rsp)
cmpq $0x0, 0x98(%rsp)
je 0x7c4cb
movq 0x98(%rsp), %rdi
movq 0xc8(%rsp), %rax
movsd 0x80(%rax), %xmm0
movq 0xc8(%rsp), %rax
movl 0x90(%rax), %esi
movq 0xc8(%rsp), %rax
movl 0xa8(%rax), %edx
movq 0x90(%rsp), %rcx
movq 0xd0(%rsp), %r8
callq 0x3081d0
movq %rax, 0x70(%rsp)
cmpq $0x0, 0x70(%rsp)
jne 0x7c47b
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x8c(%rsp)
jne 0x7c4c9
movq 0xa0(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x1f6b70
movq %rax, 0xb8(%rsp)
movq %rax, 0xa0(%rsp)
movq 0x70(%rsp), %rdi
leaq 0x4b28f5(%rip), %rsi    # 0x52eda8
callq 0x3080b0
movq 0x70(%rsp), %rdi
leaq 0x4b2905(%rip), %rsi    # 0x52edc9
callq 0x308130
jmp 0x7c4d6
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x7c4d8
cmpl $0x0, 0x8c(%rsp)
jne 0x7c5ea
movq 0xc8(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x11dfa0
cmpq $0x0, %rax
jbe 0x7c5ea
movq 0xa0(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0xc8(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x11dee0
movq 0x58(%rsp), %rdi
movq %rax, %rsi
movq 0x90(%rsp), %rdx
movq 0xd0(%rsp), %rax
movsd 0x4b21d9(%rip), %xmm0   # 0x52e718
movl $0x1, %ecx
movl $0xc, %r8d
movl $0x80000000, %r9d       # imm = 0x80000000
movsd 0x49c7f8(%rip), %xmm2   # 0x518d50
xorl %r10d, %r10d
xorl %r10d, %r10d
movsd 0x4a9b1a(%rip), %xmm3   # 0x526080
leaq 0x4b285c(%rip), %r10    # 0x52edc9
movl $0x80000000, (%rsp)     # imm = 0x80000000
movl $0x80000000, 0x8(%rsp)  # imm = 0x80000000
movl $0x80000000, 0x10(%rsp) # imm = 0x80000000
movl $0x2, 0x18(%rsp)
movaps %xmm2, %xmm1
movq $0x0, 0x20(%rsp)
movl $0x0, 0x28(%rsp)
movq $-0x1, 0x30(%rsp)
movq %r10, 0x38(%rsp)
movq %rax, 0x40(%rsp)
callq 0x301350
movq %rax, 0xa8(%rsp)
cmpq $0x0, 0xa8(%rsp)
jne 0x7c5d8
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x7c5e8
movq 0xa8(%rsp), %rax
movq %rax, 0xa0(%rsp)
jmp 0x7c5ea
movq 0xa0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x176d50
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
cmpl $0x0, 0x8c(%rsp)
jne 0x7c639
movq 0xa0(%rsp), %rdi
movq 0xd0(%rsp), %rsi
callq 0x1b1f90
movl %eax, 0x8c(%rsp)
movq 0xc0(%rsp), %rdi
callq 0x1b1cb0
movq 0xb8(%rsp), %rdi
callq 0x1b1cb0
movq 0xb0(%rsp), %rdi
callq 0x1b1cb0
movq 0xa8(%rsp), %rdi
callq 0x1b1cb0
movq 0x90(%rsp), %rdi
callq 0x1c7bd0
movq 0x98(%rsp), %rdi
callq 0x314e40
movq 0x78(%rsp), %rdi
callq 0xae070
movq 0x80(%rsp), %rdi
callq 0xb7e50
movl 0x8c(%rsp), %eax
movl %eax, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop