// File: 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
movq %rsp, %rbp
subq $0x40, %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)
movb $0x2b, -0x2d(%rbp)
movb $0x2b, -0x2e(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %edi
callq 0x18a90
cmpl $0x0, %eax
je 0x187d7
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x187b8
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
je 0x187f7
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x1880b
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb (%rax), %al
movb %al, -0x2d(%rbp)
jmp 0x1880d
movq -0x38(%rbp), %rax
cmpb $0x0, (%rax)
je 0x18873
movq -0x38(%rbp), %rax
movsbl (%rax), %edi
callq 0x18ac0
cmpl $0x0, %eax
je 0x18848
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movsbl (%rax), %esi
callq 0x18af0
movq %rax, -0x20(%rbp)
jmp 0x18871
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0x1886d
movl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1886d
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1886f
jmp 0x18873
jmp 0x18871
jmp 0x1880d
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x188c8
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %edi
callq 0x18ac0
cmpl $0x0, %eax
je 0x188c6
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movsbl (%rax), %esi
callq 0x18af0
movq %rax, -0x20(%rbp)
jmp 0x1888b
jmp 0x188c8
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x45, %eax
je 0x188e0
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x65, %eax
jne 0x1895e
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
je 0x18904
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x18918
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb (%rax), %al
movb %al, -0x2e(%rbp)
jmp 0x1891a
movq -0x38(%rbp), %rax
movsbl (%rax), %edi
callq 0x18ac0
cmpl $0x0, %eax
je 0x1894b
movslq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movsbl (%rax), %esi
callq 0x18af0
movl %eax, -0x28(%rbp)
jmp 0x1891a
movsbl -0x2e(%rbp), %eax
cmpl $0x2d, %eax
jne 0x1895c
xorl %eax, %eax
subl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x1895e
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jle 0x18983
imulq $0xa, -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x28(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x18969
jmp 0x18985
cmpl $0x0, -0x28(%rbp)
jge 0x189c0
movq -0x20(%rbp), %rax
movl $0xa, %ecx
cqto
idivq %rcx
movslq -0x2c(%rbp), %rax
addq %rdx, %rax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movl $0xa, %ecx
cqto
idivq %rcx
movq %rax, -0x20(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x18985
cmpl $0x0, -0x2c(%rbp)
jle 0x189ff
cmpl $0x3, 0x71c13(%rip)     # 0x8a5e0
jl 0x189ff
movq 0x715fa(%rip), %rax     # 0x89fd0
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x8(%rbp), %r8
leaq 0x6270e(%rip), %rsi     # 0x7b0ff
leaq 0x62733(%rip), %rdx     # 0x7b12b
movb $0x0, %al
callq 0x4830
cmpq $0x0, -0x10(%rbp)
je 0x18a13
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x18a5e
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x18a5c
cmpl $0x2, 0x71bba(%rip)     # 0x8a5e0
jl 0x18a5c
movq 0x715a1(%rip), %rax     # 0x89fd0
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x8(%rbp), %r8
movq -0x38(%rbp), %r9
leaq 0x626ef(%rip), %rsi     # 0x7b13d
leaq 0x626d6(%rip), %rdx     # 0x7b12b
movb $0x0, %al
callq 0x4830
jmp 0x18a5e
movsbl -0x2d(%rbp), %eax
cmpl $0x2b, %eax
jne 0x18a71
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x18a7b
xorl %eax, %eax
subq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)