// File: /workspace/github_c_makefile_star2_O1/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 0x514e2
movzbl %cl, %ecx
leaq -0x1(%rbx), %r8
cmpl $0x2b, %ecx
je 0x51504
cmpl $0x2d, %ecx
jne 0x5150d
cmpl $0x2b, %ecx
sete %r15b
jmp 0x51513
movb $0x1, %r15b
movq %r8, %rbx
movb (%rbx), %sil
xorl %ecx, %ecx
testb %sil, %sil
je 0x5155f
incq %rbx
xorl %r12d, %r12d
movsbq %sil, %rdx
testb $0x8, 0x1(%rax,%rdx,2)
jne 0x51543
testb $0x1, %bpl
je 0x51667
cmpb $0x2c, %sil
je 0x5154f
jmp 0x51667
leaq (%r12,%r12,4), %rsi
leaq (%rdx,%rsi,2), %r12
addq $-0x30, %r12
movb (%rbx), %sil
incq %rbx
testb %sil, %sil
jne 0x51523
decq %rbx
jmp 0x51562
xorl %r12d, %r12d
xorl %edx, %edx
movzbl (%rbx), %esi
orl $0x20, %esi
cmpl $0x65, %esi
jne 0x515c8
movzbl 0x1(%rbx), %ecx
cmpl $0x2d, %ecx
je 0x5157d
cmpl $0x2b, %ecx
jne 0x5158a
addq $0x2, %rbx
cmpb $0x2d, %cl
sete %sil
jmp 0x5158f
incq %rbx
xorl %esi, %esi
movsbq (%rbx), %rcx
xorl %edi, %edi
testb $0x8, 0x1(%rax,%rcx,2)
je 0x515be
xorl %edi, %edi
movl $0xffffffd0, %r9d       # imm = 0xFFFFFFD0
leaq (%rdi,%rdi,4), %rdi
leaq (%rcx,%rdi,2), %rdi
addq %r9, %rdi
movsbq 0x1(%rbx), %rcx
incq %rbx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x515a4
movl %edi, %ecx
negl %ecx
testb %sil, %sil
cmovel %edi, %ecx
movl %ecx, %esi
subl %edx, %esi
jle 0x515e2
subl %edx, %ecx
incl %ecx
addq %r12, %r12
leaq (%r12,%r12,4), %r12
decl %ecx
cmpl $0x1, %ecx
jg 0x515d2
xorl %esi, %esi
xorl %edi, %edi
testl %esi, %esi
jns 0x51621
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 0x515f2
testl %edi, %edi
setg %dil
testb %dil, %dil
je 0x5162f
cmpl $0x3, 0x6f79b(%rip)     # 0xc0dc8
jge 0x516aa
testq %r14, %r14
je 0x51639
movq %rbx, (%r14)
jmp 0x5164b
cmpb $0x0, (%rbx)
je 0x5164b
cmpl $0x2, 0x6f783(%rip)     # 0xc0dc8
jge 0x516d9
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 0x516a2
movsbq (%rbx), %rsi
testb $0x8, 0x1(%rax,%rsi,2)
je 0x51564
xorl %edx, %edx
incl %edx
leaq (%r12,%r12,4), %rdi
leaq (%rsi,%rdi,2), %r12
addq $-0x30, %r12
movsbq 0x1(%rbx), %rsi
incq %rbx
testb $0x8, 0x1(%rax,%rsi,2)
jne 0x51680
jmp 0x51564
decq %rbx
jmp 0x51564
movq 0x6d927(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
movl %ebx, %ecx
subl %r13d, %ecx
leaq 0x46ffd(%rip), %rsi     # 0x986bd
leaq 0x47022(%rip), %rdx     # 0x986e9
xorl %eax, %eax
movq %r8, %rbp
callq 0x6a90
movq %rbp, %r8
jmp 0x5162f
movq 0x6d8f8(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
movl %ebx, %ecx
subl %r13d, %ecx
leaq 0x4700c(%rip), %rsi     # 0x986fb
leaq 0x46ff3(%rip), %rdx     # 0x986e9
movq %rbx, %r9
xorl %eax, %eax
callq 0x6a90
jmp 0x5164b