// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x78, %rsp
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)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x19360
movq $0x8, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
callq 0x11d4a0
movq %rax, 0x10(%rsp)
movl $0x8, %esi
leaq 0x4f125e(%rip), %rdx    # 0x51a30a
movl $0xfa, %ecx
movq %rsi, %rdi
callq 0xe83c0
movq %rax, 0x30(%rsp)
movq 0x60(%rsp), %rdx
movq 0x30(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x1c(%rsp)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
cmpq $0x0, 0x70(%rsp)
je 0x29127
movq 0x30(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x1c(%rsp)
movl %ecx, %ecx
leaq 0x4f1706(%rip), %rdx    # 0x51a804
movq %rdx, (%rax,%rcx,8)
movq 0x70(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdx
movq 0x30(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x1c(%rsp)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
cmpl $-0x1, 0x54(%rsp)
je 0x29180
movq 0x10(%rsp), %rdi
movl 0x54(%rsp), %esi
callq 0x11de00
movq 0x30(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x1c(%rsp)
movl %ecx, %ecx
leaq 0x4f159e(%rip), %rdx    # 0x51a6f5
movq %rdx, (%rax,%rcx,8)
movq 0x10(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdx
movq 0x30(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x1c(%rsp)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x58(%rsp), %rdx
movq 0x30(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x1c(%rsp)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x68(%rsp), %rdx
movq 0x30(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x1c(%rsp)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x30(%rsp), %rax
movl 0x1c(%rsp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0x29202
movq 0x612dcf(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4ece38(%rip), %rsi    # 0x516013
leaq 0x4f1519(%rip), %rdx    # 0x51a6fb
leaq 0x4f1624(%rip), %rcx    # 0x51a80d
leaq 0x4f111a(%rip), %r8     # 0x51a30a
movl $0x107, %r9d            # imm = 0x107
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x29204
movq 0x48(%rsp), %rdi
movq 0x60(%rsp), %rdx
leaq 0x4f14fb(%rip), %rsi    # 0x51a710
movb $0x0, %al
callq 0xe7cd0
movq 0x60(%rsp), %rdi
movq 0x30(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq 0x80(%rsp), %rcx
callq 0x1cd950
movq %rax, 0x38(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x4f10c1(%rip), %rsi    # 0x51a30a
movl $0x10d, %edx            # imm = 0x10D
callq 0xe88c0
movq 0x10(%rsp), %rdi
callq 0x11f560
cmpq $0x0, 0x38(%rsp)
jne 0x2926d
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x44(%rsp)
jne 0x29318
callq 0x11d4a0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0x292c2
movq 0x612d0f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4ecd78(%rip), %rsi    # 0x516013
leaq 0x4f1586(%rip), %rdx    # 0x51a828
leaq 0x4f1564(%rip), %rcx    # 0x51a80d
leaq 0x4f105a(%rip), %r8     # 0x51a30a
movl $0x116, %r9d            # imm = 0x116
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x292c4
jmp 0x292c6
movq 0x8(%rsp), %rdi
movq 0x38(%rsp), %rax
movq (%rax), %rsi
callq 0x11e3a0
cmpl $0x0, %eax
jne 0x29304
movq 0x8(%rsp), %rdi
callq 0x11dee0
movq %rax, %rsi
leaq 0x4fdbfb(%rip), %rdi    # 0x526eec
movb $0x0, %al
callq 0x19070
movq 0x8(%rsp), %rdi
callq 0x11e110
jmp 0x292c6
movq 0x8(%rsp), %rdi
callq 0x11f560
movq 0x38(%rsp), %rdi
callq 0x1cdce0
movl 0x44(%rsp), %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)