// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/giextract.c
// Function: gt_extractkeysfromfastaindex
int gt_extractkeysfromfastaindex(const char *indexname,
                                 const GtStr *fileofkeystoextract,
                                 GtUword linewidth,GtError *err)
{
  GtEncseq *encseq = NULL;
  GtEncseqLoader *el = NULL;
  bool haserr = false;
  GtUword numofdbsequences = 0, keysize = 0;

  el = gt_encseq_loader_new();
  encseq = gt_encseq_loader_load(el, indexname, err);
  gt_encseq_loader_delete(el);
  if (encseq == NULL)
  {
    haserr = true;
  }
  if (!haserr)
  {
    int retval;

    numofdbsequences = gt_encseq_num_of_sequences(encseq);
    retval = readkeysize(indexname,err);
    if (retval < 0)
    {
      haserr = true;
    }
    keysize = (GtUword) retval;
  }
  if (!haserr)
  {
    char *keytab;
    GtUword keytablength;

    keytablength = 1UL + numofdbsequences * (keysize+1);
    keytab = gt_fa_mmap_check_size_with_suffix(indexname,
                                               GT_KEYSTABFILESUFFIX,
                                               keytablength,
                                               sizeof (GtUchar),
                                               err);
    if (keytab == NULL)
    {
      haserr = true;
    } else
    {
      if (itersearchoverallkeys(encseq,keytab,numofdbsequences,
                                keysize,fileofkeystoextract,
                                linewidth,err) != 0)
      {
        haserr = true;
      }
    }
    gt_fa_xmunmap(keytab);
  }
  if (encseq != NULL)
  {
    gt_encseq_delete(encseq);
    encseq = NULL;
  }
  return haserr ? -1 : 0;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movb $0x0, 0x37(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
callq 0xb7a40
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0xb7aa0
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %rdi
callq 0xb7e50
cmpq $0x0, 0x40(%rsp)
jne 0x25203b
movb $0x1, 0x37(%rsp)
testb $0x1, 0x37(%rsp)
jne 0x25207a
movq 0x40(%rsp), %rdi
callq 0xa9d50
movq %rax, 0x28(%rsp)
movq 0x60(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x252150
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jge 0x252070
movb $0x1, 0x37(%rsp)
movslq 0x1c(%rsp), %rax
movq %rax, 0x20(%rsp)
testb $0x1, 0x37(%rsp)
jne 0x252116
movq 0x28(%rsp), %rax
movq 0x20(%rsp), %rcx
addq $0x1, %rcx
imulq %rcx, %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rdi
movq 0x8(%rsp), %rdx
movq 0x48(%rsp), %r8
leaq 0x3278d3(%rip), %rsi    # 0x579989
movl $0x1, %ecx
callq 0xdb500
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x2520d4
movb $0x1, 0x37(%rsp)
jmp 0x25210c
movq 0x40(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq 0x58(%rsp), %r8
movq 0x50(%rsp), %r9
movq 0x48(%rsp), %rax
movq %rax, (%rsp)
callq 0x2522f0
cmpl $0x0, %eax
je 0x25210a
movb $0x1, 0x37(%rsp)
jmp 0x25210c
movq 0x10(%rsp), %rdi
callq 0xdb2a0
cmpq $0x0, 0x40(%rsp)
je 0x252131
movq 0x40(%rsp), %rdi
callq 0xae070
movq $0x0, 0x40(%rsp)
movb 0x37(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x68, %rsp
retq
nopw (%rax,%rax)