// File: /workspace/github_cpp_makefile_star2_O2/mouda[P]LTE_random_access-simulate/ap.cpp
// Function: alglib_impl::ae_str2double(char const*, alglib_impl::ae_state*, char const**)
double ae_str2double(const char *buf, ae_state *state, const char **pasttheend)
{
    const char *emsg = "ALGLIB: unable to read double value from stream";
    ae_int_t sixbits[12];
    ae_int_t sixbitsread, i;
    union _u
    {
        double dval;
        unsigned char bytes[9];
    } u;
    
    
     /* 
      * skip leading spaces
      */
    while( *buf==' ' || *buf=='\t' || *buf=='\n' || *buf=='\r' )
        buf++;
      
    /*
     * Handle special cases
     */
    if( *buf=='.' )
    {
        const char *s_nan =    ".nan_______";
        const char *s_posinf = ".posinf____";
        const char *s_neginf = ".neginf____";
        if( strncmp(buf, s_nan, strlen(s_nan))==0 )
        {
            *pasttheend = buf+strlen(s_nan);
            return state->v_nan;
        }
        if( strncmp(buf, s_posinf, strlen(s_posinf))==0 )
        {
            *pasttheend = buf+strlen(s_posinf);
            return state->v_posinf;
        }
        if( strncmp(buf, s_neginf, strlen(s_neginf))==0 )
        {
            *pasttheend = buf+strlen(s_neginf);
            return state->v_neginf;
        }
        ae_break(state, ERR_ASSERTION_FAILED, emsg);
    }
    
    /* 
     * General case:
     * 1. read and decode six-bit digits
     * 2. check that all 11 digits were read
     * 3. set last 12th digit to zero (needed for simplicity of conversion)
     * 4. convert to 8 bytes
     * 5. convert to big endian representation, if needed
     */
    sixbitsread = 0;
    while( *buf!=' ' && *buf!='\t' && *buf!='\n' && *buf!='\r' && *buf!=0 )
    {
        ae_int_t d;
        d = ae_char2sixbits(*buf);
        if( d<0 || sixbitsread>=AE_SER_ENTRY_LENGTH )
            ae_break(state, ERR_ASSERTION_FAILED, emsg);
        sixbits[sixbitsread] = d;
        sixbitsread++;
        buf++;
    }
    *pasttheend = buf;
    if( sixbitsread!=AE_SER_ENTRY_LENGTH )
        ae_break(state, ERR_ASSERTION_FAILED, emsg);
    sixbits[AE_SER_ENTRY_LENGTH] = 0;
    ae_foursixbits2threebytes(sixbits+0, u.bytes+0);
    ae_foursixbits2threebytes(sixbits+4, u.bytes+3);
    ae_foursixbits2threebytes(sixbits+8, u.bytes+6);
    if( state->endianness==AE_BIG_ENDIAN )
    {
        for(i=0; i<sizeof(double)/2; i++)
        {
            unsigned char tc;
            tc = u.bytes[i];
            u.bytes[i] = u.bytes[sizeof(double)-1-i];
            u.bytes[sizeof(double)-1-i] = tc;
        }
    }
    return u.dval;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movabsq $0x100002600, %rax      # imm = 0x100002600
movzbl (%r15), %edx
cmpq $0x2e, %rdx
ja 0x2539f
btq %rdx, %rax
jae 0x25344
incq %r15
jmp 0x2532f
cmpq $0x2e, %rdx
jne 0x2539f
leaq 0xe5b5(%rip), %rsi      # 0x33906
pushq $0xb
popq %rdx
movq %r15, %rdi
callq 0x3110
testl %eax, %eax
je 0x254bd
leaq 0xe5a7(%rip), %rsi      # 0x33912
pushq $0xb
popq %rdx
movq %r15, %rdi
callq 0x3110
testl %eax, %eax
je 0x254c1
leaq 0xe599(%rip), %rsi      # 0x3391e
pushq $0xb
popq %rdx
movq %r15, %rdi
callq 0x3110
testl %eax, %eax
jne 0x254dc
pushq $0x18
jmp 0x254c3
xorl %eax, %eax
leaq 0xdee8(%rip), %rcx      # 0x33290
movabsq $0x100002601, %rsi      # imm = 0x100002601
movzbl %dl, %edi
cmpb $0x20, %dil
ja 0x253c1
btq %rdi, %rsi
jb 0x253f0
cmpb $0x7e, %dl
ja 0x254dc
movq (%rcx,%rdi,8), %rdx
testq %rdx, %rdx
js 0x254dc
cmpq $0xb, %rax
jae 0x254dc
movq %rdx, 0x10(%rsp,%rax,8)
movb 0x1(%r15,%rax), %dl
incq %rax
jmp 0x253b2
addq %rax, %r15
movq %r15, (%r14)
cmpq $0xb, %rax
jne 0x254dc
movl 0x18(%rsp), %eax
movl 0x20(%rsp), %ecx
movl %eax, %edx
shll $0x6, %edx
orl 0x10(%rsp), %edx
movb %dl, (%rsp)
shrl $0x2, %eax
movl %ecx, %edx
shll $0x4, %edx
orl %eax, %edx
movb %dl, 0x1(%rsp)
shrl $0x4, %ecx
movl 0x28(%rsp), %eax
shll $0x2, %eax
orl %ecx, %eax
movb %al, 0x2(%rsp)
movl 0x38(%rsp), %eax
movl %eax, %ecx
shll $0x6, %ecx
orl 0x30(%rsp), %ecx
movb %cl, 0x3(%rsp)
shrl $0x2, %eax
movl 0x40(%rsp), %ecx
movl %ecx, %edx
shll $0x4, %edx
orl %eax, %edx
movb %dl, 0x4(%rsp)
shrl $0x4, %ecx
movl 0x48(%rsp), %eax
shll $0x2, %eax
orl %ecx, %eax
movl 0x58(%rsp), %ecx
movl %ecx, %edx
shll $0x6, %edx
orl 0x50(%rsp), %edx
movb %al, 0x5(%rsp)
movb %dl, 0x6(%rsp)
shrl $0x2, %ecx
movl 0x60(%rsp), %eax
movl %eax, %edx
shll $0x4, %edx
orl %ecx, %edx
movb %dl, 0x7(%rsp)
shrl $0x4, %eax
movb %al, 0x8(%rsp)
cmpq $0x2, (%rbx)
jne 0x254b8
pushq $0x7
popq %rax
movq %rsp, %rbx
movq %rbx, %rcx
cmpq $0x3, %rax
je 0x254ce
movb (%rcx), %dl
movb (%rsp,%rax), %sil
movb %sil, (%rcx)
movb %dl, (%rsp,%rax)
decq %rax
incq %rcx
jmp 0x2549e
movq %rsp, %rbx
jmp 0x254ce
pushq $0x8
jmp 0x254c3
pushq $0x10
popq %rax
addq $0xb, %r15
movq %r15, (%r14)
addq %rax, %rbx
movsd (%rbx), %xmm0
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xe447(%rip), %rdx      # 0x3392a
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x235f7