// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/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 0x4580
movq (%rax), %rax
leal -0x1(%rbx), %r13d
movzbl (%rbx), %ecx
incq %rbx
incl %r13d
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x12d2e
leaq -0x1(%rbx), %r8
cmpl $0x2b, %ecx
je 0x12d4c
cmpl $0x2d, %ecx
jne 0x12d55
cmpl $0x2b, %ecx
sete %r15b
jmp 0x12d5b
movb $0x1, %r15b
movq %r8, %rbx
movb (%rbx), %sil
xorl %ecx, %ecx
testb %sil, %sil
je 0x12dab
incq %rbx
xorl %r12d, %r12d
movzbl %sil, %edx
testb $0x8, 0x1(%rax,%rdx,2)
jne 0x12d8b
testb $0x1, %bpl
je 0x12eac
cmpb $0x2c, %sil
je 0x12d9b
jmp 0x12eac
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 0x12d6b
decq %rbx
jmp 0x12dae
xorl %r12d, %r12d
xorl %edx, %edx
movzbl (%rbx), %esi
orl $0x20, %esi
cmpl $0x65, %esi
jne 0x12e0d
movzbl 0x1(%rbx), %ecx
cmpl $0x2d, %ecx
je 0x12dc9
cmpl $0x2b, %ecx
jne 0x12dd6
addq $0x2, %rbx
cmpb $0x2d, %cl
sete %sil
jmp 0x12ddb
incq %rbx
xorl %esi, %esi
movzbl (%rbx), %ecx
xorl %edi, %edi
testb $0x8, 0x1(%rax,%rcx,2)
je 0x12e03
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 0x12de9
movl %edi, %ecx
negl %ecx
testb %sil, %sil
cmovel %edi, %ecx
movl %ecx, %esi
subl %edx, %esi
jle 0x12e27
subl %edx, %ecx
incl %ecx
addq %r12, %r12
leaq (%r12,%r12,4), %r12
decl %ecx
cmpl $0x1, %ecx
jg 0x12e17
xorl %esi, %esi
xorl %edi, %edi
testl %esi, %esi
jns 0x12e66
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 0x12e37
testl %edi, %edi
setg %dil
testb %dil, %dil
je 0x12e74
cmpl $0x3, 0x516de(%rip)     # 0x64550
jge 0x12ef1
testq %r14, %r14
je 0x12e7e
movq %rbx, (%r14)
jmp 0x12e90
cmpb $0x0, (%rbx)
je 0x12e90
cmpl $0x2, 0x516c6(%rip)     # 0x64550
jge 0x12f20
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 0x12ee9
movzbl (%rbx), %esi
testb $0x8, 0x1(%rax,%rsi,2)
je 0x12db0
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 0x12ec4
jmp 0x12db0
decq %rbx
jmp 0x12db0
movq 0x510d0(%rip), %rax     # 0x63fc8
movq (%rax), %rdi
movl %ebx, %ecx
subl %r13d, %ecx
leaq 0x4003f(%rip), %rsi     # 0x52f46
leaq 0x40064(%rip), %rdx     # 0x52f72
xorl %eax, %eax
movq %r8, %rbp
callq 0x4770
movq %rbp, %r8
jmp 0x12e74
movq 0x510a1(%rip), %rax     # 0x63fc8
movq (%rax), %rdi
movl %ebx, %ecx
subl %r13d, %ecx
leaq 0x4004e(%rip), %rsi     # 0x52f84
leaq 0x40035(%rip), %rdx     # 0x52f72
movq %rbx, %r9
xorl %eax, %eax
callq 0x4770
jmp 0x12e90