// File: /workspace/github_c_makefile_star2_O2/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, %r14
movq %rdi, %rbx
callq 0x6790
movq (%rax), %rax
leal -0x1(%rbx), %r13d
movsbq (%rbx), %rcx
incq %rbx
incl %r13d
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x49eab
movzbl %cl, %ecx
leaq -0x1(%rbx), %r8
cmpl $0x2b, %ecx
je 0x49ecd
cmpl $0x2d, %ecx
jne 0x49ed6
cmpl $0x2b, %ecx
sete %r15b
jmp 0x49edc
movb $0x1, %r15b
movq %r8, %rbx
xorl %ecx, %ecx
xorl %r12d, %r12d
movsbq (%rbx), %rsi
testq %rsi, %rsi
je 0x49f10
testb $0x8, 0x1(%rax,%rsi,2)
jne 0x49eff
testb $0x1, %bpl
je 0x49f17
cmpb $0x2c, %sil
je 0x49f0b
jmp 0x49f17
imulq $0xa, %r12, %rdx
leaq (%rdx,%rsi), %r12
addq $-0x30, %r12
incq %rbx
jmp 0x49ee1
xorl %edx, %edx
jmp 0x49f97
xorl %edx, %edx
cmpb $0x2e, %sil
jne 0x49f45
incq %rbx
xorl %ecx, %ecx
movb (%rbx), %sil
movsbq %sil, %rdi
testb $0x8, 0x1(%rax,%rdi,2)
je 0x49f47
incl %ecx
imulq $0xa, %r12, %rsi
leaq (%rsi,%rdi), %r12
addq $-0x30, %r12
incq %rbx
jmp 0x49f24
xorl %ecx, %ecx
movzbl %sil, %esi
orl $0x20, %esi
cmpl $0x65, %esi
jne 0x49f97
movzbl 0x1(%rbx), %edx
cmpl $0x2d, %edx
je 0x49f61
cmpl $0x2b, %edx
jne 0x49f6e
addq $0x2, %rbx
cmpb $0x2d, %dl
sete %sil
jmp 0x49f73
incq %rbx
xorl %esi, %esi
xorl %edi, %edi
movsbq (%rbx), %rdx
testb $0x8, 0x1(%rax,%rdx,2)
je 0x49f8d
incq %rbx
imull $0xa, %edi, %edi
addl %edx, %edi
addl $-0x30, %edi
jmp 0x49f75
movl %edi, %edx
negl %edx
testb %sil, %sil
cmovel %edi, %edx
subl %ecx, %edx
movl %edx, %eax
testl %eax, %eax
jle 0x49fa7
imulq $0xa, %r12, %r12
decl %eax
jmp 0x49f9b
movl %edx, %ecx
sarl $0x1f, %ecx
andl %edx, %ecx
xorl %esi, %esi
pushq $0xa
popq %rdi
testl %ecx, %ecx
je 0x49fc8
movq %r12, %rax
cqto
idivq %rdi
addl %edx, %esi
incl %ecx
movq %rax, %r12
jmp 0x49fb3
testl %esi, %esi
jle 0x49fd5
cmpl $0x3, 0x6ae15(%rip)     # 0xb4de8
jge 0x4a009
testq %r14, %r14
je 0x49fdf
movq %rbx, (%r14)
jmp 0x49fed
cmpb $0x0, (%rbx)
je 0x49fed
cmpl $0x2, 0x6adfd(%rip)     # 0xb4de8
jge 0x4a035
movq %r12, %rax
negq %rax
testb %r15b, %r15b
cmovneq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x68fc8(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
movl %ebx, %ecx
subl %r13d, %ecx
leaq 0x3d6c0(%rip), %rsi     # 0x876df
leaq 0x3d6e5(%rip), %rdx     # 0x8770b
movq %r8, %rbp
xorl %eax, %eax
callq 0x6a90
movq %rbp, %r8
jmp 0x49fd5
movq 0x68f9c(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
movl %ebx, %ecx
subl %r13d, %ecx
leaq 0x3d6d2(%rip), %rsi     # 0x8771d
leaq 0x3d6b9(%rip), %rdx     # 0x8770b
movq %rbx, %r9
xorl %eax, %eax
callq 0x6a90
jmp 0x49fed