// File: /workspace/github_cpp_makefile_star2_O2/mouda[P]LTE_random_access-simulate/ap.cpp
// Function: alglib::_parse_real_delim(char const*, char const*, double*, char const**)
bool alglib::_parse_real_delim(const char *s, const char *delim, double *result, const char **new_s)
{
    const char *p;
    char *t;
    bool has_digits;
    char buf[64];
    int  isign;
    lconv *loc;

    p = s;
    
    //
    // check string structure and decide what to do
    //
    isign = 1;
    if( *s=='-' || *s=='+' )
    {
        isign = *s=='-' ? -1 : +1;
        s++;
    }
    memset(buf, 0, sizeof(buf));
    strncpy(buf, s, 3);
    if( my_stricmp(buf,"nan")!=0 && my_stricmp(buf,"inf")!=0 )
    {
        //
        // [sign] [ddd] [.] [ddd] [e|E[sign]ddd]
        //
        has_digits = false;
        if( *s!=0 && strchr("1234567890",*s)!=NULL )
        {
            has_digits = true;
            while( *s!=0 && strchr("1234567890",*s)!=NULL )
                s++;
        }
        if( *s=='.' )
            s++;
        if( *s!=0 && strchr("1234567890",*s)!=NULL )
        {
            has_digits = true;
            while( *s!=0 && strchr("1234567890",*s)!=NULL )
                s++;
        }
        if (!has_digits )
            return false;
        if( *s=='e' || *s=='E' )
        {
            s++;
            if( *s=='-' || *s=='+' )
                s++;
            if( *s==0 || strchr("1234567890",*s)==NULL )
                return false;
            while( *s!=0 && strchr("1234567890",*s)!=NULL )
                s++;
        }   
        if( *s==0 || strchr(delim,*s)==NULL )
            return false;
        *new_s = s;

        //
        // finite value conversion
        //
        if( *new_s-p>=(int)sizeof(buf) )
            return false;
        strncpy(buf, p, (size_t)(*new_s-p));
        buf[*new_s-p] = 0;
        loc = localeconv();
        t = strchr(buf,'.');
        if( t!=NULL )
            *t = *loc->decimal_point;
        *result = atof(buf);
        return true;
    }
    else
    {
        //
        // check delimiter and update *new_s
        //
        s += 3;
        if( *s==0 || strchr(delim,*s)==NULL )
            return false;
        *new_s = s;

        //
        // NAN, INF conversion
        //
        if( my_stricmp(buf,"nan")==0 )
            *result = fp_nan;
        if( my_stricmp(buf,"inf")==0 )
            *result = isign>0 ? fp_posinf : fp_neginf;
        return true;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, 0x8(%rsp)
movq %rdi, %r15
movzbl (%rdi), %eax
cmpl $0x2d, %eax
je 0x2b777
movb $0x1, %r14b
movq %r15, %rbp
cmpl $0x2b, %eax
jne 0x2b781
cmpb $0x2d, %al
setne %r14b
leaq 0x1(%r15), %rbp
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rbx
movaps %xmm0, 0x30(%rbx)
movaps %xmm0, 0x20(%rbx)
movaps %xmm0, 0x10(%rbx)
movaps %xmm0, (%rbx)
pushq $0x3
popq %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x3140
leaq 0x844f(%rip), %rsi      # 0x33bfc
movq %rbx, %rdi
callq 0x2b6af
testq %rax, %rax
je 0x2b83f
leaq 0x843b(%rip), %rsi      # 0x33c00
leaq 0x20(%rsp), %rdi
callq 0x2b6af
testq %rax, %rax
je 0x2b83f
movq %r13, 0x18(%rsp)
movq %r12, 0x10(%rsp)
movsbl (%rbp), %r13d
testl %r13d, %r13d
je 0x2b8cf
leaq 0x83fe(%rip), %rdi      # 0x33bf1
pushq $0xb
popq %rdx
movl %r13d, %esi
callq 0x3290
testq %rax, %rax
je 0x2b8d2
leaq 0x83e3(%rip), %rbx      # 0x33bf1
pushq $0xb
popq %r14
movb $0x1, %r12b
testb %r13b, %r13b
je 0x2b8d7
movsbl %r13b, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x3290
testq %rax, %rax
je 0x2b8da
movb 0x1(%rbp), %r13b
incq %rbp
jmp 0x2b812
movsbl 0x3(%rbp), %esi
testl %esi, %esi
je 0x2b9e1
movq 0x8(%rsp), %rdi
callq 0x30d0
testq %rax, %rax
je 0x2b9e1
addq $0x3, %rbp
movq %rbp, (%r13)
leaq 0x838f(%rip), %rsi      # 0x33bfc
leaq 0x20(%rsp), %rdi
callq 0x2b6af
testq %rax, %rax
jne 0x2b88a
movsd 0x15a44(%rip), %xmm0    # 0x412c8
movsd %xmm0, (%r12)
leaq 0x836f(%rip), %rsi      # 0x33c00
leaq 0x20(%rsp), %rdi
callq 0x2b6af
movq %rax, %rcx
movb $0x1, %al
testq %rcx, %rcx
jne 0x2b9e3
leaq 0x15a20(%rip), %rax     # 0x412d0
leaq 0x15a21(%rip), %rcx     # 0x412d8
testb %r14b, %r14b
cmovneq %rax, %rcx
movsd (%rcx), %xmm0
movsd %xmm0, (%r12)
movb $0x1, %al
jmp 0x2b9e3
xorl %r13d, %r13d
xorl %r12d, %r12d
jmp 0x2b8da
xorl %r13d, %r13d
xorl %eax, %eax
cmpb $0x2e, %r13b
sete %al
leaq (%rax,%rbp), %r13
movsbl (%rbp,%rax), %ebp
testl %ebp, %ebp
je 0x2b937
leaq 0x82fa(%rip), %rdi      # 0x33bf1
pushq $0xb
popq %rdx
movl %ebp, %esi
callq 0x3290
testq %rax, %rax
je 0x2b937
leaq 0x82e4(%rip), %rbx      # 0x33bf1
pushq $0xb
popq %r14
testb %bpl, %bpl
je 0x2b9e1
movsbl %bpl, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x3290
testq %rax, %rax
je 0x2b940
movb 0x1(%r13), %bpl
incq %r13
jmp 0x2b911
testb %r12b, %r12b
je 0x2b9e1
testb %bpl, %bpl
je 0x2b9e1
movzbl %bpl, %eax
cmpl $0x65, %eax
je 0x2b957
cmpl $0x45, %eax
jne 0x2b9bd
movzbl 0x1(%r13), %ebp
cmpl $0x2d, %ebp
je 0x2b966
cmpl $0x2b, %ebp
jne 0x2b970
movb 0x2(%r13), %bpl
addq $0x2, %r13
jmp 0x2b973
incq %r13
testb %bpl, %bpl
je 0x2b9e1
movsbl %bpl, %esi
leaq 0x826e(%rip), %rdi      # 0x33bf1
pushq $0xb
popq %rdx
callq 0x3290
testq %rax, %rax
je 0x2b9e1
leaq 0x825a(%rip), %rbx      # 0x33bf1
pushq $0xb
popq %r14
testb %bpl, %bpl
je 0x2b9e1
movsbl %bpl, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x3290
testq %rax, %rax
je 0x2b9bd
movb 0x1(%r13), %bpl
incq %r13
jmp 0x2b99b
movq 0x8(%rsp), %rdi
movsbl %bpl, %esi
callq 0x30d0
testq %rax, %rax
je 0x2b9e1
movq 0x18(%rsp), %rax
movq %r13, (%rax)
subq %r15, %r13
cmpq $0x3f, %r13
jle 0x2b9f2
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x3140
movb $0x0, 0x20(%rsp,%r13)
callq 0x3450
movq %rax, %rbx
pushq $0x2e
popq %rsi
movq %r14, %rdi
callq 0x30d0
testq %rax, %rax
je 0x2ba2a
movq (%rbx), %rcx
movb (%rcx), %cl
movb %cl, (%rax)
leaq 0x20(%rsp), %rdi
callq 0x32d0
movq 0x10(%rsp), %r12
jmp 0x2b8c2