// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/ltr/ltr_refseq_match_stream.c
// Function: gt_ltr_refseq_match_stream_refseq_match
static int gt_ltr_refseq_match_stream_refseq_match(GtLTRRefseqMatchStream *rms,
                                                   GtError *err)
{
  GtMatchIterator *mi = NULL;
  GtMatch *match = NULL;
  FILE *makeblastdb_output = NULL;
  GtMatchIteratorStatus status;
  char makeblastdb_call[BUFSIZ],
       *env = NULL;
  int had_err = 0;

  gt_assert(rms);
  gt_error_check(err);
  env = getenv(GT_BLAST_PATH_ENV);
  if (env != NULL)
    (void) snprintf(makeblastdb_call, BUFSIZ,
                    "%s/makeblastdb -in %s -dbtype nucl -logfile /dev/null",
                    env, rms->refseq_file);
  else
    (void) snprintf(makeblastdb_call, BUFSIZ,
                    "makeblastdb -in %s -dbtype nucl -logfile /dev/null",
                    rms->refseq_file);
  makeblastdb_output = popen(makeblastdb_call, "r");
  if (!makeblastdb_output)
    had_err = -1;
  else {
    while (fgetc(makeblastdb_output) != EOF);
    pclose(makeblastdb_output);
  }
  if (!had_err) {
    GtBlastProcessCall *call = gt_blast_process_call_new_nucl();
    char buffer[BUFSIZ];

    gt_blast_process_call_set_query(call, rms->seq_file);
    gt_blast_process_call_set_db(call, rms->refseq_file);
    if (rms->evalue != GT_UNDEF_DOUBLE)
      gt_blast_process_call_set_evalue(call, rms->evalue);
    if (rms->dust)
      gt_blast_process_call_set_opt(call, " -dust yes");
    if (rms->word_size != GT_UNDEF_INT)
      gt_blast_process_call_set_wordsize(call, rms->word_size);
    if (rms->gapopen != GT_UNDEF_INT)
      gt_blast_process_call_set_gapopen(call, rms->gapopen);
    if (rms->gapextend != GT_UNDEF_INT)
      gt_blast_process_call_set_gapextend(call, rms->gapextend);
    if (rms->penalty != GT_UNDEF_INT)
      gt_blast_process_call_set_penalty(call, rms->penalty);
    if (rms->reward != GT_UNDEF_INT)
      gt_blast_process_call_set_reward(call, rms->reward);
    if (rms->identity != GT_UNDEF_DOUBLE) {
      GT_UNUSED int ret;
      ret = snprintf(buffer,
                     BUFSIZ, " -perc_identity %.2f", rms->identity);
      gt_assert((size_t) ret < BUFSIZ);
      gt_blast_process_call_set_opt(call, buffer);
    }
    if (rms->num_threads != GT_UNDEF_INT)
      gt_blast_process_call_set_num_threads(call, rms->num_threads);
    if (rms->xdrop != GT_UNDEF_DOUBLE)
      gt_blast_process_call_set_xdrop_gap_final(call, rms->xdrop);
    if (rms->moreblast != NULL) {
      GT_UNUSED int ret;
      ret = snprintf(buffer, BUFSIZ, " %s", rms->moreblast);
      gt_assert((size_t) ret < BUFSIZ);
      gt_blast_process_call_set_opt(call, buffer);
    }
    mi = gt_match_iterator_blast_process_new(call, err);
    if (mi != NULL) {
      if ((status = gt_match_iterator_next(mi, &match, err))
           != GT_MATCHER_STATUS_OK) {
          gt_error_set(err, "Could not run BLASTN.");
          had_err = -1;
      } else {
          gt_ltr_refseq_match_stream_add_match_to_fn(rms, match, err);
          while (!had_err && (status = gt_match_iterator_next(mi, &match, err))
                 != GT_MATCHER_STATUS_END) {
            if (status == GT_MATCHER_STATUS_OK) {
              gt_ltr_refseq_match_stream_add_match_to_fn(rms, match, err);
            } else
              had_err = -1;
          }
      }
    } else
      had_err = -1;
  } else
    gt_error_set(err, "Could not run makeblastdb.");

  return had_err;
}

// Assembly:
subq $0x4068, %rsp           # imm = 0x4068
movq %rdi, 0x4060(%rsp)
movq %rsi, 0x4058(%rsp)
movq $0x0, 0x4050(%rsp)
movq $0x0, 0x4048(%rsp)
movq $0x0, 0x4040(%rsp)
movq $0x0, 0x2028(%rsp)
movl $0x0, 0x2024(%rsp)
cmpq $0x0, 0x4060(%rsp)
jne 0x301c45
movq 0x33a38c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2143f5(%rip), %rsi    # 0x516013
leaq 0x2ab849(%rip), %rdx    # 0x5ad46e
leaq 0x290d93(%rip), %rcx    # 0x5929bf
leaq 0x290d28(%rip), %r8     # 0x59295b
movl $0x116, %r9d            # imm = 0x116
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x301c47
jmp 0x301c49
cmpq $0x0, 0x4058(%rsp)
je 0x301c9f
movq 0x4058(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x301c67
jmp 0x301c9f
movq 0x33a332(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x21439b(%rip), %rsi    # 0x516013
leaq 0x214540(%rip), %rdx    # 0x5161bf
leaq 0x290d39(%rip), %rcx    # 0x5929bf
leaq 0x290cce(%rip), %r8     # 0x59295b
movl $0x117, %r9d            # imm = 0x117
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x301ca1
leaq 0x248628(%rip), %rdi    # 0x54a2d0
callq 0x198a0
movq %rax, 0x2028(%rsp)
cmpq $0x0, 0x2028(%rsp)
je 0x301cf1
leaq 0x2030(%rsp), %rdi
movq 0x2028(%rsp), %rcx
movq 0x4060(%rsp), %rax
movq 0x30(%rax), %r8
movl $0x2000, %esi           # imm = 0x2000
leaq 0x290cff(%rip), %rdx    # 0x5929e7
movb $0x0, %al
callq 0x19b90
jmp 0x301d18
leaq 0x2030(%rsp), %rdi
movq 0x4060(%rsp), %rax
movq 0x30(%rax), %rcx
movl $0x2000, %esi           # imm = 0x2000
leaq 0x290cd9(%rip), %rdx    # 0x5929ea
movb $0x0, %al
callq 0x19b90
leaq 0x2030(%rsp), %rdi
leaq 0x22a2b3(%rip), %rsi    # 0x52bfda
callq 0x191d0
movq %rax, 0x4040(%rsp)
cmpq $0x0, 0x4040(%rsp)
jne 0x301d4c
movl $0xffffffff, 0x2024(%rsp) # imm = 0xFFFFFFFF
jmp 0x301d6f
jmp 0x301d4e
movq 0x4040(%rsp), %rdi
callq 0x19b50
cmpl $-0x1, %eax
je 0x301d62
jmp 0x301d4e
movq 0x4040(%rsp), %rdi
callq 0x199b0
cmpl $0x0, 0x2024(%rsp)
jne 0x3021bd
callq 0x136fc0
movq %rax, 0x2018(%rsp)
movq 0x2018(%rsp), %rdi
movq 0x4060(%rsp), %rax
movq 0x38(%rax), %rsi
callq 0x137080
movq 0x2018(%rsp), %rdi
movq 0x4060(%rsp), %rax
movq 0x30(%rax), %rsi
callq 0x137130
movq 0x4060(%rsp), %rax
movsd 0x80(%rax), %xmm0
movsd 0x216f7c(%rip), %xmm1   # 0x518d50
ucomisd %xmm1, %xmm0
jne 0x301dde
jp 0x301dde
jmp 0x301dfb
movq 0x2018(%rsp), %rdi
movq 0x4060(%rsp), %rax
movsd 0x80(%rax), %xmm0
callq 0x1371e0
movq 0x4060(%rsp), %rax
testb $0x1, 0x61(%rax)
je 0x301e1d
movq 0x2018(%rsp), %rdi
leaq 0x25796e(%rip), %rsi    # 0x559786
callq 0x137970
movq 0x4060(%rsp), %rax
cmpl $0x80000000, 0x64(%rax) # imm = 0x80000000
je 0x301e46
movq 0x2018(%rsp), %rdi
movq 0x4060(%rsp), %rax
movl 0x64(%rax), %esi
callq 0x137290
movq 0x4060(%rsp), %rax
cmpl $0x80000000, 0x68(%rax) # imm = 0x80000000
je 0x301e6f
movq 0x2018(%rsp), %rdi
movq 0x4060(%rsp), %rax
movl 0x68(%rax), %esi
callq 0x137340
movq 0x4060(%rsp), %rax
cmpl $0x80000000, 0x6c(%rax) # imm = 0x80000000
je 0x301e98
movq 0x2018(%rsp), %rdi
movq 0x4060(%rsp), %rax
movl 0x6c(%rax), %esi
callq 0x1373f0
movq 0x4060(%rsp), %rax
cmpl $0x80000000, 0x70(%rax) # imm = 0x80000000
je 0x301ec1
movq 0x2018(%rsp), %rdi
movq 0x4060(%rsp), %rax
movl 0x70(%rax), %esi
callq 0x1374a0
movq 0x4060(%rsp), %rax
cmpl $0x80000000, 0x74(%rax) # imm = 0x80000000
je 0x301eea
movq 0x2018(%rsp), %rdi
movq 0x4060(%rsp), %rax
movl 0x74(%rax), %esi
callq 0x137590
movq 0x4060(%rsp), %rax
movsd 0x90(%rax), %xmm0
movsd 0x216e4e(%rip), %xmm1   # 0x518d50
ucomisd %xmm1, %xmm0
jne 0x301f0f
jp 0x301f0f
jmp 0x301f94
leaq 0x10(%rsp), %rdi
movq 0x4060(%rsp), %rax
movsd 0x90(%rax), %xmm0
movl $0x2000, %esi           # imm = 0x2000
leaq 0x257861(%rip), %rdx    # 0x559791
movb $0x1, %al
callq 0x19b90
movl %eax, 0xc(%rsp)
movslq 0xc(%rsp), %rax
cmpq $0x2000, %rax           # imm = 0x2000
jb 0x301f80
movq 0x33a051(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2140ba(%rip), %rsi    # 0x516013
leaq 0x2577e8(%rip), %rdx    # 0x559748
leaq 0x290a58(%rip), %rcx    # 0x5929bf
leaq 0x2909ed(%rip), %r8     # 0x59295b
movl $0x140, %r9d            # imm = 0x140
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x301f82
movq 0x2018(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x137970
movq 0x4060(%rsp), %rax
cmpl $0x80000000, 0x78(%rax) # imm = 0x80000000
je 0x301fbd
movq 0x2018(%rsp), %rdi
movq 0x4060(%rsp), %rax
movl 0x78(%rax), %esi
callq 0x137680
movq 0x4060(%rsp), %rax
movsd 0x88(%rax), %xmm0
movsd 0x216d7b(%rip), %xmm1   # 0x518d50
ucomisd %xmm1, %xmm0
jne 0x301fdf
jp 0x301fdf
jmp 0x301ffc
movq 0x2018(%rsp), %rdi
movq 0x4060(%rsp), %rax
movsd 0x88(%rax), %xmm0
callq 0x137730
movq 0x4060(%rsp), %rax
cmpq $0x0, 0xa0(%rax)
je 0x302096
leaq 0x10(%rsp), %rdi
movq 0x4060(%rsp), %rax
movq 0xa0(%rax), %rcx
movl $0x2000, %esi           # imm = 0x2000
leaq 0x27ba99(%rip), %rdx    # 0x57dacb
movb $0x0, %al
callq 0x19b90
movl %eax, 0x8(%rsp)
movslq 0x8(%rsp), %rax
cmpq $0x2000, %rax           # imm = 0x2000
jb 0x302082
movq 0x339f4f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x213fb8(%rip), %rsi    # 0x516013
leaq 0x2576e6(%rip), %rdx    # 0x559748
leaq 0x290956(%rip), %rcx    # 0x5929bf
leaq 0x2908eb(%rip), %r8     # 0x59295b
movl $0x14a, %r9d            # imm = 0x14A
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x302084
movq 0x2018(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x137970
movq 0x2018(%rsp), %rdi
movq 0x4058(%rsp), %rsi
callq 0x1a7cc0
movq %rax, 0x4050(%rsp)
cmpq $0x0, 0x4050(%rsp)
je 0x3021b0
movq 0x4050(%rsp), %rdi
movq 0x4058(%rsp), %rdx
leaq 0x4048(%rsp), %rsi
callq 0x1a7950
movl %eax, 0x403c(%rsp)
cmpl $0x0, %eax
je 0x302111
movq 0x4058(%rsp), %rdi
leaq 0x290923(%rip), %rsi    # 0x592a1d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x2024(%rsp) # imm = 0xFFFFFFFF
jmp 0x3021ae
movq 0x4060(%rsp), %rdi
movq 0x4048(%rsp), %rsi
movq 0x4058(%rsp), %rdx
callq 0x3021f0
xorl %eax, %eax
cmpl $0x0, 0x2024(%rsp)
movb %al, 0x7(%rsp)
jne 0x30216c
movq 0x4050(%rsp), %rdi
movq 0x4058(%rsp), %rdx
leaq 0x4048(%rsp), %rsi
callq 0x1a7950
movl %eax, 0x403c(%rsp)
cmpl $0x1, %eax
setne %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x302176
jmp 0x3021ac
cmpl $0x0, 0x403c(%rsp)
jne 0x30219f
movq 0x4060(%rsp), %rdi
movq 0x4048(%rsp), %rsi
movq 0x4058(%rsp), %rdx
callq 0x3021f0
jmp 0x3021aa
movl $0xffffffff, 0x2024(%rsp) # imm = 0xFFFFFFFF
jmp 0x30212e
jmp 0x3021ae
jmp 0x3021bb
movl $0xffffffff, 0x2024(%rsp) # imm = 0xFFFFFFFF
jmp 0x3021d3
movq 0x4058(%rsp), %rdi
leaq 0x290867(%rip), %rsi    # 0x592a33
movb $0x0, %al
callq 0xd88c0
movl 0x2024(%rsp), %eax
addq $0x4068, %rsp           # imm = 0x4068
retq
nopw %cs:(%rax,%rax)