// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hts.c
// Function: hts_parse_decimal
long long hts_parse_decimal(const char *str, char **strend, int flags)
{
    unsigned long long n = 0;
    int digits = 0, decimals = 0, e = 0, lost = 0;
    char sign = '+', esign = '+';
    const char *s, *str_orig = str;

    while (isspace_c(*str)) str++;
    s = str;

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

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

    switch (*s) {
    case 'e': case 'E':
        s++;
        if (*s == '+' || *s == '-') esign = *s++;
        while (isdigit_c(*s)) e = push_digit(e, *s++);
        if (esign == '-') e = -e;
        break;

    case 'k': case 'K': e += 3; s++; break;
    case 'm': case 'M': e += 6; s++; break;
    case 'g': case 'G': e += 9; s++; break;
    }

    e -= decimals;
    while (e > 0) n *= 10, e--;
    while (e < 0) lost += n % 10, n /= 10, e++;

    if (lost > 0) {
        hts_log_warning("Discarding fractional part of %.*s", (int)(s - str), str);
    }

    if (strend) {
        // Set to the original input str pointer if not valid number syntax
        *strend = (digits > 0)? (char *)s : (char *)str_orig;
    } else if (digits == 0) {
        hts_log_warning("Invalid numeric value %.8s[truncated]", str);
    } else if (*s) {
        if ((flags & HTS_PARSE_THOUSANDS_SEP) || (!(flags & HTS_PARSE_THOUSANDS_SEP) && *s != ','))
            hts_log_warning("Ignoring unknown characters after %.*s[%s]", (int)(s - str), str, s);
    }

    return (sign == '+')? n : -n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movb $0x2b, -0x31(%rbp)
movb $0x2b, -0x32(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %edi
callq 0x23440
cmpl $0x0, %eax
je 0x230d6
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x230b7
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
je 0x230f6
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x2310a
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movb (%rax), %al
movb %al, -0x31(%rbp)
jmp 0x2310c
movq -0x40(%rbp), %rax
cmpb $0x0, (%rax)
je 0x2317b
movq -0x40(%rbp), %rax
movsbl (%rax), %edi
callq 0x23470
cmpl $0x0, %eax
je 0x23150
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movsbl (%rax), %esi
callq 0x234a0
movq %rax, -0x20(%rbp)
jmp 0x23179
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0x23175
movl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x23175
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x23177
jmp 0x2317b
jmp 0x23179
jmp 0x2310c
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x231d9
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %edi
callq 0x23470
cmpl $0x0, %eax
je 0x231d7
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movsbl (%rax), %esi
callq 0x234a0
movq %rax, -0x20(%rbp)
jmp 0x23193
jmp 0x231d9
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
addl $-0x45, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x28, %eax
ja 0x232c7
movq -0x50(%rbp), %rax
leaq 0xcc86f(%rip), %rcx     # 0xefa6c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
je 0x2322a
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x2323e
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movb (%rax), %al
movb %al, -0x32(%rbp)
jmp 0x23240
movq -0x40(%rbp), %rax
movsbl (%rax), %edi
callq 0x23470
cmpl $0x0, %eax
je 0x23271
movslq -0x2c(%rbp), %rdi
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movsbl (%rax), %esi
callq 0x234a0
movl %eax, -0x2c(%rbp)
jmp 0x23240
movsbl -0x32(%rbp), %eax
cmpl $0x2d, %eax
jne 0x23282
xorl %eax, %eax
subl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x232c7
movl -0x2c(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x2c(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x232c7
movl -0x2c(%rbp), %eax
addl $0x6, %eax
movl %eax, -0x2c(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x232c7
movl -0x2c(%rbp), %eax
addl $0x9, %eax
movl %eax, -0x2c(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movl -0x28(%rbp), %ecx
movl -0x2c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jle 0x232ec
imulq $0xa, -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x232d2
jmp 0x232ee
cmpl $0x0, -0x2c(%rbp)
jge 0x23329
movq -0x20(%rbp), %rax
movl $0xa, %ecx
xorl %edx, %edx
divq %rcx
movslq -0x30(%rbp), %rax
addq %rdx, %rax
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl $0xa, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, -0x20(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x232ee
cmpl $0x0, -0x30(%rbp)
jle 0x2335a
movq -0x40(%rbp), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x8(%rbp), %r8
movl $0x3, %edi
leaq 0xcd55f(%rip), %rsi     # 0xf08ab
leaq 0xcd56a(%rip), %rdx     # 0xf08bd
movb $0x0, %al
callq 0x1b030
cmpq $0x0, -0x10(%rbp)
je 0x23389
cmpl $0x0, -0x24(%rbp)
jle 0x23371
movq -0x40(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x23379
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2340f
cmpl $0x0, -0x24(%rbp)
jne 0x233af
movq -0x8(%rbp), %rcx
movl $0x3, %edi
leaq 0xcd50c(%rip), %rsi     # 0xf08ab
leaq 0xcd53a(%rip), %rdx     # 0xf08e0
movb $0x0, %al
callq 0x1b030
jmp 0x2340d
movq -0x40(%rbp), %rax
cmpb $0x0, (%rax)
je 0x2340b
movl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x233da
movl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x23409
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
je 0x23409
movq -0x40(%rbp), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x8(%rbp), %r8
movq -0x40(%rbp), %r9
movl $0x3, %edi
leaq 0xcd4b0(%rip), %rsi     # 0xf08ab
leaq 0xcd504(%rip), %rdx     # 0xf0906
movb $0x0, %al
callq 0x1b030
jmp 0x2340b
jmp 0x2340d
jmp 0x2340f
movsbl -0x31(%rbp), %eax
cmpl $0x2b, %eax
jne 0x23422
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x2342c
xorl %eax, %eax
subq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)