// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/match_iterator_last.c
// Function: last_prepare_indices
static int last_prepare_indices(GtMatchIteratorLast *mil,
                                GT_UNUSED GtError *err)
{
  int had_err = 0;
  GtStr *param = gt_str_new(),
        *idxfilename = gt_str_new();
  gt_assert(mil);
  gt_error_check(err);

  had_err = get_index_parameterization(mil, param, err);
  if (!had_err) {
    GtStr *cmdline = NULL,
          *fn = NULL;
    char *seq, *hash;

    seq = gt_malloc(sizeof (char) * gt_encseq_total_length(mil->pvt->es1)+1);
    seq[gt_encseq_total_length(mil->pvt->es1)] = '\0';
    gt_encseq_extract_decoded(mil->pvt->es1,
                              seq, 0,
                              gt_encseq_total_length(mil->pvt->es1)-1);
    hash = gt_md5_fingerprint(seq, gt_encseq_total_length(mil->pvt->es1));
    gt_free(seq);

    /* maybe hash the sequence file! */
    gt_str_append_cstr(idxfilename, mil->pvt->tmpdir);
    gt_str_append_cstr(idxfilename, "/");
    gt_str_append_cstr(idxfilename, hash);
    mil->pvt->idxfilename = gt_str_ref(idxfilename);
    fn = gt_str_clone(mil->pvt->idxfilename);
    gt_str_append_cstr(fn, "0.suf");
    if (!gt_file_exists(gt_str_get(fn))) {
      const char *env;
      had_err = last_prepare_fasta_seqs(gt_str_get(mil->pvt->idxfilename),
                                        mil->pvt->es1, mil->pvt->desc_to_seqno,
                                        err);
      if (!had_err) {
        cmdline = gt_str_new();
        env = getenv("GT_LAST_PATH");
        if (env) {
          gt_str_append_cstr(cmdline, env);
          gt_str_append_cstr(cmdline, "/lastdb ");
          if (!gt_file_exists(gt_str_get(cmdline))) {
            gt_error_set(err, "cannot find LASTDB executable at %s",
                         gt_str_get(cmdline));
            had_err = -1;
          }
        } else {
          gt_str_append_cstr(cmdline, "lastdb ");
        }
      }
      if (!had_err) {
        gt_str_append_str(cmdline, idxfilename);
        gt_str_append_cstr(cmdline, " ");
        gt_str_append_str(cmdline, idxfilename);
        had_err = system(gt_str_get(cmdline));
      }
      if (had_err)
        gt_error_set(err, "error forking the LAST process");
      gt_str_delete(cmdline);
    }
    gt_str_delete(fn);
    gt_free(hash);
  }
  gt_str_delete(param);
  gt_str_delete(idxfilename);
  return had_err;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movl $0x0, 0x64(%rsp)
callq 0x11d4a0
movq %rax, 0x58(%rsp)
callq 0x11d4a0
movq %rax, 0x50(%rsp)
cmpq $0x0, 0x70(%rsp)
jne 0x1a90fa
movq 0x492ed7(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x36cf40(%rip), %rsi    # 0x516013
leaq 0x3b07fd(%rip), %rdx    # 0x5598d7
leaq 0x3b07fa(%rip), %rcx    # 0x5598db
leaq 0x3b07b6(%rip), %r8     # 0x55989e
movl $0x188, %r9d            # imm = 0x188
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1a90fc
jmp 0x1a90fe
cmpq $0x0, 0x68(%rsp)
je 0x1a914e
movq 0x68(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x1a9116
jmp 0x1a914e
movq 0x492e83(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x36ceec(%rip), %rsi    # 0x516013
leaq 0x36d091(%rip), %rdx    # 0x5161bf
leaq 0x3b07a6(%rip), %rcx    # 0x5598db
leaq 0x3b0762(%rip), %r8     # 0x55989e
movl $0x189, %r9d            # imm = 0x189
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1a9150
movq 0x70(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x68(%rsp), %rdx
callq 0x1a9bd0
movl %eax, 0x64(%rsp)
cmpl $0x0, 0x64(%rsp)
jne 0x1a946f
movq $0x0, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
callq 0xa9d00
movq %rax, %rdi
shlq $0x0, %rdi
addq $0x1, %rdi
leaq 0x3b06f6(%rip), %rsi    # 0x55989e
movl $0x191, %edx            # imm = 0x191
callq 0xe80f0
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
callq 0xa9d00
movq %rax, %rcx
movq 0x8(%rsp), %rax
movb $0x0, (%rax,%rcx)
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
callq 0xa9d00
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %rax, %rcx
subq $0x1, %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0xac570
movq 0x38(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
callq 0xa9d00
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0xeeef0
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rdi
leaq 0x3b0641(%rip), %rsi    # 0x55989e
movl $0x197, %edx            # imm = 0x197
callq 0xe88c0
movq 0x50(%rsp), %rdi
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rsi
callq 0x11d550
movq 0x50(%rsp), %rdi
leaq 0x382e5c(%rip), %rsi    # 0x52c0e6
callq 0x11d550
movq 0x50(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x11d550
movq 0x50(%rsp), %rdi
callq 0x11e360
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x40(%rax)
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x40(%rax), %rdi
callq 0x11e280
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
leaq 0x3b0615(%rip), %rsi    # 0x5598f0
callq 0x11d550
movq 0x40(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
callq 0xde820
testb $0x1, %al
jne 0x1a944f
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x40(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rsi
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x68(%rax), %rdx
movq 0x68(%rsp), %rcx
callq 0x1a9cf0
movl %eax, 0x64(%rsp)
cmpl $0x0, 0x64(%rsp)
jne 0x1a93df
callq 0x11d4a0
movq %rax, 0x48(%rsp)
leaq 0x3b05a4(%rip), %rdi    # 0x5598f6
callq 0x198a0
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0x1a93cc
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x11d550
movq 0x48(%rsp), %rdi
leaq 0x3b0584(%rip), %rsi    # 0x559903
callq 0x11d550
movq 0x48(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
callq 0xde820
testb $0x1, %al
jne 0x1a93ca
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movq 0x48(%rsp), %rdi
callq 0x11dee0
movq (%rsp), %rdi
movq %rax, %rdx
leaq 0x3b0551(%rip), %rsi    # 0x55990c
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
jmp 0x1a93dd
movq 0x48(%rsp), %rdi
leaq 0x3b052c(%rip), %rsi    # 0x559904
callq 0x11d550
jmp 0x1a93df
cmpl $0x0, 0x64(%rsp)
jne 0x1a942b
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x11d750
movq 0x48(%rsp), %rdi
leaq 0x3ec07e(%rip), %rsi    # 0x59547f
callq 0x11d550
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x11d750
movq 0x48(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
callq 0x19650
movl %eax, 0x64(%rsp)
cmpl $0x0, 0x64(%rsp)
je 0x1a9445
movq 0x68(%rsp), %rdi
leaq 0x3b04f2(%rip), %rsi    # 0x559930
movb $0x0, %al
callq 0xd88c0
movq 0x48(%rsp), %rdi
callq 0x11f560
movq 0x40(%rsp), %rdi
callq 0x11f560
movq 0x30(%rsp), %rdi
leaq 0x3b0439(%rip), %rsi    # 0x55989e
movl $0x1bf, %edx            # imm = 0x1BF
callq 0xe88c0
movq 0x58(%rsp), %rdi
callq 0x11f560
movq 0x50(%rsp), %rdi
callq 0x11f560
movl 0x64(%rsp), %eax
addq $0x78, %rsp
retq
nopl (%rax)