// File: /workspace/github_cpp_makefile_star2_O1/mouda[P]LTE_random_access-simulate/ap.cpp
// Function: alglib_impl::ae_str2int(char const*, alglib_impl::ae_state*, char const**)
ae_int_t ae_str2int(const char *buf, ae_state *state, const char **pasttheend)
{
    const char *emsg = "ALGLIB: unable to read integer value from stream";
    ae_int_t sixbits[12];
    ae_int_t sixbitsread, i;
    union _u
    {
        ae_int_t ival;
        unsigned char bytes[9];
    } u;
    /* 
     * 1. skip leading spaces
     * 2. read and decode six-bit digits
     * 3. set trailing digits to zeros
     * 4. convert to little endian 64-bit integer representation
     * 5. convert to big endian representation, if needed
     */
    while( *buf==' ' || *buf=='\t' || *buf=='\n' || *buf=='\r' )
        buf++;
    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==0 )
        ae_break(state, ERR_ASSERTION_FAILED, emsg);
    for(i=sixbitsread; i<12; i++)
        sixbits[i] = 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(ae_int_t)/2; i++)
        {
            unsigned char tc;
            tc = u.bytes[i];
            u.bytes[i] = u.bytes[sizeof(ae_int_t)-1-i];
            u.bytes[sizeof(ae_int_t)-1-i] = tc;
        }
    }
    return u.ival;
}

// Assembly:
pushq %rbx
subq $0x70, %rsp
movq %rsi, %rbx
movabsq $0x100002600, %rax      # imm = 0x100002600
movzbl (%rdi), %ecx
cmpq $0x20, %rcx
ja 0x27542
btq %rcx, %rax
jae 0x27542
incq %rdi
jmp 0x2752e
movl $0x60, %eax
xorl %ecx, %ecx
leaq 0xfbd0(%rip), %rsi      # 0x37120
movabsq $0x100002601, %r8       # imm = 0x100002601
movzbl (%rdi,%rcx), %r10d
cmpq $0x20, %r10
ja 0x2756b
btq %r10, %r8
jb 0x2759d
movq $-0x1, %r9
cmpb $0x7e, %r10b
ja 0x2757c
movq (%rsi,%r10,8), %r9
testq %r9, %r9
js 0x2768d
cmpq $0xb, %rcx
jae 0x2768d
movq %r9, 0x10(%rsp,%rcx,8)
incq %rcx
addq $-0x8, %rax
jmp 0x2755a
addq %rcx, %rdi
movq %rdi, (%rdx)
cmpq $0x60, %rax
je 0x2768d
cmpq $0xb, %rcx
ja 0x275c5
leaq (%rsp,%rcx,8), %rdi
addq $0x10, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x3170
movl 0x18(%rsp), %eax
movl %eax, %ecx
shll $0x6, %ecx
orl 0x10(%rsp), %ecx
movl 0x20(%rsp), %edx
movb %cl, (%rsp)
shrl $0x2, %eax
movl %edx, %ecx
shll $0x4, %ecx
orl %eax, %ecx
movb %cl, 0x1(%rsp)
shrl $0x4, %edx
movl 0x28(%rsp), %eax
shll $0x2, %eax
orl %edx, %eax
movl 0x38(%rsp), %ecx
movl %ecx, %edx
shll $0x6, %edx
orl 0x30(%rsp), %edx
movb %al, 0x2(%rsp)
movb %dl, 0x3(%rsp)
shrl $0x2, %ecx
movl 0x40(%rsp), %eax
movl %eax, %edx
shll $0x4, %edx
orl %ecx, %edx
movb %dl, 0x4(%rsp)
shrl $0x4, %eax
movl 0x48(%rsp), %ecx
shll $0x2, %ecx
orl %eax, %ecx
movb %cl, 0x5(%rsp)
movl 0x58(%rsp), %eax
movl %eax, %ecx
shll $0x6, %ecx
orl 0x50(%rsp), %ecx
movb %cl, 0x6(%rsp)
shrl $0x2, %eax
movl 0x60(%rsp), %ecx
movl 0x68(%rsp), %edx
movl %ecx, %esi
shll $0x4, %esi
orl %eax, %esi
movb %sil, 0x7(%rsp)
shrl $0x4, %ecx
shll $0x2, %edx
orl %ecx, %edx
movb %dl, 0x8(%rsp)
cmpq $0x2, (%rbx)
jne 0x27683
leaq 0x7(%rsp), %rax
xorl %ecx, %ecx
movb (%rsp,%rcx), %dl
movb (%rax), %sil
movb %sil, (%rsp,%rcx)
movb %dl, (%rax)
incq %rcx
decq %rax
cmpq $0x4, %rcx
jne 0x2766b
movq (%rsp), %rax
addq $0x70, %rsp
popq %rbx
retq
leaq 0x100d1(%rip), %rdx     # 0x37765
movq %rbx, %rdi
movl $0x3, %esi
callq 0x25507