// File: mouda[P]LTE_random_access-simulate/ap.cpp
// Function: alglib::parse_int_delim(char const*, char const*)
alglib::ae_int_t alglib::parse_int_delim(const char *s, const char *delim)
{
    const char *p;
    long long_val;
    volatile ae_int_t ae_val;
    
    p = s;

    //
    // check string structure:
    // * leading sign
    // * at least one digit
    // * delimiter
    //
    if( *s=='-' || *s=='+' )
        s++;
    if( *s==0 || strchr("1234567890",*s)==NULL)
        throw alglib::ap_error("Cannot parse value");
    while( *s!=0 && strchr("1234567890",*s)!=NULL )
        s++;
    if( *s==0 || strchr(delim,*s)==NULL )
        throw alglib::ap_error("Cannot parse value");

    // convert and ensure that value fits into ae_int_t
    s = p;
    long_val = atol(s);
    ae_val = long_val;
    if( ae_val!=long_val )
        throw alglib::ap_error("Cannot parse value");
    return ae_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x48290
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x4829c
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x482c1
movq -0x8(%rbp), %rax
movsbl (%rax), %esi
leaq 0x1024f(%rip), %rdi     # 0x58505
callq 0x30e0
cmpq $0x0, %rax
jne 0x48314
movl $0x20, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
leaq 0x10211(%rip), %rsi     # 0x584ed
callq 0x42660
jmp 0x482e3
movq -0x40(%rbp), %rdi
leaq 0x1c88a(%rip), %rsi     # 0x64b78
leaq -0x2ab45(%rip), %rdx    # 0x1d7b0
callq 0x3490
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x31e0
jmp 0x48451
jmp 0x48316
movq -0x8(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x41(%rbp)
je 0x48344
movq -0x8(%rbp), %rax
movsbl (%rax), %esi
leaq 0x101d0(%rip), %rdi     # 0x58505
callq 0x30e0
cmpq $0x0, %rax
setne %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x4834d
jmp 0x4835b
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x48316
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x4837d
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movsbl (%rax), %esi
callq 0x30e0
cmpq $0x0, %rax
jne 0x483d0
movl $0x20, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x50(%rbp)
leaq 0x10155(%rip), %rsi     # 0x584ed
callq 0x42660
jmp 0x4839f
movq -0x50(%rbp), %rdi
leaq 0x1c7ce(%rip), %rsi     # 0x64b78
leaq -0x2ac01(%rip), %rdx    # 0x1d7b0
callq 0x3490
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x31e0
jmp 0x48451
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3370
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
je 0x48447
movl $0x20, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x58(%rbp)
leaq 0x100db(%rip), %rsi     # 0x584ed
callq 0x42660
jmp 0x48419
movq -0x58(%rbp), %rdi
leaq 0x1c754(%rip), %rsi     # 0x64b78
leaq -0x2ac7b(%rip), %rdx    # 0x1d7b0
callq 0x3490
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x31e0
jmp 0x48451
movq -0x28(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x34c0
nopw (%rax,%rax)