// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/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(*str)) str++;
    s = str;

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

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

    if (*s == 'E' || *s == 'e') {
        s++;
        if (*s == '+' || *s == '-') esign = *s++;
        while (isdigit(*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
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r12
callq 0x6790
movq (%rax), %rax
leal -0x1(%r12), %r13d
movsbq (%r12), %rcx
incq %r12
incl %r13d
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x517ee
movzbl %cl, %edx
leaq -0x1(%r12), %r8
cmpl $0x2b, %edx
je 0x51812
cmpl $0x2d, %edx
jne 0x5181f
cmpb $0x2b, %cl
sete %r14b
movb (%r12), %cl
jmp 0x51825
movb $0x1, %r14b
movq %r8, %r12
testb %cl, %cl
je 0x5186c
incq %r12
xorl %r15d, %r15d
movsbq %cl, %rdx
testb $0x8, 0x1(%rax,%rdx,2)
jne 0x5184e
testb $0x1, %bpl
je 0x5190f
cmpb $0x2c, %cl
je 0x5185a
jmp 0x5190f
leaq (%r15,%r15,4), %rcx
leaq (%rdx,%rcx,2), %r15
addq $-0x30, %r15
movb (%r12), %cl
incq %r12
testb %cl, %cl
jne 0x5182f
decq %r12
xorl %esi, %esi
jmp 0x51871
xorl %esi, %esi
xorl %r15d, %r15d
xorl %edx, %edx
movl %edx, %eax
subl %esi, %eax
jle 0x5188b
incl %eax
addq %r15, %r15
leaq (%r15,%r15,4), %r15
decl %eax
cmpl $0x1, %eax
ja 0x5187b
jmp 0x518d5
jns 0x518d5
subl %edx, %esi
xorl %edi, %edi
movabsq $0x6666666666666667, %r9 # imm = 0x6666666666666667
movq %r15, %rcx
movq %r15, %rax
imulq %r9
movq %rdx, %r15
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x2, %r15
addq %rax, %r15
leal (%r15,%r15), %eax
leal (%rax,%rax,4), %eax
subl %eax, %ecx
addl %ecx, %edi
decl %esi
jne 0x5189b
testl %edi, %edi
jle 0x518d5
cmpl $0x3, 0x6f4f9(%rip)     # 0xc0dc8
jge 0x519fb
testq %rbx, %rbx
je 0x518df
movq %r12, (%rbx)
jmp 0x518f3
cmpb $0x0, (%r12)
je 0x518f3
cmpl $0x2, 0x6f4db(%rip)     # 0xc0dc8
jge 0x519ce
movq %r15, %rax
negq %rax
testb %r14b, %r14b
cmovneq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edx, %edx
cmpb $0x2e, %cl
jne 0x5194a
movb (%r12), %cl
movsbq %cl, %rdi
testb $0x8, 0x1(%rax,%rdi,2)
je 0x5194d
xorl %esi, %esi
incl %esi
leaq (%r15,%r15,4), %rcx
leaq (%rdi,%rcx,2), %r15
addq $-0x30, %r15
movb 0x1(%r12), %cl
incq %r12
movsbq %cl, %rdi
testb $0x8, 0x1(%rax,%rdi,2)
jne 0x51927
jmp 0x5194f
decq %r12
xorl %esi, %esi
movzbl %cl, %ecx
orl $0x20, %ecx
cmpl $0x65, %ecx
jne 0x51873
movzbl 0x1(%r12), %edx
cmpl $0x2d, %edx
je 0x5196e
cmpl $0x2b, %edx
jne 0x51981
leaq 0x2(%r12), %rcx
cmpb $0x2d, %dl
sete %dil
movb 0x2(%r12), %dl
jmp 0x51989
incq %r12
xorl %edi, %edi
movq %r12, %rcx
movsbq %dl, %rdx
xorl %r10d, %r10d
testb $0x8, 0x1(%rax,%rdx,2)
je 0x519ba
xorl %r10d, %r10d
movl $0xffffffd0, %r9d       # imm = 0xFFFFFFD0
leaq (%r10,%r10,4), %r10
leaq (%rdx,%r10,2), %r10
addq %r9, %r10
movsbq 0x1(%rcx), %rdx
incq %rcx
testb $0x8, 0x1(%rax,%rdx,2)
jne 0x519a0
movl %r10d, %edx
negl %edx
testb %dil, %dil
cmovel %r10d, %edx
movq %rcx, %r12
jmp 0x51873
movq 0x6d603(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
movl %r12d, %ecx
subl %r13d, %ecx
leaq 0x46e0a(%rip), %rsi     # 0x987ef
leaq 0x46df1(%rip), %rdx     # 0x987dd
movq %r12, %r9
xorl %eax, %eax
callq 0x6a90
jmp 0x518f3
movq 0x6d5d6(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
movl %r12d, %ecx
subl %r13d, %ecx
leaq 0x46d9f(%rip), %rsi     # 0x987b1
leaq 0x46dc4(%rip), %rdx     # 0x987dd
xorl %eax, %eax
movq %r8, %rbp
callq 0x6a90
movq %rbp, %r8
jmp 0x518d5