// File: /workspace/github_c_makefile_star2_O1/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)
movq $0x0, 0x10(%rsp)
movq %rsi, %rdi
callq 0x172f0
leaq 0x1(%rax), %rdi
leaq 0x1f185c(%rip), %rbx    # 0x3b32a9
movq %rbx, %rsi
movl $0x39, %edx
callq 0x1092b2
movq %rax, %r14
movl $0x10, %edi
movq %rbx, %rsi
movl $0x3a, %edx
callq 0x1092b2
movq %rax, %rbx
movq %r14, %rdi
movq %r12, %rsi
callq 0x17770
movb (%r14), %r15b
testb %r15b, %r15b
je 0x1c1abf
callq 0x17870
movq (%rax), %rax
xorl %ebp, %ebp
movsbq %r15b, %rcx
movzwl (%rax,%rcx,2), %ecx
btl $0xb, %ecx
jb 0x1c1ab0
cmpb $0x62, %r15b
je 0x1c1ab0
movzbl %r15b, %ecx
cmpl $0x70, %ecx
jne 0x1c1c36
movb 0x1(%r14,%rbp), %r15b
incq %rbp
testb %r15b, %r15b
jne 0x1c1a8f
jmp 0x1c1ac1
xorl %ebp, %ebp
xorl %r15d, %r15d
testq %rbp, %rbp
setne %al
orb %r15b, %al
jne 0x1c1b07
testq %r13, %r13
je 0x1c1c73
movl $0x70, (%rsp)
leaq 0x1f17da(%rip), %rsi    # 0x3b32c0
movq %r13, %rdi
movq %r12, %rdx
movq 0x8(%rsp), %rcx
movl $0x62, %r8d
movl $0x70, %r9d
xorl %eax, %eax
callq 0x1019cf
movb $0x1, %r15b
testb %r15b, %r15b
jne 0x1c1b91
movzbl -0x1(%r14,%rbp), %ecx
cmpl $0x62, %ecx
je 0x1c1b29
xorl %eax, %eax
cmpl $0x70, %ecx
jne 0x1c1b34
movl $0x1, %eax
jmp 0x1c1b2e
movl $0x2, %eax
movb $0x0, -0x1(%r14,%rbp)
movl %eax, (%rbx)
leaq 0x1c3af7(%rip), %rsi    # 0x385634
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x177f0
cmpl $0x1, %eax
jne 0x1c1b59
cmpq $0x0, 0x10(%rsp)
jg 0x1c1b91
testq %r13, %r13
je 0x1c1cab
movl $0x70, (%rsp)
leaq 0x1f1750(%rip), %rsi    # 0x3b32c0
movq %r13, %rdi
movq %r12, %rdx
movq 0x8(%rsp), %rcx
movl $0x62, %r8d
movl $0x70, %r9d
xorl %eax, %eax
callq 0x1019cf
movb $0x1, %r15b
testb %r15b, %r15b
jne 0x1c1bec
movl (%rbx), %eax
cmpl $0x1, %eax
jne 0x1c1ba7
cmpq $0x65, 0x10(%rsp)
jge 0x1c1bb4
jmp 0x1c1bec
cmpl $0x2, %eax
jne 0x1c1bec
cmpq $0x64, 0x10(%rsp)
jle 0x1c1bec
testq %r13, %r13
je 0x1c1ce3
movl $0x70, (%rsp)
leaq 0x1f16f5(%rip), %rsi    # 0x3b32c0
movq %r13, %rdi
movq %r12, %rdx
movq 0x8(%rsp), %rcx
movl $0x62, %r8d
movl $0x70, %r9d
xorl %eax, %eax
callq 0x1019cf
movb $0x1, %r15b
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rbx)
leaq 0x1f16ad(%rip), %rsi    # 0x3b32a9
movq %r14, %rdi
movl $0x6d, %edx
callq 0x109670
testb %r15b, %r15b
je 0x1c1c24
leaq 0x1f1694(%rip), %rsi    # 0x3b32a9
movq %rbx, %rdi
movl $0x70, %edx
callq 0x109670
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r13, %r13
je 0x1c1d1b
movl $0x70, (%rsp)
leaq 0x1f1673(%rip), %rsi    # 0x3b32c0
movq %r13, %rdi
movq %r12, %rdx
movq 0x8(%rsp), %rcx
movl $0x62, %r8d
movl $0x70, %r9d
xorl %eax, %eax
callq 0x1019cf
movb $0x1, %r15b
jmp 0x1c1ac4
movq 0x302306(%rip), %rax    # 0x4c3f80
movq (%rax), %rdi
movl $0x70, (%rsp)
leaq 0x1f1635(%rip), %rsi    # 0x3b32c0
movq %r12, %rdx
movq 0x8(%rsp), %rcx
movl $0x62, %r8d
movl $0x70, %r9d
xorl %eax, %eax
callq 0x17ab0
jmp 0x1c1b04
movq 0x3022ce(%rip), %rax    # 0x4c3f80
movq (%rax), %rdi
movl $0x70, (%rsp)
leaq 0x1f15fd(%rip), %rsi    # 0x3b32c0
movq %r12, %rdx
movq 0x8(%rsp), %rcx
movl $0x62, %r8d
movl $0x70, %r9d
xorl %eax, %eax
callq 0x17ab0
jmp 0x1c1b8e
movq 0x302296(%rip), %rax    # 0x4c3f80
movq (%rax), %rdi
movl $0x70, (%rsp)
leaq 0x1f15c5(%rip), %rsi    # 0x3b32c0
movq %r12, %rdx
movq 0x8(%rsp), %rcx
movl $0x62, %r8d
movl $0x70, %r9d
xorl %eax, %eax
callq 0x17ab0
jmp 0x1c1be9
movq 0x30225e(%rip), %rax    # 0x4c3f80
movq (%rax), %rdi
movl $0x70, (%rsp)
leaq 0x1f158d(%rip), %rsi    # 0x3b32c0
movq %r12, %rdx
movq 0x8(%rsp), %rcx
movl $0x62, %r8d
movl $0x70, %r9d
xorl %eax, %eax
callq 0x17ab0
jmp 0x1c1c6b
nop