// File: /workspace/github_cpp_makefile_star2_O3/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 0x2717e
btq %rdx, %rax
jae 0x2711a
incq %r15
jmp 0x27105
cmpq $0x2e, %rdx
jne 0x2717e
leaq 0xf84b(%rip), %rsi      # 0x36972
movl $0xb, %edx
movq %r15, %rdi
callq 0x3120
testl %eax, %eax
je 0x27296
leaq 0xf83b(%rip), %rsi      # 0x3697e
movl $0xb, %edx
movq %r15, %rdi
callq 0x3120
testl %eax, %eax
je 0x2729d
leaq 0xf82b(%rip), %rsi      # 0x3698a
movl $0xb, %edx
movq %r15, %rdi
callq 0x3120
movl $0x18, %ecx
testl %eax, %eax
je 0x272a2
jmp 0x272bd
xorl %eax, %eax
leaq 0xf159(%rip), %rcx      # 0x362e0
movabsq $0x100002601, %rsi      # imm = 0x100002601
movzbl %dl, %edi
cmpb $0x20, %dil
ja 0x271a0
btq %rdi, %rsi
jb 0x271cf
cmpb $0x7e, %dl
ja 0x272bd
movq (%rcx,%rdi,8), %rdx
testq %rdx, %rdx
js 0x272bd
cmpq $0xb, %rax
jae 0x272bd
movq %rdx, 0x10(%rsp,%rax,8)
movb 0x1(%r15,%rax), %dl
incq %rax
jmp 0x27191
addq %rax, %r15
movq %r15, (%r14)
cmpq $0xb, %rax
jne 0x272bd
movl 0x18(%rsp), %ecx
movl 0x20(%rsp), %edx
movl %ecx, %esi
shll $0x6, %esi
orl 0x10(%rsp), %esi
movq %rsp, %rax
movb %sil, (%rax)
shrl $0x2, %ecx
movl %edx, %esi
shll $0x4, %esi
orl %ecx, %esi
movb %sil, 0x1(%rax)
shrl $0x4, %edx
movl 0x28(%rsp), %ecx
shll $0x2, %ecx
orl %edx, %ecx
movb %cl, 0x2(%rax)
movl 0x38(%rsp), %ecx
movl %ecx, %edx
shll $0x6, %edx
orl 0x30(%rsp), %edx
movb %dl, 0x3(%rax)
shrl $0x2, %ecx
movl 0x40(%rsp), %edx
movl %edx, %esi
shll $0x4, %esi
orl %ecx, %esi
movb %sil, 0x4(%rax)
shrl $0x4, %edx
movl 0x48(%rsp), %ecx
shll $0x2, %ecx
orl %edx, %ecx
movl 0x58(%rsp), %edx
movl %edx, %esi
shll $0x6, %esi
orl 0x50(%rsp), %esi
movb %cl, 0x5(%rax)
movb %sil, 0x6(%rax)
shrl $0x2, %edx
movl 0x60(%rsp), %ecx
movl %ecx, %esi
shll $0x4, %esi
orl %edx, %esi
movb %sil, 0x7(%rax)
shrl $0x4, %ecx
movb %cl, 0x8(%rax)
cmpq $0x2, (%rbx)
jne 0x272af
leaq 0x7(%rsp), %rcx
xorl %edx, %edx
movb (%rsp,%rdx), %sil
movb (%rcx), %dil
movb %dil, (%rsp,%rdx)
movb %sil, (%rcx)
incq %rdx
decq %rcx
cmpq $0x4, %rdx
jne 0x2727a
jmp 0x272af
movl $0x8, %ecx
jmp 0x272a2
movl $0x10, %ecx
addq $0xb, %r15
movq %r15, (%r14)
addq %rcx, %rbx
movq %rbx, %rax
movsd (%rax), %xmm0
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xf6d2(%rip), %rdx      # 0x36996
movq %rbx, %rdi
movl $0x3, %esi
callq 0x24dff