// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
callq 0x4510
movq (%rax), %rdx
movl $0x2, %eax
subq %r15, %rax
movq %r15, %r9
movq %r9, %rsi
movzbl (%r9), %ecx
incq %r9
decq %rax
testb $0x20, 0x1(%rdx,%rcx,2)
jne 0x42891
leal -0x2b(%rcx), %edi
xorl %edx, %edx
testb $-0x3, %dil
sete %dl
movzbl (%rsi,%rdx), %edi
leal -0x31(%rdi), %r8d
cmpl $0x9, %r8d
jae 0x429b9
addq %rdx, %r9
xorl %esi, %esi
cmpb $0x30, -0x1(%r9,%rsi)
leaq 0x1(%rsi), %rsi
je 0x428c8
xorl %r8d, %r8d
xorl %edi, %edi
leaq (%r9,%r8), %r10
movzbl -0x2(%rsi,%r10), %r10d
leal -0x30(%r10), %r11d
cmpb $0x9, %r11b
ja 0x42914
leaq (%rdi,%rdi,4), %rdi
leaq (%r10,%rdi,2), %rdi
addq $-0x30, %rdi
incq %r8
cmpl $0xe, %r8d
jne 0x428d9
addq %rsi, %r9
addq %r8, %r9
addq $-0x2, %r9
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
jmp 0x4292d
addq %rsi, %r9
cmpl $0x2e, %r10d
jne 0x42932
addq %r8, %r9
decq %r9
cmpl $0xd, %r8d
jne 0x429f2
movb $0x1, %r10b
jmp 0x42942
xorl %r10d, %r10d
addq %r8, %r9
addq $-0x2, %r9
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl %eax, %r11d
subl %edx, %r11d
addl %r9d, %r11d
subl %esi, %r11d
testl %r8d, %r8d
cmovnsl %r8d, %r11d
testb %r10b, %r10b
jne 0x429cf
movzbl (%r9), %r8d
orl $0x20, %r8d
cmpl $0x65, %r8d
je 0x429cf
movslq %r11d, %r8
movq %r9, %r10
subq %r8, %r10
subq %rdx, %rax
addq %r10, %rax
subq %rsi, %rax
movq %rdi, %xmm1
punpckldq 0x67a39(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x67a41(%rip), %xmm1    # 0xaa3d0
movq %r9, (%rbx)
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
leaq 0x6b94b(%rip), %rdx     # 0xae2f0
divsd (%rdx,%rax,8), %xmm0
cmpb $0x2d, %cl
jne 0x429e6
xorpd 0x69039(%rip), %xmm0    # 0xab9f0
jmp 0x429e6
cmpl $0x30, %edi
jne 0x429cf
movzbl 0x1(%rsi,%rdx), %esi
orl $0x20, %esi
cmpl $0x78, %esi
jne 0x428c3
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4340
cmpq %r15, (%rbx)
jne 0x429e6
movl $0x1, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq -0xd(%r8), %r11
movzbl (%r9), %r12d
leal -0x30(%r12), %r10d
cmpb $0xa, %r10b
setb %r10b
jae 0x42942
leaq (%rdi,%rdi,4), %rdi
leaq (%r12,%rdi,2), %rdi
addq $-0x30, %rdi
incq %r9
incl %r11d
jne 0x429f6
jmp 0x42942