// File: /workspace/github_cpp_makefile_star2_O1/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 $0x58, %rsp
movq %rcx, %r14
movq %rdx, 0x8(%rsp)
movq %rsi, %r12
movq %rdi, %r15
movzbl (%rdi), %eax
cmpl $0x2d, %eax
je 0x2f035
movb $0x1, %bl
movq %r15, %rbp
cmpl $0x2b, %eax
jne 0x2f03e
cmpb $0x2d, %al
setne %bl
leaq 0x1(%r15), %rbp
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r13
movaps %xmm0, 0x30(%r13)
movaps %xmm0, 0x20(%r13)
movaps %xmm0, 0x10(%r13)
movaps %xmm0, (%r13)
movl $0x3, %edx
movq %r13, %rdi
movq %rbp, %rsi
callq 0x3150
leaq 0x8a1b(%rip), %rsi      # 0x37a8c
movq %r13, %rdi
callq 0x2ef6e
testq %rax, %rax
je 0x2f0f6
leaq 0x8a0b(%rip), %rsi      # 0x37a90
leaq 0x10(%rsp), %rdi
callq 0x2ef6e
testq %rax, %rax
je 0x2f0f6
movsbl (%rbp), %esi
testl %esi, %esi
je 0x2f17d
leaq 0x89da(%rip), %rdi      # 0x37a81
movl $0xb, %edx
callq 0x32c0
testq %rax, %rax
je 0x2f17d
movb (%rbp), %al
movb $0x1, %bl
testb %al, %al
je 0x2f17f
leaq 0x89b3(%rip), %r13      # 0x37a81
movsbl %al, %esi
movl $0xb, %edx
movq %r13, %rdi
callq 0x32c0
testq %rax, %rax
je 0x2f17f
movb 0x1(%rbp), %al
incq %rbp
testb %al, %al
jne 0x2f0ce
jmp 0x2f17f
movsbl 0x3(%rbp), %esi
testl %esi, %esi
je 0x2f279
movq %r12, %rdi
callq 0x30f0
testq %rax, %rax
je 0x2f279
addq $0x3, %rbp
movq %rbp, (%r14)
leaq 0x896b(%rip), %rsi      # 0x37a8c
leaq 0x10(%rsp), %rdi
callq 0x2ef6e
testq %rax, %rax
jne 0x2f141
movsd 0x151a0(%rip), %xmm0    # 0x442d8
movq 0x8(%rsp), %rax
movsd %xmm0, (%rax)
leaq 0x8948(%rip), %rsi      # 0x37a90
leaq 0x10(%rsp), %rdi
callq 0x2ef6e
movq %rax, %rcx
movb $0x1, %al
testq %rcx, %rcx
jne 0x2f27b
leaq 0x15179(%rip), %rax     # 0x442e0
leaq 0x1517a(%rip), %rcx     # 0x442e8
testb %bl, %bl
cmovneq %rax, %rcx
movsd (%rcx), %xmm0
jmp 0x2f2ce
xorl %ebx, %ebx
xorl %eax, %eax
cmpb $0x2e, (%rbp)
sete %al
leaq (%rax,%rbp), %r13
movsbl (%rbp,%rax), %esi
testl %esi, %esi
je 0x2f1dc
leaq 0x88e5(%rip), %rdi      # 0x37a81
movl $0xb, %edx
callq 0x32c0
testq %rax, %rax
je 0x2f1dc
movb (%r13), %al
movb $0x1, %bl
testb %al, %al
je 0x2f1dc
leaq 0x88c5(%rip), %rbp      # 0x37a81
movsbl %al, %esi
movl $0xb, %edx
movq %rbp, %rdi
callq 0x32c0
testq %rax, %rax
je 0x2f1dc
movb 0x1(%r13), %al
incq %r13
testb %al, %al
jne 0x2f1bc
testb %bl, %bl
je 0x2f279
movzbl (%r13), %eax
orl $0x20, %eax
cmpl $0x65, %eax
jne 0x2f257
movzbl 0x1(%r13), %eax
cmpl $0x2d, %eax
je 0x2f200
cmpl $0x2b, %eax
jne 0x2f206
addq $0x2, %r13
jmp 0x2f209
incq %r13
movsbl (%r13), %esi
testl %esi, %esi
je 0x2f279
leaq 0x8868(%rip), %rdi      # 0x37a81
movl $0xb, %edx
callq 0x32c0
testq %rax, %rax
je 0x2f279
movb (%r13), %al
testb %al, %al
je 0x2f257
leaq 0x884a(%rip), %rbp      # 0x37a81
movsbl %al, %esi
movl $0xb, %edx
movq %rbp, %rdi
callq 0x32c0
testq %rax, %rax
je 0x2f257
movb 0x1(%r13), %al
incq %r13
testb %al, %al
jne 0x2f237
movsbl (%r13), %esi
testl %esi, %esi
je 0x2f279
movq %r12, %rdi
callq 0x30f0
testq %rax, %rax
je 0x2f279
movq %r13, (%r14)
subq %r15, %r13
cmpq $0x3f, %r13
jle 0x2f28a
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x3150
movb $0x0, 0x10(%rsp,%r13)
callq 0x3480
movq %rax, %r14
movq %r12, %rdi
movl $0x2e, %esi
callq 0x30f0
testq %rax, %rax
je 0x2f2c4
movq (%r14), %rcx
movb (%rcx), %cl
movb %cl, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x3310
movq 0x8(%rsp), %rax
movsd %xmm0, (%rax)
movb $0x1, %al
jmp 0x2f27b