// File: /workspace/github_c_makefile_star2_O1/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
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x3410
movq (%rax), %rax
leal -0x1(%rbx), %r13d
movzbl (%rbx), %ecx
incq %rbx
incl %r13d
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x10e28
leaq -0x1(%rbx), %r8
cmpl $0x2b, %ecx
je 0x10e46
cmpl $0x2d, %ecx
jne 0x10e4f
cmpl $0x2b, %ecx
sete %r15b
jmp 0x10e55
movb $0x1, %r15b
movq %r8, %rbx
movb (%rbx), %sil
xorl %ecx, %ecx
testb %sil, %sil
je 0x10ea5
incq %rbx
xorl %r12d, %r12d
movzbl %sil, %edx
testb $0x8, 0x1(%rax,%rdx,2)
jne 0x10e85
testb $0x1, %bpl
je 0x10fa6
cmpb $0x2c, %sil
je 0x10e95
jmp 0x10fa6
movsbq %sil, %rdx
leaq (%r12,%r12,4), %rsi
leaq (%rdx,%rsi,2), %r12
addq $-0x30, %r12
movb (%rbx), %sil
incq %rbx
testb %sil, %sil
jne 0x10e65
decq %rbx
jmp 0x10ea8
xorl %r12d, %r12d
xorl %edx, %edx
movzbl (%rbx), %esi
orl $0x20, %esi
cmpl $0x65, %esi
jne 0x10f07
movzbl 0x1(%rbx), %ecx
cmpl $0x2d, %ecx
je 0x10ec3
cmpl $0x2b, %ecx
jne 0x10ed0
addq $0x2, %rbx
cmpb $0x2d, %cl
sete %sil
jmp 0x10ed5
incq %rbx
xorl %esi, %esi
movzbl (%rbx), %ecx
xorl %edi, %edi
testb $0x8, 0x1(%rax,%rcx,2)
je 0x10efd
xorl %edi, %edi
movsbl %cl, %ecx
leal (%rdi,%rdi,4), %edi
leal (%rcx,%rdi,2), %edi
addl $-0x30, %edi
movzbl 0x1(%rbx), %ecx
incq %rbx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x10ee3
movl %edi, %ecx
negl %ecx
testb %sil, %sil
cmovel %edi, %ecx
movl %ecx, %esi
subl %edx, %esi
jle 0x10f21
subl %edx, %ecx
incl %ecx
addq %r12, %r12
leaq (%r12,%r12,4), %r12
decl %ecx
cmpl $0x1, %ecx
jg 0x10f11
xorl %esi, %esi
xorl %edi, %edi
testl %esi, %esi
jns 0x10f60
movabsq $0x6666666666666667, %r9 # imm = 0x6666666666666667
movq %r12, %rcx
movq %r12, %rax
imulq %r9
movq %rdx, %r12
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x2, %r12
addq %rax, %r12
leal (%r12,%r12), %eax
leal (%rax,%rax,4), %eax
subl %eax, %ecx
addl %ecx, %edi
incl %esi
jne 0x10f31
testl %edi, %edi
setg %dil
testb %dil, %dil
je 0x10f6e
cmpl $0x3, 0x4d51c(%rip)     # 0x5e488
jge 0x10feb
testq %r14, %r14
je 0x10f78
movq %rbx, (%r14)
jmp 0x10f8a
cmpb $0x0, (%rbx)
je 0x10f8a
cmpl $0x2, 0x4d504(%rip)     # 0x5e488
jge 0x1101a
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
xorl %edx, %edx
cmpb $0x2e, %sil
jne 0x10fe3
movzbl (%rbx), %esi
testb $0x8, 0x1(%rax,%rsi,2)
je 0x10eaa
xorl %edx, %edx
incl %edx
movsbq %sil, %rsi
leaq (%r12,%r12,4), %rdi
leaq (%rsi,%rdi,2), %r12
addq $-0x30, %r12
movzbl 0x1(%rbx), %esi
incq %rbx
testb $0x8, 0x1(%rax,%rsi,2)
jne 0x10fbe
jmp 0x10eaa
decq %rbx
jmp 0x10eaa
movq 0x4cff6(%rip), %rax     # 0x5dfe8
movq (%rax), %rdi
movl %ebx, %ecx
subl %r13d, %ecx
leaq 0x3d651(%rip), %rsi     # 0x4e652
leaq 0x3d676(%rip), %rdx     # 0x4e67e
xorl %eax, %eax
movq %r8, %rbp
callq 0x37e0
movq %rbp, %r8
jmp 0x10f6e
movq 0x4cfc7(%rip), %rax     # 0x5dfe8
movq (%rax), %rdi
movl %ebx, %ecx
subl %r13d, %ecx
leaq 0x3d660(%rip), %rsi     # 0x4e690
leaq 0x3d647(%rip), %rdx     # 0x4e67e
movq %rbx, %r9
xorl %eax, %eax
callq 0x37e0
jmp 0x10f8a