// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/giextract.c
// Function: extractkeyfromcurrentline
static int extractkeyfromcurrentline(Fastakeyquery *fastakeyptr,
                                     GtUword keysize,
                                     const GtStr *currentline,
                                     uint64_t linenum,
                                     const GtStr *fileofkeystoextract,
                                     GtError *err)
{
  char *lineptr = gt_str_get(currentline);
  GtWord readlongfrompos, readlongtopos;
  size_t idx;
  bool haserr = false;

  for (idx = 0; lineptr[idx] != '\0' && !isspace(lineptr[idx]); idx++)
    /* nothing */ ;
  if (keysize == 0)
  {
    fastakeyptr->fastakey = gt_malloc(sizeof (char) * (idx+1));
  } else
  {
    if (idx != (size_t) keysize)
    {
      gt_error_set(err,"key \"%*.*s\" is not of size "GT_WU"",(int) idx,
                   (int) idx,lineptr,keysize);
      haserr = true;
    }
  }
  if (!haserr)
  {
    strncpy(fastakeyptr->fastakey,lineptr,idx);
    fastakeyptr->fastakey[idx] = '\0';
    fastakeyptr->frompos = 1UL;
    fastakeyptr->topos = 0;
    if (sscanf(lineptr+idx, GT_WD " " GT_WD "\n",
               &readlongfrompos,&readlongtopos) == 2)
    {
      CHECKPOSITIVE(readlongfrompos,""GT_WD"","second");
      if (!haserr)
      {
        fastakeyptr->frompos = (GtUword) readlongfrompos;
        CHECKPOSITIVE(readlongtopos,""GT_WD"","third");
      }
      if (!haserr)
      {
        fastakeyptr->topos = (GtUword) readlongtopos;
      }
    }
  }
  if (!haserr)
  {
    fastakeyptr->markhit = false;
    if (!COMPLETE(fastakeyptr) && fastakeyptr->frompos > fastakeyptr->topos)
    {
      gt_error_set(err, "file \"%s\", line " Formatuint64_t
                        "illegal format: second value "
                        GT_WU " is larger than third value " GT_WU,
                        gt_str_get(fileofkeystoextract),
                        PRINTuint64_tcast(linenum+1),
                        fastakeyptr->frompos,
                        fastakeyptr->topos);
      haserr = true;
    }
  }
  return haserr ? -1 : 0;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movq %r8, 0x50(%rsp)
movq %r9, 0x48(%rsp)
movq 0x60(%rsp), %rdi
callq 0x11dee0
movq %rax, 0x40(%rsp)
movb $0x0, 0x27(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x40(%rsp), %rax
movq 0x28(%rsp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x26(%rsp)
je 0x253126
callq 0x197c0
movq (%rax), %rax
movq 0x40(%rsp), %rcx
movq 0x28(%rsp), %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, 0x26(%rsp)
movb 0x26(%rsp), %al
testb $0x1, %al
jne 0x253130
jmp 0x253142
jmp 0x253132
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x2530df
cmpq $0x0, 0x68(%rsp)
jne 0x253175
movq 0x28(%rsp), %rdi
addq $0x1, %rdi
shlq $0x0, %rdi
leaq 0x326815(%rip), %rsi    # 0x579973
movl $0xb5, %edx
callq 0xe80f0
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq %rcx, (%rax)
jmp 0x2531b3
movq 0x28(%rsp), %rax
cmpq 0x68(%rsp), %rax
je 0x2531b1
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rax
movl %eax, %edx
movq 0x28(%rsp), %rax
movl %eax, %ecx
movq 0x40(%rsp), %r8
movq 0x68(%rsp), %r9
leaq 0x326b03(%rip), %rsi    # 0x579ca8
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x27(%rsp)
jmp 0x2531b3
testb $0x1, 0x27(%rsp)
jne 0x2532f3
movq 0x70(%rsp), %rax
movq (%rax), %rdi
movq 0x40(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x19330
movq 0x70(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
movb $0x0, (%rax,%rcx)
movq 0x70(%rsp), %rax
movq $0x1, 0x8(%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x40(%rsp), %rdi
addq 0x28(%rsp), %rdi
leaq 0x31e981(%rip), %rsi    # 0x571b92
leaq 0x38(%rsp), %rdx
leaq 0x30(%rsp), %rcx
movb $0x0, %al
callq 0x19770
cmpl $0x2, %eax
jne 0x2532f1
cmpq $0x0, 0x38(%rsp)
jg 0x253277
movq 0x48(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x50(%rsp), %rdi
callq 0x11dee0
movq 0x18(%rsp), %rdi
movq %rax, %rdx
movq 0x58(%rsp), %rcx
addq $0x1, %rcx
movq 0x38(%rsp), %r9
leaq 0x326a63(%rip), %rsi    # 0x579cc7
leaq 0x326aac(%rip), %r8     # 0x579d17
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x27(%rsp)
testb $0x1, 0x27(%rsp)
jne 0x2532da
movq 0x38(%rsp), %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x30(%rsp)
jg 0x2532d8
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rdi
callq 0x11dee0
movq 0x10(%rsp), %rdi
movq %rax, %rdx
movq 0x58(%rsp), %rcx
addq $0x1, %rcx
movq 0x30(%rsp), %r9
leaq 0x326a02(%rip), %rsi    # 0x579cc7
leaq 0x326a52(%rip), %r8     # 0x579d1e
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x27(%rsp)
jmp 0x2532da
testb $0x1, 0x27(%rsp)
jne 0x2532ef
movq 0x30(%rsp), %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x2532f1
jmp 0x2532f3
testb $0x1, 0x27(%rsp)
jne 0x25337f
movq 0x70(%rsp), %rax
movb $0x0, 0x18(%rax)
movq 0x70(%rsp), %rax
cmpq $0x1, 0x8(%rax)
jne 0x25331f
movq 0x70(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x25337d
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x70(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x25337d
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rdi
callq 0x11dee0
movq 0x8(%rsp), %rdi
movq %rax, %rdx
movq 0x58(%rsp), %rcx
addq $0x1, %rcx
movq 0x70(%rsp), %rax
movq 0x8(%rax), %r8
movq 0x70(%rsp), %rax
movq 0x10(%rax), %r9
leaq 0x3269b3(%rip), %rsi    # 0x579d24
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x27(%rsp)
jmp 0x25337f
movb 0x27(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)