// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/./textutils_internal.h
// Function: hts_str2dbl
static inline double hts_str2dbl(const char *in, char **end, int *failed) {
    uint64_t n = 0;
    int max_len = 15;
    const unsigned char *v = (const unsigned char *) in;
    const unsigned int ascii_zero = '0'; // Prevents conversion to signed
    int neg = 0, point = -1;
    double d;
    static double D[] = {1,1, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7,
                         1e8, 1e9, 1e10,1e11,1e12,1e13,1e14,1e15,
                         1e16,1e17,1e18,1e19,1e20};

    while (isspace(*v))
        v++;

    if (*v == '-') {
        neg = 1;
        v++;
    } else if (*v == '+') {
        v++;
    }

    switch(*v) {
    case '1': case '2': case '3': case '4':
    case '5': case '6': case '7': case '8': case '9':
        break;

    case '0':
        if (v[1] != 'x' && v[1] != 'X') break;
        // else fall through - hex number

    default:
        // Non numbers, like NaN, Inf
        d = strtod(in, end);
        if (*end == in)
            *failed = 1;
        return d;
    }

    while (*v == '0') ++v;

    const unsigned char *start = v;

    while (--max_len && *v>='0' && *v<='9')
        n = n*10 + *v++ - ascii_zero;
    if (max_len && *v == '.') {
        point = v - start;
        v++;
        while (--max_len && *v>='0' && *v<='9')
            n = n*10 + *v++ - ascii_zero;
    }
    if (point < 0)
        point = v - start;

    // Outside the scope of this quick and dirty parser.
    if (!max_len || *v == 'e' || *v == 'E') {
        d = strtod(in, end);
        if (*end == in)
            *failed = 1;
        return d;
    }

    *end = (char *)v;
    d = n / D[v - start - point];

    return neg ? -d : d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
callq 0x4510
movq (%rax), %rcx
xorl %edx, %edx
movzbl (%r15,%rdx), %eax
incq %rdx
testb $0x20, 0x1(%rcx,%rax,2)
jne 0x41984
leal -0x2b(%rax), %esi
xorl %ecx, %ecx
testb $-0x3, %sil
sete %cl
leaq (%r15,%rcx), %rsi
movzbl -0x1(%rdx,%rsi), %edi
leal -0x31(%rdi), %r8d
cmpl $0x9, %r8d
jae 0x41a5e
addq %rdx, %rcx
movb -0x1(%r15,%rcx), %dil
incq %rcx
cmpb $0x30, %dil
je 0x419b9
leal -0x30(%rdi), %esi
leaq (%r15,%rcx), %rdx
addq $-0x2, %rdx
cmpb $0x9, %sil
ja 0x41a0d
movl $0xd, %r8d
xorl %esi, %esi
subl $0x1, %r8d
jb 0x41a92
leaq (%rsi,%rsi,4), %rsi
movzbl %dil, %edi
leaq (%rdi,%rsi,2), %rsi
addq $-0x30, %rsi
movb 0x1(%rdx), %dil
incq %rdx
leal -0x30(%rdi), %r9d
cmpb $0x9, %r9b
jbe 0x419e0
jmp 0x41a15
xorl %esi, %esi
movl $0xd, %r8d
movq %rdx, %r10
subq %r15, %r10
subq %rcx, %r10
leaq 0x2(%r10), %r9
cmpb $0x2e, %dil
jne 0x41a86
testl %r8d, %r8d
je 0x41a92
xorl %r11d, %r11d
xorl %r12d, %r12d
movb 0x1(%rdx,%r11), %dil
leal -0x30(%rdi), %ebp
cmpb $0x9, %bpl
ja 0x41a74
movzbl %dil, %edi
leaq (%rsi,%rsi,4), %rsi
leaq (%rdi,%rsi,2), %rsi
addq $-0x30, %rsi
decq %r12
incq %r11
decl %r8d
jne 0x41a33
jmp 0x41a92
cmpl $0x30, %edi
jne 0x41a92
movzbl (%rdx,%rsi), %esi
orl $0x20, %esi
cmpl $0x78, %esi
je 0x41a92
jmp 0x419b6
subq %r12, %rdx
incq %rdx
testl %r9d, %r9d
leaq 0x3(%r10,%r11), %r8
cmovsq %r8, %r9
movzbl %dil, %edi
orl $0x20, %edi
cmpl $0x65, %edi
jne 0x41ab2
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4340
cmpq %r15, (%rbx)
jne 0x41aa9
movl $0x1, (%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movslq %r9d, %rdi
movq %rdx, %r8
subq %rdi, %r8
subq %r15, %r8
subq %rcx, %r8
movq %rsi, %xmm1
punpckldq 0x65962(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x6596a(%rip), %xmm1    # 0xa7440
movq %rdx, (%rbx)
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
leaq 0x697b4(%rip), %rcx     # 0xab2a0
divsd 0x10(%rcx,%r8,8), %xmm0
cmpb $0x2d, %al
jne 0x41aa9
xorpd 0x66f41(%rip), %xmm0    # 0xa8a40
jmp 0x41aa9