// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movsd %xmm0, 0x50(%rsp)
movl %esi, 0x4c(%rsp)
movl %edx, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
movq %r8, 0x38(%rsp)
movl $0x0, 0x1c(%rsp)
cmpq $0x0, 0x58(%rsp)
je 0x308209
cmpq $0x0, 0x40(%rsp)
jne 0x308241
movq 0x333d90(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x20ddf9(%rip), %rsi    # 0x516013
leaq 0x28b36a(%rip), %rdx    # 0x59358b
leaq 0x28b371(%rip), %rcx    # 0x593599
leaq 0x28b2ca(%rip), %r8     # 0x5934f9
movl $0x41f, %r9d            # imm = 0x41F
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x308243
leaq 0x28b36d(%rip), %rdi    # 0x5935b7
callq 0x19650
movl %eax, 0x14(%rsp)
cmpl $-0x1, 0x14(%rsp)
jne 0x30827b
movq 0x38(%rsp), %rdi
leaq 0x28b368(%rip), %rsi    # 0x5935ce
movb $0x0, %al
callq 0xd88c0
movq $0x0, 0x60(%rsp)
jmp 0x3084ee
movl 0x14(%rsp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
cmpl $0x0, %eax
je 0x3082ad
movq 0x38(%rsp), %rdi
leaq 0x28b356(%rip), %rsi    # 0x5935ee
movb $0x0, %al
callq 0xd88c0
movq $0x0, 0x60(%rsp)
jmp 0x3084ee
callq 0x307770
movq %rax, %rdi
callq 0x1b22c0
movq %rax, 0x30(%rsp)
callq 0x307770
movq %rax, %rdi
movq 0x30(%rsp), %rsi
callq 0x1b2350
movq %rax, 0x28(%rsp)
movsd 0x50(%rsp), %xmm0
movq 0x28(%rsp), %rax
movsd %xmm0, 0x20(%rax)
movl 0x48(%rsp), %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x78(%rax)
movl 0x4c(%rsp), %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x60(%rax)
movq 0x40(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x28(%rsp), %rax
movb $0x0, 0x90(%rax)
leaq 0x257de0(%rip), %rdi    # 0x5600ff
callq 0x11d510
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x88(%rax)
leaq 0x25f202(%rip), %rdi    # 0x56753c
callq 0x120930
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0xa0(%rax)
movl $0x0, 0x18(%rsp)
cmpl $0x3, 0x18(%rsp)
jge 0x308398
callq 0x11d4a0
movq %rax, %rdx
movq 0x28(%rsp), %rax
movslq 0x18(%rsp), %rcx
movq %rdx, 0x30(%rax,%rcx,8)
callq 0x11d4a0
movq %rax, %rdx
movq 0x28(%rsp), %rax
movslq 0x18(%rsp), %rcx
movq %rdx, 0x48(%rax,%rcx,8)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x308356
cmpl $0x0, 0x1c(%rsp)
jne 0x3084e4
leaq 0x28b26f(%rip), %rdi    # 0x593619
callq 0x11d510
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x334fb8(%rip), %rax    # 0x63d378
movl (%rax), %esi
callq 0x11de00
movq 0x20(%rsp), %rdi
leaq 0x28d0ac(%rip), %rsi    # 0x59547f
callq 0x11d550
movl 0x48(%rsp), %eax
movl %eax, 0x10(%rsp)
testl %eax, %eax
je 0x30840f
jmp 0x3083e6
movl 0x10(%rsp), %eax
subl $0x1, %eax
je 0x3083fc
jmp 0x3083f1
movl 0x10(%rsp), %eax
subl $0x2, %eax
je 0x308422
jmp 0x308448
movq 0x20(%rsp), %rdi
leaq 0x28b220(%rip), %rsi    # 0x593628
callq 0x11d550
jmp 0x308448
movq 0x20(%rsp), %rdi
leaq 0x28b216(%rip), %rsi    # 0x593631
callq 0x11d550
jmp 0x308448
movq 0x20(%rsp), %rdi
leaq 0x28b20c(%rip), %rsi    # 0x59363a
callq 0x11d550
movq 0x20(%rsp), %rdi
movsd 0x50(%rsp), %xmm0
movl $0x32, %esi
callq 0x11dc30
movq 0x20(%rsp), %rdi
leaq 0x28d02b(%rip), %rsi    # 0x59547f
callq 0x11d550
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rdi
callq 0x314e80
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x11d550
movq 0x20(%rsp), %rdi
leaq 0x2419ff(%rip), %rsi    # 0x549e85
callq 0x11d550
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x80(%rax)
movq 0x28(%rsp), %rax
movq 0x80(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movl $0x20, %esi
callq 0xa2b40
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x98(%rax)
movq 0x20(%rsp), %rdi
callq 0x11dee0
movq %rax, %rsi
leaq 0x28b165(%rip), %rdi    # 0x593642
movb $0x0, %al
callq 0xe7740
movq 0x30(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
addq $0x68, %rsp
retq
nopl (%rax,%rax)