// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/tools/gt_condenseq_hmmsearch.c
// Function: hmmsearch_call_fine_search
static int hmmsearch_call_fine_search(GtStr *table_filename,
                                      char *fine_fasta_filename,
                                      char *hmmsearch_path,
                                      char *hmm_filename,
                                      unsigned int max_threads,
                                      GtLogger *logger,
                                      GtError *err) {
  int had_err = 0;
  GtSafePipe *pipe = NULL;
  char **hmmargs = NULL,
       *hmmenv[] = { NULL };
  const size_t hmmargc = (size_t) 8; /* max # of args + NULL */
  unsigned int idx = 0;
  GtStr *num_threads = gt_str_new();

  hmmargs = gt_calloc(hmmargc, sizeof (*hmmargs));
  hmmargs[idx++] = hmmsearch_path;
  if (table_filename != NULL) {
    hmmargs[idx++] = "--tblout";
    hmmargs[idx++] = gt_str_get(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++] = fine_fasta_filename;
  gt_assert(hmmargs[idx] == NULL);

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

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

  gt_free(hmmargs);

  gt_str_delete(num_threads);

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

  if (!had_err) {
    GtStr *line = gt_str_new();
    gt_assert(pipe != NULL); /* shut up splint */
    while (gt_str_read_next_line(line, pipe->read_fd) == 0) {
      printf("%s\n", gt_str_get(line));
      gt_str_reset(line);
    }
    gt_str_delete(line);
    (void) gt_safe_pclose(pipe);
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, (%rsp)
movl %r8d, %r15d
movq %rcx, 0x8(%rsp)
movq %rdx, %r14
movq %rsi, %rbp
movq %rdi, %r13
movq $0x0, 0x10(%rsp)
callq 0x11ac6c
movq %rax, %rbx
leaq 0x2a8e0c(%rip), %rdx    # 0x3492bc
movl $0x8, %edi
movl $0x8, %esi
movl $0xfa, %ecx
callq 0x10436a
movq %rax, %r12
movq %r14, (%rax)
testq %r13, %r13
je 0xa04f0
leaq 0x2a92e0(%rip), %rax    # 0x3497b6
movq %rax, 0x8(%r12)
movq %r13, %rdi
callq 0x11b0a1
movq %rax, 0x10(%r12)
movl $0x3, %r13d
jmp 0xa04f6
movl $0x1, %r13d
cmpl $-0x1, %r15d
je 0xa0526
movq %rbx, %rdi
movl %r15d, %esi
callq 0x11b054
movl %r13d, %r15d
leaq 0x2a9196(%rip), %rax    # 0x3496a7
movq %rax, (%r12,%r15,8)
movq %rbx, %rdi
callq 0x11b0a1
addl $0x2, %r13d
movq %rax, 0x8(%r12,%r15,8)
movl %r13d, %eax
movq 0x8(%rsp), %rcx
movq %rcx, (%r12,%rax,8)
movq %rbp, 0x8(%r12,%rax,8)
cmpq $0x0, 0x10(%r12,%rax,8)
jne 0xa05f4
movq 0x50(%rsp), %r15
leaq 0x2a9173(%rip), %rsi    # 0x3496c2
xorl %ebp, %ebp
movq (%rsp), %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x103fe1
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rcx
callq 0x16fd44
movq %rax, %r14
leaq 0x2a8d40(%rip), %rsi    # 0x3492bc
movq %r12, %rdi
movl $0x10d, %edx            # imm = 0x10D
callq 0x1045eb
movq %rbx, %rdi
callq 0x11bdbf
testq %r14, %r14
je 0xa05dd
callq 0x11ac6c
movq %rax, %rbx
movq (%r14), %rsi
movq %rax, %rdi
callq 0x11b1ff
testl %eax, %eax
jne 0xa05cd
movq %rbx, %rdi
callq 0x11b0a1
movq %rax, %rdi
callq 0x17bd0
movq %rbx, %rdi
callq 0x11b132
movq (%r14), %rsi
movq %rbx, %rdi
jmp 0xa05a4
movq %rbx, %rdi
callq 0x11bdbf
movq %r14, %rdi
callq 0x16ff7f
cmpq $0x1, %r14
sbbl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x19626