// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_condenseq_hmmsearch.c
// Function: hmmsearch_call_coarse_search
static int hmmsearch_call_coarse_search(GtCondenseq* ces,
                                        char *hmmsearch_path,
                                        char *table_filename,
                                        char *hmm_filename,
                                        unsigned int max_threads,
                                        GtTimer *timer,
                                        GtLogger *logger,
                                        GtError *err) {
  int had_err = 0;
  unsigned int idx = 0;
  char **hmmargs = NULL,
       *hmmenv[] = { NULL };
  const size_t hmmargc = (size_t) 10;  /* max # of args + NULL */
  GtStr *coarse_fas = gt_condenseq_unique_fasta_file(ces),
        *num_threads = gt_str_new();
  GtSafePipe *pipe = NULL;
  gt_assert(coarse_fas != NULL);

  if (timer != NULL)
    gt_timer_show_progress(timer, "run coarse hmmsearch", stderr);

  /* Array has to end with NULL */
  hmmargs = gt_calloc(hmmargc, sizeof (*hmmargs));
  hmmargs[idx++] = hmmsearch_path;
  hmmargs[idx++] = "--noali";
  hmmargs[idx++] = "--notextw";
  hmmargs[idx++] = "--domtblout";
  hmmargs[idx++] = table_filename;
  if (max_threads != GT_UNDEF_UINT) {
    gt_str_append_uint(num_threads, max_threads);
    hmmargs[idx++] = "--cpu";
    hmmargs[idx++] = gt_str_get(num_threads);
  }
  hmmargs[idx++] = hmm_filename;
  hmmargs[idx++] = gt_str_get(coarse_fas);
  gt_assert(hmmargs[idx] == NULL);

  gt_logger_log(logger, "calling: %s", hmmsearch_path);

  pipe = gt_safe_popen(hmmsearch_path, hmmargs, hmmenv, err);

  if (pipe == NULL)
    had_err = -1;

  gt_free(hmmargs);

  gt_str_delete(coarse_fas);
  gt_str_delete(num_threads);

  /* pipe test for splint */
  if (!had_err && pipe != NULL) {
    GtStr *line = gt_str_new();
    /* we have to read everything, as otherwise the pipe will not close */
    while (gt_str_read_next_line(line, pipe->read_fd) == 0) {
      /* gt_log_log("%s", gt_str_get(line)); */
      gt_str_reset(line);
    }
    gt_str_delete(line);
    (void) gt_safe_pclose(pipe);
  }
  return had_err;
}

// Assembly:
subq $0x78, %rsp
movq 0x88(%rsp), %rax
movq 0x80(%rsp), %rax
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movl %r8d, 0x54(%rsp)
movq %r9, 0x48(%rsp)
movl $0x0, 0x44(%rsp)
movl $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x19360
movq $0xa, 0x28(%rsp)
movq 0x70(%rsp), %rdi
callq 0x140370
movq %rax, 0x20(%rsp)
callq 0x11d4a0
movq %rax, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x282d7
movq 0x613cfa(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4edd63(%rip), %rsi    # 0x516013
leaq 0x4f23db(%rip), %rdx    # 0x51a692
leaq 0x4f23e7(%rip), %rcx    # 0x51a6a5
leaq 0x4f2045(%rip), %r8     # 0x51a30a
movl $0x131, %r9d            # imm = 0x131
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x282d9
cmpq $0x0, 0x48(%rsp)
je 0x282fc
movq 0x48(%rsp), %rdi
movq 0x613cb3(%rip), %rax    # 0x63bfa0
movq (%rax), %rdx
leaq 0x4f23cb(%rip), %rsi    # 0x51a6c2
callq 0x121930
movl $0xa, %edi
movl $0x8, %esi
leaq 0x4f1ffd(%rip), %rdx    # 0x51a30a
movl $0x137, %ecx            # imm = 0x137
callq 0xe83c0
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rdx
movq 0x38(%rsp), %rax
movl 0x40(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x40(%rsp)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x38(%rsp), %rax
movl 0x40(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x40(%rsp)
movl %ecx, %ecx
leaq 0x4f2383(%rip), %rdx    # 0x51a6d7
movq %rdx, (%rax,%rcx,8)
movq 0x38(%rsp), %rax
movl 0x40(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x40(%rsp)
movl %ecx, %ecx
leaq 0x4f236c(%rip), %rdx    # 0x51a6df
movq %rdx, (%rax,%rcx,8)
movq 0x38(%rsp), %rax
movl 0x40(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x40(%rsp)
movl %ecx, %ecx
leaq 0x4f2357(%rip), %rdx    # 0x51a6e9
movq %rdx, (%rax,%rcx,8)
movq 0x60(%rsp), %rdx
movq 0x38(%rsp), %rax
movl 0x40(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x40(%rsp)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
cmpl $-0x1, 0x54(%rsp)
je 0x2840c
movq 0x18(%rsp), %rdi
movl 0x54(%rsp), %esi
callq 0x11de00
movq 0x38(%rsp), %rax
movl 0x40(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x40(%rsp)
movl %ecx, %ecx
leaq 0x4f2312(%rip), %rdx    # 0x51a6f5
movq %rdx, (%rax,%rcx,8)
movq 0x18(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdx
movq 0x38(%rsp), %rax
movl 0x40(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x40(%rsp)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x58(%rsp), %rdx
movq 0x38(%rsp), %rax
movl 0x40(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x40(%rsp)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x20(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdx
movq 0x38(%rsp), %rax
movl 0x40(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x40(%rsp)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x38(%rsp), %rax
movl 0x40(%rsp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0x28496
movq 0x613b3b(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4edba4(%rip), %rsi    # 0x516013
leaq 0x4f2285(%rip), %rdx    # 0x51a6fb
leaq 0x4f2228(%rip), %rcx    # 0x51a6a5
leaq 0x4f1e86(%rip), %r8     # 0x51a30a
movl $0x144, %r9d            # imm = 0x144
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x28498
movq 0x80(%rsp), %rdi
movq 0x68(%rsp), %rdx
leaq 0x4f2264(%rip), %rsi    # 0x51a710
movb $0x0, %al
callq 0xe7cd0
movq 0x68(%rsp), %rdi
movq 0x38(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq 0x88(%rsp), %rcx
callq 0x1cd950
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x284e4
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
movq 0x38(%rsp), %rdi
leaq 0x4f1e1a(%rip), %rsi    # 0x51a30a
movl $0x14d, %edx            # imm = 0x14D
callq 0xe88c0
movq 0x20(%rsp), %rdi
callq 0x11f560
movq 0x18(%rsp), %rdi
callq 0x11f560
cmpl $0x0, 0x44(%rsp)
jne 0x2855e
cmpq $0x0, 0x10(%rsp)
je 0x2855e
callq 0x11d4a0
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rax
movq (%rax), %rsi
callq 0x11e3a0
cmpl $0x0, %eax
jne 0x2854a
movq 0x8(%rsp), %rdi
callq 0x11e110
jmp 0x28527
movq 0x8(%rsp), %rdi
callq 0x11f560
movq 0x10(%rsp), %rdi
callq 0x1cdce0
movl 0x44(%rsp), %eax
addq $0x78, %rsp
retq
nopw (%rax,%rax)