// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x10(%rsp)
callq 0xacb84
movq %rax, %rbx
leaq 0x2c78ec(%rip), %rdx    # 0x2e92bc
pushq $0x8
popq %rdi
movq %rdi, %rsi
movl $0xfa, %ecx
callq 0x9334a
movq %rax, %r12
movq %r14, (%rax)
testq %r13, %r13
je 0x21a08
leaq 0x2c7dc4(%rip), %rax    # 0x2e97b6
movq %rax, 0x8(%r12)
movq %r13, %rdi
callq 0xad1fa
movq %rax, 0x10(%r12)
pushq $0x3
jmp 0x21a0a
pushq $0x1
popq %r13
cmpl $-0x1, %r15d
je 0x21a3c
movq %rbx, %rdi
movl %r15d, %esi
callq 0xad151
movl %r13d, %r15d
leaq 0x2c7c80(%rip), %rax    # 0x2e96a7
movq %rax, (%r12,%r15,8)
movq %rbx, %rdi
callq 0xad1fa
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 0x21b04
movq 0x50(%rsp), %r15
leaq 0x2c7c5d(%rip), %rsi    # 0x2e96c2
xorl %ebp, %ebp
movq (%rsp), %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x92e71
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rcx
callq 0x1128cc
movq %rax, %r14
leaq 0x2c782a(%rip), %rsi    # 0x2e92bc
movq %r12, %rdi
movl $0x10d, %edx            # imm = 0x10D
callq 0x936f9
movq %rbx, %rdi
callq 0xae103
testq %r14, %r14
je 0x21aed
callq 0xacb84
movq %rax, %rbx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xad4de
testl %eax, %eax
jne 0x21add
movq %rbx, %rdi
callq 0xad1fa
movq %rax, %rdi
callq 0x17b60
movq %rbx, %rdi
callq 0xad357
jmp 0x21ab4
movq %rbx, %rdi
callq 0xae103
movq %r14, %rdi
callq 0x112afc
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
movq 0x41645d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2c34fe(%rip), %rsi    # 0x2e5013
leaq 0x2c7b91(%rip), %rdx    # 0x2e96ad
leaq 0x2c7c9c(%rip), %rcx    # 0x2e97bf
leaq 0x2c7792(%rip), %r8     # 0x2e92bc
movl $0x107, %r9d            # imm = 0x107
xorl %eax, %eax
callq 0x17a50
callq 0x17390