// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/giextract.c
// Function: readfileofkeystoextract
static Fastakeyquery *readfileofkeystoextract(bool verbose,
                                              GtUword *numofqueries,
                                              const GtStr *fileofkeystoextract,
                                              GtError *err)
{
  FILE *fp;
  GtStr *currentline;
  bool haserr = false;
  uint64_t linenum;
  Fastakeyquery *fastakeyqueries;
#undef SKDEBUG
#ifdef SKDEBUG
  GtUword i;
#endif

  gt_error_check(err);
  *numofqueries = gt_file_number_of_lines(gt_str_get(fileofkeystoextract));
  if (*numofqueries == 0)
  {
    gt_error_set(err,"empty file \"%s\" not allowed",
                 gt_str_get(fileofkeystoextract));
    return NULL;
  }
  fp = gt_fa_fopen(gt_str_get(fileofkeystoextract),"r",err);
  if (fp == NULL)
  {
    return NULL;
  }
  if (verbose)
  {
    printf("# opened keyfile \"%s\"\n",gt_str_get(fileofkeystoextract));
  }
  fastakeyqueries = gt_malloc(sizeof (*fastakeyqueries) * (*numofqueries));
  currentline = gt_str_new();
  for (linenum = 0; gt_str_read_next_line(currentline, fp) != EOF; linenum++)
  {
    if (extractkeyfromcurrentline(fastakeyqueries + linenum,
                                  0,
                                  currentline,
                                  linenum,
                                  fileofkeystoextract,
                                  err) != 0)
    {
      haserr = true;
      break;
    }
    gt_str_reset(currentline);
  }
  gt_str_delete(currentline);
  gt_fa_fclose(fp);
  if (haserr)
  {
    fastakeyqueries_delete(fastakeyqueries,*numofqueries);
    return NULL;
  }
  qsort(fastakeyqueries,(size_t) *numofqueries,sizeof (*fastakeyqueries),
        comparefastakeys);
  if (verbose)
  {
    printf("# "GT_WU" fastakey-queries successfully parsed and sorted\n",
            *numofqueries);
  }
  *numofqueries = remdupsfastakeyqueries(fastakeyqueries,*numofqueries,verbose);
#ifdef SKDEBUG
  for (i=0; i<*numofqueries; i++)
  {
    printf(""GT_WU" %s\n",i,fastakeyqueries[i].fastakey);
  }
#endif
  return fastakeyqueries;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movl %edi, %ebp
testq %rcx, %rcx
je 0x1b1548
movq %r15, %rdi
callq 0xfcc32
testb %al, %al
jne 0x1b17fa
movq %r12, %rdi
callq 0x11b0a1
movq %rax, %rdi
callq 0xff393
movq %rax, %rbx
movq %rax, (%r14)
movq %r12, %rdi
callq 0x11b0a1
testq %rbx, %rbx
je 0x1b17a2
leaq 0x1a98df(%rip), %rsi    # 0x35ae55
leaq 0x1f5bc5(%rip), %rdx    # 0x3a7142
movq %rax, %rdi
movl $0xfd, %ecx
movq %r15, %r8
callq 0xfcdbb
testq %rax, %rax
je 0x1b17dd
movq %rax, %r13
movl %ebp, 0x1c(%rsp)
testb %bpl, %bpl
je 0x1b15bb
movq %r12, %rdi
callq 0x11b0a1
leaq 0x1f5ff7(%rip), %rdi    # 0x3a75a8
movq %rax, %rsi
xorl %eax, %eax
callq 0x17070
movq %r14, 0x8(%rsp)
movq (%r14), %rdi
shlq $0x5, %rdi
leaq 0x1f5b74(%rip), %rsi    # 0x3a7142
movl $0x106, %edx            # imm = 0x106
callq 0x104226
movq %rax, 0x10(%rsp)
callq 0x11ac6c
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rsi
callq 0x11b1ff
cmpl $-0x1, %eax
je 0x1b1639
xorl %ebx, %ebx
movq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
movq %rbp, %rdx
movq %rbx, %rcx
movq %r12, %r8
movq %r15, %r9
callq 0x1b185b
testl %eax, %eax
jne 0x1b17bb
movq %rbp, %rdi
callq 0x11b132
incq %rbx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x11b1ff
addq $0x20, %r14
cmpl $-0x1, %eax
jne 0x1b15fc
movq %rbp, %rdi
callq 0x11bdbf
movq %r13, %rdi
callq 0xfd018
movq 0x8(%rsp), %rbx
movq (%rbx), %rsi
leaq 0x3d7(%rip), %rcx       # 0x1b1a2f
movl $0x20, %edx
movq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0x17f60
cmpb $0x0, 0x1c(%rsp)
je 0x1b1682
movq (%rbx), %rsi
leaq 0x1f5f44(%rip), %rdi    # 0x3a75bf
xorl %eax, %eax
callq 0x17070
movq (%rbx), %r15
testq %r15, %r15
je 0x1b17e2
movq %r15, %rax
shlq $0x5, %rax
movq %rax, 0x20(%rsp)
leaq (%rax,%r13), %r14
movq %r13, %r12
cmpq $0x2, %r15
jl 0x1b1734
movq 0x10(%rsp), %r13
leaq 0x20(%r13), %rbp
movq (%r13), %rdi
movq (%rbp), %rbx
movq %rbx, %rsi
callq 0x17a40
testl %eax, %eax
jne 0x1b16e1
movq 0x8(%r13), %rax
cmpq 0x8(%rbp), %rax
jne 0x1b16e1
movq 0x10(%r13), %rax
cmpq 0x10(%rbp), %rax
jne 0x1b16e1
movq %r13, %r12
jmp 0x1b1728
leaq -0x20(%rbp), %rax
leaq 0x20(%r13), %r12
cmpq %r13, %rax
je 0x1b1728
movups 0x8(%rbp), %xmm0
movups %xmm0, 0x28(%r13)
movq %rbx, %rdi
callq 0x172f0
movq 0x20(%r13), %rdi
leaq 0x1(%rax), %rsi
leaq 0x1f5a34(%rip), %rdx    # 0x3a7142
movl $0x7d, %ecx
callq 0x104461
movq %rax, 0x20(%r13)
movq (%rbp), %rsi
movq %rax, %rdi
callq 0x17770
addq $0x20, %rbp
movq %r12, %r13
cmpq %r14, %rbp
jb 0x1b16b4
movq 0x10(%rsp), %r13
subq %r13, %r12
sarq $0x5, %r12
incq %r12
subq %r12, %r15
jbe 0x1b179b
cmpb $0x0, 0x1c(%rsp)
je 0x1b1760
leaq 0x1f5ea0(%rip), %rdi    # 0x3a75f6
movq %r15, %rsi
xorl %eax, %eax
callq 0x17070
movq %r12, %rax
shlq $0x5, %rax
cmpq 0x20(%rsp), %rax
jge 0x1b179b
movq %r13, %r15
addq %rax, %r15
leaq 0x1f59c7(%rip), %rbx    # 0x3a7142
movq (%r15), %rdi
movq %rbx, %rsi
movl $0x8e, %edx
callq 0x1045eb
movq $0x0, (%r15)
addq $0x20, %r15
cmpq %r14, %r15
jb 0x1b177b
movq 0x8(%rsp), %rbx
jmp 0x1b17e5
leaq 0x1f5de3(%rip), %rsi    # 0x3a758c
xorl %r13d, %r13d
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfcb67
jmp 0x1b17e8
movq %rbp, %rdi
callq 0x11bdbf
movq %r13, %rdi
callq 0xfd018
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x10(%rsp), %rdi
callq 0x1b17ff
xorl %r13d, %r13d
jmp 0x1b17e8
xorl %r12d, %r12d
movq %r12, (%rbx)
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6518a