// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/ltr/ltrdigest_pdom_visitor.c
// Function: gt_ltrdigest_pdom_visitor_new
GtNodeVisitor* gt_ltrdigest_pdom_visitor_new(GtPdomModelSet *model,
                                             double eval_cutoff,
                                             unsigned int chain_max_gap_length,
                                             GtPdomCutoff cutoff,
                                             GtRegionMapping *rmap,
                                             GtError *err)
{
  GtNodeVisitor *nv;
  GtLTRdigestPdomVisitor *lv;
  GtStr *cmd;
  int had_err = 0, i, rval;
  gt_assert(model && rmap);

  rval = system("hmmscan -h > /dev/null");
  if (rval == -1) {
    gt_error_set(err, "error executing system(hmmscan)");
    return NULL;
  }
#ifndef _WIN32
  if (WEXITSTATUS(rval) != 0) {
    gt_error_set(err, "cannot find the hmmscan executable in PATH");
    return NULL;
  }
#else
  /* XXX */
  gt_error_set(err, "hmmscan for Windows not implemented");
  return NULL;
#endif

  nv = gt_node_visitor_create(gt_ltrdigest_pdom_visitor_class());
  lv = gt_ltrdigest_pdom_visitor_cast(nv);
  lv->eval_cutoff = eval_cutoff;
  lv->cutoff = cutoff;
  lv->chain_max_gap_length = chain_max_gap_length;
  lv->rmap = rmap;
  lv->output_all_chains = false;
  lv->tag = gt_str_new_cstr("GenomeTools");
  lv->root_type = gt_symbol(gt_ft_LTR_retrotransposon);

  for (i = 0; i < 3; i++) {
    lv->fwd[i] = gt_str_new();
    lv->rev[i] = gt_str_new();
  }

  if (!had_err) {
    cmd = gt_str_new_cstr("hmmscan --cpu ");
    gt_str_append_uint(cmd, gt_jobs);
    gt_str_append_cstr(cmd, " ");
    switch (cutoff) {
      case GT_PHMM_CUTOFF_GA:
        gt_str_append_cstr(cmd, "--cut_ga");
        break;
      case GT_PHMM_CUTOFF_TC:
        gt_str_append_cstr(cmd, "--cut_tc");
        break;
      case GT_PHMM_CUTOFF_NONE:
        gt_str_append_cstr(cmd, "--domE ");
        gt_str_append_double(cmd, eval_cutoff, 50);
        break;
    }
    gt_str_append_cstr(cmd, " ");
    gt_str_append_cstr(cmd, gt_pdom_model_set_get_filename(model));
    gt_str_append_cstr(cmd, " -"); /* stdin */
    lv->cmdline = cmd;
    lv->args = gt_cstr_split(gt_str_get(lv->cmdline), ' ');
    gt_log_log("HMMER cmdline: %s", gt_str_get(cmd));
  }
  return nv;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movsd %xmm0, (%rsp)
testq %rdi, %rdi
je 0x20c336
movq %rcx, %r12
testq %rcx, %rcx
je 0x20c336
movq %r8, %r15
movl %edx, %ebp
movl %esi, %r13d
movq %rdi, %r14
leaq 0x1b4202(%rip), %rdi    # 0x3c038a
callq 0x176a0
cmpl $-0x1, %eax
je 0x20c1a2
testl $0xff00, %eax           # imm = 0xFF00
je 0x20c1ba
leaq 0x1b4221(%rip), %rsi    # 0x3c03c1
jmp 0x20c1a9
leaq 0x1b41f8(%rip), %rsi    # 0x3c03a1
xorl %ebx, %ebx
movq %r15, %rdi
xorl %eax, %eax
callq 0xfcb67
jmp 0x20c324
callq 0x20ba30
movq %rax, %rdi
callq 0x163080
movq %rax, %rbx
callq 0x20ba30
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1630b1
movq %rax, %r15
movsd (%rsp), %xmm0
movsd %xmm0, 0x20(%rax)
movl %ebp, 0x78(%rax)
movl %r13d, 0x60(%rax)
movq %r12, 0x18(%rax)
movb $0x0, 0x90(%rax)
leaq 0x1816b3(%rip), %rdi    # 0x38d8b3
callq 0x11acc9
movq %rax, 0x88(%r15)
leaq 0x1889a4(%rip), %rdi    # 0x394bb7
callq 0x11c5ff
movq %rax, 0xa0(%r15)
movq $-0x3, %r12
callq 0x11ac6c
movq %rax, 0x48(%r15,%r12,8)
callq 0x11ac6c
movq %rax, 0x60(%r15,%r12,8)
incq %r12
jne 0x20c226
leaq 0x1b41a6(%rip), %rdi    # 0x3c03ec
callq 0x11acc9
movq %rax, %r12
leaq 0x2adbc3(%rip), %rax    # 0x4b9e18
movl (%rax), %esi
movq %r12, %rdi
callq 0x11b054
leaq 0x1b5eba(%rip), %rsi    # 0x3c2120
movq %r12, %rdi
callq 0x11acf3
testl %ebp, %ebp
je 0x20c2a8
cmpl $0x2, %ebp
je 0x20c285
cmpl $0x1, %ebp
jne 0x20c2b7
leaq 0x1b4178(%rip), %rsi    # 0x3c03fb
jmp 0x20c2af
leaq 0x1b4181(%rip), %rsi    # 0x3c040d
movq %r12, %rdi
callq 0x11acf3
movq %r12, %rdi
movsd (%rsp), %xmm0
movl $0x32, %esi
callq 0x11afba
jmp 0x20c2b7
leaq 0x1b4155(%rip), %rsi    # 0x3c0404
movq %r12, %rdi
callq 0x11acf3
leaq 0x1b5e62(%rip), %rsi    # 0x3c2120
movq %r12, %rdi
callq 0x11acf3
movq %r14, %rdi
callq 0x2127c7
movq %r12, %rdi
movq %rax, %rsi
callq 0x11acf3
leaq 0x16b8e1(%rip), %rsi    # 0x377bc1
movq %r12, %rdi
callq 0x11acf3
movq %r12, 0x80(%r15)
movq %r12, %rdi
callq 0x11b0a1
movq %rax, %rdi
movl $0x20, %esi
callq 0xe4168
movq %rax, 0x98(%r15)
movq %r12, %rdi
callq 0x11b0a1
leaq 0x1b40fb(%rip), %rdi    # 0x3c0415
movq %rax, %rsi
xorl %eax, %eax
callq 0x103d72
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x80f06