// File: /workspace/github_c_makefile_star2_O3/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, %rbx
movq %rdi, %r12
callq 0x3410
movq (%rax), %rax
leal -0x1(%r12), %r13d
movb (%r12), %cl
movzbl %cl, %edx
incq %r12
incl %r13d
testb $0x20, 0x1(%rax,%rdx,2)
jne 0x11142
leaq -0x1(%r12), %r8
cmpl $0x2b, %edx
je 0x11165
cmpl $0x2d, %edx
jne 0x11172
cmpb $0x2b, %cl
sete %r14b
movb (%r12), %cl
jmp 0x11178
movb $0x1, %r14b
movq %r8, %r12
testb %cl, %cl
je 0x111c2
incq %r12
xorl %r15d, %r15d
movzbl %cl, %edx
testb $0x8, 0x1(%rax,%rdx,2)
jne 0x111a0
testb $0x1, %bpl
je 0x11265
cmpb $0x2c, %cl
je 0x111b0
jmp 0x11265
movsbq %cl, %rcx
leaq (%r15,%r15,4), %rdx
leaq (%rcx,%rdx,2), %r15
addq $-0x30, %r15
movb (%r12), %cl
incq %r12
testb %cl, %cl
jne 0x11182
decq %r12
xorl %esi, %esi
jmp 0x111c7
xorl %esi, %esi
xorl %r15d, %r15d
xorl %edx, %edx
movl %edx, %eax
subl %esi, %eax
jle 0x111e1
incl %eax
addq %r15, %r15
leaq (%r15,%r15,4), %r15
decl %eax
cmpl $0x1, %eax
ja 0x111d1
jmp 0x1122b
jns 0x1122b
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 0x111f1
testl %edi, %edi
jle 0x1122b
cmpl $0x3, 0x4e263(%rip)     # 0x5f488
jge 0x1134d
testq %rbx, %rbx
je 0x11235
movq %r12, (%rbx)
jmp 0x11249
cmpb $0x0, (%r12)
je 0x11249
cmpl $0x2, 0x4e245(%rip)     # 0x5f488
jge 0x11320
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 0x1129e
movzbl (%r12), %ecx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x112a1
xorl %esi, %esi
incl %esi
movsbq %cl, %rcx
leaq (%r15,%r15,4), %rdi
leaq (%rcx,%rdi,2), %r15
addq $-0x30, %r15
movzbl 0x1(%r12), %ecx
incq %r12
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x1127a
jmp 0x112a3
decq %r12
xorl %esi, %esi
movzbl %cl, %ecx
orl $0x20, %ecx
cmpl $0x65, %ecx
jne 0x111c9
movzbl 0x1(%r12), %edx
cmpl $0x2d, %edx
je 0x112c2
cmpl $0x2b, %edx
jne 0x112d5
leaq 0x2(%r12), %rcx
cmpb $0x2d, %dl
sete %dil
movb 0x2(%r12), %dl
jmp 0x112dd
incq %r12
xorl %edi, %edi
movq %r12, %rcx
movzbl %dl, %r9d
xorl %r10d, %r10d
testb $0x8, 0x1(%rax,%r9,2)
je 0x1130c
xorl %r10d, %r10d
movsbl %dl, %edx
leal (%r10,%r10,4), %r9d
leal (%rdx,%r9,2), %r10d
addl $-0x30, %r10d
movzbl 0x1(%rcx), %edx
incq %rcx
testb $0x8, 0x1(%rax,%rdx,2)
jne 0x112ef
movl %r10d, %edx
negl %edx
testb %dil, %dil
cmovel %r10d, %edx
movq %rcx, %r12
jmp 0x111c9
movq 0x4dcc1(%rip), %rax     # 0x5efe8
movq (%rax), %rdi
movl %r12d, %ecx
subl %r13d, %ecx
leaq 0x3d3cd(%rip), %rsi     # 0x4e704
leaq 0x3d3b4(%rip), %rdx     # 0x4e6f2
movq %r12, %r9
xorl %eax, %eax
callq 0x37e0
jmp 0x11249
movq 0x4dc94(%rip), %rax     # 0x5efe8
movq (%rax), %rdi
movl %r12d, %ecx
subl %r13d, %ecx
leaq 0x3d362(%rip), %rsi     # 0x4e6c6
leaq 0x3d387(%rip), %rdx     # 0x4e6f2
xorl %eax, %eax
movq %r8, %rbp
callq 0x37e0
movq %rbp, %r8
jmp 0x1122b