// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/prsqualint.c
// Function: gt_parsequalifiedinteger
Qualifiedinteger *gt_parsequalifiedinteger(const char *option,
                                        const char *lparam,
                                        GtError *err)
{
  GtWord readint = 0;
  size_t i;
  char *lparamcopy;
  bool haserr = false;
  Qualifiedinteger *qualint;

  lparamcopy = gt_malloc(sizeof (char) * (strlen(lparam)+1));
  qualint = gt_malloc(sizeof (*qualint));
  strcpy(lparamcopy,lparam);
  for (i=0; lparamcopy[i] != '\0'; i++)
  {
    if (!isdigit((int) lparamcopy[i]) &&
        lparamcopy[i] != BESTCHARACTER &&
        lparamcopy[i] != PERCENTAWAYCHARACTER)
    {
      ERRORLPARAM;
      haserr = true;
      break;
    }
  }
  if (!haserr && i == 0)
  {
    ERRORLPARAM;
    haserr = true;
  }
  if (!haserr)
  {
    if (lparamcopy[i-1] == BESTCHARACTER)
    {
      lparamcopy[i-1] = '\0';
      qualint->qualtag = Qualbestof;
    } else
    {
      if (lparamcopy[i-1] == PERCENTAWAYCHARACTER)
      {
        lparamcopy[i-1] = '\0';
        qualint->qualtag = Qualpercentaway;
      } else
      {
        qualint->qualtag = Qualabsolute;
      }
    }
    if (sscanf(lparamcopy,""GT_WD"",&readint) != 1 || readint <= 0)
    {
      ERRORLPARAM;
      haserr = true;
    }
  }
  if (!haserr &&
      (qualint->qualtag == Qualpercentaway || qualint->qualtag == Qualbestof))
  {
    if (readint > 100L)
    {
      ERRORLPARAM;
      haserr = true;
    }
  }
  qualint->integervalue = (GtUword) readint;
  gt_free(lparamcopy);
  if (haserr)
  {
    gt_free (qualint);
    return NULL;
  }
  return qualint;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
movq %rsi, %rdi
callq 0x172d0
leaq 0x1(%rax), %rdi
leaq 0x1e2160(%rip), %rbx    # 0x34a046
pushq $0x39
popq %rdx
movq %rbx, %rsi
callq 0x93160
movq %rax, %r14
pushq $0x10
popq %rdi
pushq $0x3a
popq %rdx
movq %rbx, %rsi
callq 0x93160
movq %rax, %rbx
movq %r14, %rdi
movq %r12, %rsi
callq 0x17730
xorl %ebp, %ebp
movsbq (%r14,%rbp), %r15
testq %r15, %r15
je 0x167f43
callq 0x17820
movq (%rax), %rax
movzwl (%rax,%r15,2), %eax
btl $0xb, %eax
jb 0x167f3e
cmpb $0x62, %r15b
je 0x167f3e
movzbl %r15b, %eax
cmpl $0x70, %eax
jne 0x167f99
incq %rbp
jmp 0x167f12
testq %rbp, %rbp
je 0x167f99
movzbl -0x1(%r14,%rbp), %ecx
cmpl $0x62, %ecx
je 0x167f5e
xorl %eax, %eax
cmpl $0x70, %ecx
jne 0x167f67
pushq $0x1
jmp 0x167f60
pushq $0x2
popq %rax
movb $0x0, -0x1(%r14,%rbp)
movl %eax, (%rbx)
leaq 0x1b475f(%rip), %rsi    # 0x31c6cf
leaq 0x10(%rsp), %rbp
movq %r14, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x177b0
cmpl $0x1, %eax
setne %cl
movq (%rbp), %rax
testq %rax, %rax
setle %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x16800a
testq %r13, %r13
je 0x168046
movl $0x70, (%rsp)
leaq 0x1e20ad(%rip), %rsi    # 0x34a05d
pushq $0x62
popq %r8
pushq $0x70
popq %r9
movq %r13, %rdi
movq %r12, %rdx
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x89dbb
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rbx)
leaq 0x1e206c(%rip), %r15    # 0x34a046
pushq $0x6d
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x936f9
pushq $0x70
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x936f9
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl (%rbx), %ecx
cmpl $0x1, %ecx
jne 0x168019
cmpq $0x65, %rax
jae 0x167f99
jmp 0x16802e
cmpl $0x2, %ecx
sete %cl
cmpq $0x65, %rax
setae %dl
testb %dl, %cl
jne 0x167f99
movq %rax, 0x8(%rbx)
leaq 0x1e200d(%rip), %rsi    # 0x34a046
pushq $0x6d
popq %rdx
movq %r14, %rdi
callq 0x936f9
jmp 0x167ff8
movq 0x2cff1b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
movl $0x70, (%rsp)
leaq 0x1e1fff(%rip), %rsi    # 0x34a05d
pushq $0x62
popq %r8
pushq $0x70
popq %r9
movq %r12, %rdx
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x17a50
jmp 0x167fca
nop