// File: /workspace/github_c_makefile_star2_O3/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, %r15
movq $0x0, 0x10(%rsp)
movq %rsi, %rdi
callq 0x172f0
leaq 0x1(%rax), %rdi
leaq 0x1f0da6(%rip), %rbx    # 0x3a9c99
movq %rbx, %rsi
movl $0x39, %edx
callq 0x104226
movq %rax, %r14
movl $0x10, %edi
movq %rbx, %rsi
movl $0x3a, %edx
callq 0x104226
movq %rax, %rbx
movq %r14, %rdi
movq %r12, %rsi
callq 0x17770
movb (%r14), %bpl
testb %bpl, %bpl
je 0x1b8fbe
callq 0x17870
movq (%rax), %rcx
xorl %eax, %eax
movsbq %bpl, %rdx
movzwl (%rcx,%rdx,2), %edx
btl $0xb, %edx
jb 0x1b8f56
cmpb $0x62, %bpl
je 0x1b8f56
movzbl %bpl, %edx
cmpl $0x70, %edx
jne 0x1b8fbe
movb 0x1(%r14,%rax), %bpl
incq %rax
testb %bpl, %bpl
jne 0x1b8f39
testq %rax, %rax
je 0x1b8fbe
movzbl -0x1(%r14,%rax), %edx
cmpl $0x62, %edx
je 0x1b8f81
xorl %ecx, %ecx
cmpl $0x70, %edx
jne 0x1b8f8c
movl $0x1, %ecx
jmp 0x1b8f86
movl $0x2, %ecx
movb $0x0, -0x1(%r14,%rax)
movl %ecx, (%rbx)
leaq 0x1c332f(%rip), %rsi    # 0x37c2c4
leaq 0x10(%rsp), %rbp
movq %r14, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x177f0
cmpl $0x1, %eax
setne %cl
movq (%rbp), %rax
testq %rax, %rax
setle %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x1b9035
testq %r13, %r13
je 0x1b9077
movl $0x70, (%rsp)
leaq 0x1f0cdb(%rip), %rsi    # 0x3a9cb0
movq %r13, %rdi
movq %r12, %rdx
movq %r15, %rcx
movl $0x62, %r8d
movl $0x70, %r9d
xorl %eax, %eax
callq 0xfcb67
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rbx)
leaq 0x1f0c98(%rip), %r15    # 0x3a9c99
movq %r14, %rdi
movq %r15, %rsi
movl $0x6d, %edx
callq 0x1045eb
movq %rbx, %rdi
movq %r15, %rsi
movl $0x70, %edx
callq 0x1045eb
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 0x1b9048
cmpq $0x65, %rax
jae 0x1b8fbe
jmp 0x1b905d
cmpl $0x2, %ecx
sete %cl
cmpq $0x65, %rax
setae %dl
testb %dl, %cl
jne 0x1b8fbe
movq %rax, 0x8(%rbx)
leaq 0x1f0c31(%rip), %rsi    # 0x3a9c99
movq %r14, %rdi
movl $0x6d, %edx
callq 0x1045eb
jmp 0x1b9023
movq 0x2fff02(%rip), %rax    # 0x4b8f80
movq (%rax), %rdi
movl $0x70, (%rsp)
leaq 0x1f0c21(%rip), %rsi    # 0x3a9cb0
movq %r12, %rdx
movq %r15, %rcx
movl $0x62, %r8d
movl $0x70, %r9d
xorl %eax, %eax
callq 0x17ab0
jmp 0x1b8ff1
nopl (%rax)