// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
callq 0x4510
movq (%rax), %rcx
movq %r15, %rsi
movq %r15, %rdi
movzbl (%rdi), %eax
incq %rdi
incq %rsi
testb $0x20, 0x1(%rcx,%rax,2)
jne 0x31349
leal -0x2b(%rax), %edx
xorl %ecx, %ecx
testb $-0x3, %dl
sete %cl
movzbl -0x1(%rdi,%rcx), %edx
leal -0x31(%rdx), %r8d
cmpl $0x9, %r8d
jae 0x31418
leaq (%rdi,%rcx), %r8
decq %r8
addq %rcx, %rsi
addq %rcx, %rdi
movq %r8, %rdx
movq %rsi, %rcx
incq %r8
incq %rsi
incq %rdi
cmpb $0x30, (%rdx)
je 0x31384
pushq $0x1
popq %r8
xorl %esi, %esi
cmpl $0xf, %r8d
je 0x31443
movb -0x3(%rdi,%r8), %r10b
leal -0x30(%r10), %r9d
cmpb $0x9, %r9b
ja 0x313ce
movzbl %r10b, %r9d
imulq $0xa, %rsi, %rsi
addq %r9, %rsi
addq $-0x30, %rsi
incq %r8
incq %rcx
jmp 0x3139e
leaq -0x1(%r8), %r9
cmpb $0x2e, %r10b
jne 0x3140c
addq %r8, %rdi
addq $-0x2, %rdi
cmpl $0xe, %r8d
je 0x31443
movb (%rdi), %r10b
leal -0x30(%r10), %r11d
cmpb $0x9, %r11b
ja 0x3142e
movzbl %r10b, %r10d
imulq $0xa, %rsi, %rsi
addq %r10, %rsi
addq $-0x30, %rsi
incq %r8
incq %rcx
incq %rdi
jmp 0x313df
decq %rcx
addq %r8, %rdi
addq $-0x3, %rdi
jmp 0x31435
cmpl $0x30, %edx
jne 0x31443
movzbl (%rdi,%rcx), %edx
orl $0x20, %edx
cmpl $0x78, %edx
je 0x31443
jmp 0x31377
testl %r9d, %r9d
cmovsq %r8, %r9
movzbl %r10b, %r8d
orl $0x20, %r8d
cmpl $0x65, %r8d
jne 0x31460
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4340
cmpq %r15, (%rbx)
jne 0x3145a
movl $0x1, (%r14)
popq %rbx
popq %r14
popq %r15
retq
movslq %r9d, %r8
addq %rdx, %r8
subq %r8, %rcx
movq %rsi, %xmm1
punpckldq 0x50fba(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x50fc2(%rip), %xmm1    # 0x82440
movq %rdi, (%rbx)
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
leaq 0x54b5c(%rip), %rdx     # 0x85ff0
divsd (%rdx,%rcx,8), %xmm0
cmpb $0x2d, %al
jne 0x3145a
xorpd 0x525db(%rip), %xmm0    # 0x83a80
jmp 0x3145a