// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/giextract.c
// Function: itersearchoverallkeys
static int itersearchoverallkeys(const GtEncseq *encseq,
                                 const char *keytab,
                                 GtUword numofkeys,
                                 GtUword keysize,
                                 const GtStr *fileofkeystoextract,
                                 GtUword linewidth,
                                 GtError *err)
{
  FILE *fp;
  GtStr *currentline;
  uint64_t linenum;
  GtUword seqnum, countmissing = 0;
  bool haserr = false;
  Fastakeyquery fastakeyquery;

  if (linewidth == 0)
  {
    gt_error_set(err,"use option width to specify line width for formatting");
    return -1;
  }
  fp = gt_fa_fopen(gt_str_get(fileofkeystoextract),"r",err);
  if (fp == NULL)
  {
    return -1;
  }
  currentline = gt_str_new();
  fastakeyquery.fastakey = gt_malloc(sizeof (char) * (keysize+1));
  for (linenum = 0; gt_str_read_next_line(currentline, fp) != EOF; linenum++)
  {
    if (extractkeyfromcurrentline(&fastakeyquery,
                                  keysize,
                                  currentline,
                                  linenum,
                                  fileofkeystoextract,
                                  err) != 0)
    {
      haserr = true;
      break;
    }
    seqnum = searchfastaqueryindes(fastakeyquery.fastakey,keytab,numofkeys,
                                   keysize);
    if (seqnum < numofkeys)
    {
      if (giextract_encodedseq2fasta(stdout,
                                     encseq,
                                     seqnum,
                                     &fastakeyquery,
                                     linewidth,
                                     err) != 0)
      {
        haserr = true;
        break;
      }
    } else
    {
      countmissing++;
    }
    gt_str_reset(currentline);
  }
  if (!haserr && countmissing > 0)
  {
    printf("# number of unsatified fastakey-queries: "GT_WU"\n",countmissing);
  }
  gt_str_delete(currentline);
  gt_fa_fclose(fp);
  gt_free(fastakeyquery.fastakey);
  return haserr ? - 1 : 0;
}

// Assembly:
subq $0x88, %rsp
movq 0x90(%rsp), %rax
movq %rdi, 0x78(%rsp)
movq %rsi, 0x70(%rsp)
movq %rdx, 0x68(%rsp)
movq %rcx, 0x60(%rsp)
movq %r8, 0x58(%rsp)
movq %r9, 0x50(%rsp)
movq $0x0, 0x28(%rsp)
movb $0x0, 0x27(%rsp)
cmpq $0x0, 0x50(%rsp)
jne 0x252359
movq 0x90(%rsp), %rdi
leaq 0x327902(%rip), %rsi    # 0x579c44
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x84(%rsp) # imm = 0xFFFFFFFF
jmp 0x252511
movq 0x58(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x90(%rsp), %r8
leaq 0x2d9c65(%rip), %rsi    # 0x52bfda
leaq 0x3275f7(%rip), %rdx    # 0x579973
movl $0x2b5, %ecx            # imm = 0x2B5
callq 0xd8df0
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0x2523a3
movl $0xffffffff, 0x84(%rsp) # imm = 0xFFFFFFFF
jmp 0x252511
callq 0x11d4a0
movq %rax, 0x40(%rsp)
movq 0x60(%rsp), %rdi
addq $0x1, %rdi
shlq $0x0, %rdi
leaq 0x3275b2(%rip), %rsi    # 0x579973
movl $0x2bb, %edx            # imm = 0x2BB
callq 0xe80f0
movq %rax, (%rsp)
movq $0x0, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x11e3a0
cmpl $-0x1, %eax
je 0x2524ae
movq 0x60(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rcx
movq 0x58(%rsp), %r8
movq 0x90(%rsp), %r9
movq %rsp, %rdi
callq 0x2530a0
cmpl $0x0, %eax
je 0x252423
movb $0x1, 0x27(%rsp)
jmp 0x2524ae
movq (%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq 0x60(%rsp), %rcx
callq 0x2533a0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x68(%rsp), %rax
jae 0x252483
movq 0x3e9ae5(%rip), %rax    # 0x63bf38
movq (%rax), %rdi
movq 0x78(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x50(%rsp), %r8
movq 0x90(%rsp), %r9
movq %rsp, %rcx
callq 0x251e10
cmpl $0x0, %eax
je 0x252481
movb $0x1, 0x27(%rsp)
jmp 0x2524ae
jmp 0x252491
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x40(%rsp), %rdi
callq 0x11e110
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0x2523d8
testb $0x1, 0x27(%rsp)
jne 0x2524d0
cmpq $0x0, 0x28(%rsp)
jbe 0x2524d0
movq 0x28(%rsp), %rsi
leaq 0x3277b1(%rip), %rdi    # 0x579c7a
movb $0x0, %al
callq 0x19070
movq 0x40(%rsp), %rdi
callq 0x11f560
movq 0x48(%rsp), %rdi
callq 0xd9390
movq (%rsp), %rdi
leaq 0x327484(%rip), %rsi    # 0x579973
movl $0x2e2, %edx            # imm = 0x2E2
callq 0xe88c0
movb 0x27(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, 0x84(%rsp)
movl 0x84(%rsp), %eax
addq $0x88, %rsp
retq