// File: /workspace/github_c_makefile_star2_O2/zhou-lab[P]tbmate/htslib/hts.c
// Function: hts_parse_decimal
long long hts_parse_decimal(const char *str, char **strend, int flags)
{
    long long n = 0;
    int decimals = 0, e = 0, lost = 0;
    char sign = '+', esign = '+';
    const char *s;

    while (isspace_c(*str)) str++;
    s = str;

    if (*s == '+' || *s == '-') sign = *s++;
    while (*s)
        if (isdigit_c(*s)) n = push_digit(n, *s++);
        else if (*s == ',' && (flags & HTS_PARSE_THOUSANDS_SEP)) s++;
        else break;

    if (*s == '.') {
        s++;
        while (isdigit_c(*s)) decimals++, n = push_digit(n, *s++);
    }

    if (*s == 'E' || *s == 'e') {
        s++;
        if (*s == '+' || *s == '-') esign = *s++;
        while (isdigit_c(*s)) e = push_digit(e, *s++);
        if (esign == '-') e = -e;
    }

    e -= decimals;
    while (e > 0) n *= 10, e--;
    while (e < 0) lost += n % 10, n /= 10, e++;

    if (lost > 0 && hts_verbose >= 3)
        fprintf(stderr, "[W::%s] discarding fractional part of %.*s\n",
                __func__, (int)(s - str), str);

    if (strend) *strend = (char *) s;
    else if (*s && hts_verbose >= 2)
        fprintf(stderr, "[W::%s] ignoring unknown characters after %.*s[%s]\n",
                __func__, (int)(s - str), str, s);

    return (sign == '+')? n : -n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x3410
movq (%rax), %rcx
leal -0x1(%rbx), %r15d
movzbl (%rbx), %eax
incq %rbx
incl %r15d
testb $0x20, 0x1(%rcx,%rax,2)
jne 0xd5f1
leaq -0x1(%rbx), %rcx
cmpl $0x2b, %eax
movq %rcx, 0x18(%rsp)
je 0xd614
cmpl $0x2d, %eax
jne 0xd61e
cmpl $0x2b, %eax
sete 0xb(%rsp)
jmp 0xd626
movb $0x1, 0xb(%rsp)
movq %rcx, %rbx
movq %r14, 0x10(%rsp)
xorl %r12d, %r12d
movsbq (%rbx), %r13
testq %r13, %r13
je 0xd66b
movsbl %r13b, %edi
callq 0xd80e
testl %eax, %eax
je 0xd652
imulq $0xa, %r12, %rax
leaq (%rax,%r13), %r12
addq $-0x30, %r12
jmp 0xd666
testb $0x1, %bpl
je 0xd6f6
cmpb $0x2c, %r13b
jne 0xd6f6
incq %rbx
jmp 0xd62e
xorl %r14d, %r14d
movq 0x10(%rsp), %r13
xorl %ebp, %ebp
subl %ebp, %r14d
movl %r14d, %eax
testl %eax, %eax
jle 0xd687
imulq $0xa, %r12, %r12
decl %eax
jmp 0xd67b
movl %r14d, %ecx
sarl $0x1f, %ecx
andl %r14d, %ecx
xorl %esi, %esi
pushq $0xa
popq %rdi
testl %ecx, %ecx
je 0xd6aa
movq %r12, %rax
cqto
idivq %rdi
addl %edx, %esi
incl %ecx
movq %rax, %r12
jmp 0xd695
testl %esi, %esi
jle 0xd6bb
cmpl $0x3, 0x45ddb(%rip)     # 0x53490
jge 0xd7af
testq %r13, %r13
je 0xd6c6
movq %rbx, (%r13)
jmp 0xd6d8
cmpb $0x0, (%rbx)
je 0xd6d8
cmpl $0x2, 0x45dbe(%rip)     # 0x53490
jge 0xd7dd
movq %r12, %rax
negq %rax
cmpb $0x0, 0xb(%rsp)
cmovneq %r12, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
cmpb $0x2e, %r13b
jne 0xd72b
incq %rbx
xorl %ebp, %ebp
movb (%rbx), %r13b
movsbl %r13b, %edi
callq 0xd80e
testl %eax, %eax
je 0xd72d
movsbq %r13b, %rax
incl %ebp
imulq $0xa, %r12, %rcx
leaq (%rcx,%rax), %r12
addq $-0x30, %r12
incq %rbx
jmp 0xd704
xorl %ebp, %ebp
movzbl %r13b, %eax
orl $0x20, %eax
cmpl $0x65, %eax
jne 0xd75b
movzbl 0x1(%rbx), %eax
cmpl $0x2d, %eax
movq %rbp, 0x20(%rsp)
je 0xd74c
cmpl $0x2b, %eax
jne 0xd765
addq $0x2, %rbx
cmpb $0x2d, %al
sete %al
movl %eax, 0xc(%rsp)
jmp 0xd770
movq 0x10(%rsp), %r13
jmp 0xd675
incq %rbx
movl $0x0, 0xc(%rsp)
xorl %ebp, %ebp
movsbl (%rbx), %r13d
movl %r13d, %edi
callq 0xd80e
testl %eax, %eax
je 0xd791
incq %rbx
imull $0xa, %ebp, %eax
leal (%rax,%r13), %ebp
addl $-0x30, %ebp
jmp 0xd772
movl %ebp, %r14d
negl %r14d
cmpb $0x0, 0xc(%rsp)
cmovel %ebp, %r14d
movq 0x10(%rsp), %r13
movq 0x20(%rsp), %rbp
jmp 0xd675
movq 0x45832(%rip), %rax     # 0x52fe8
movq (%rax), %rdi
movl %ebx, %ecx
subl %r15d, %ecx
leaq 0x32eef(%rip), %rsi     # 0x406b4
leaq 0x32f14(%rip), %rdx     # 0x406e0
movq 0x18(%rsp), %r8
xorl %eax, %eax
callq 0x37f0
jmp 0xd6bb
movq 0x45804(%rip), %rax     # 0x52fe8
movq (%rax), %rdi
movl %ebx, %ecx
subl %r15d, %ecx
leaq 0x32eff(%rip), %rsi     # 0x406f2
leaq 0x32ee6(%rip), %rdx     # 0x406e0
movq 0x18(%rsp), %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x37f0
jmp 0xd6d8