// File: mouda[P]LTE_random_access-simulate/ap.cpp
// Function: alglib::parse_complex_delim(char const*, char const*)
alglib::complex alglib::parse_complex_delim(const char *s, const char *delim)
{
    double d_result;
    const char *new_s;
    alglib::complex c_result;
    
    // parse as real value
    if( _parse_real_delim(s, delim, &d_result, &new_s) )
        return d_result;

    // parse as "a+bi" or "a-bi"
    if( _parse_real_delim(s, "+-", &c_result.x, &new_s) )
    {
        s = new_s;
        if( !_parse_real_delim(s, "i", &c_result.y, &new_s) )
            throw alglib::ap_error("Cannot parse value");
        s = new_s+1;
        if( *s==0 || strchr(delim,*s)==NULL )
            throw alglib::ap_error("Cannot parse value");
        return c_result;
    }
    
    // parse as complex value "bi+a" or "bi-a"
    if( _parse_real_delim(s, "i", &c_result.y, &new_s) )
    {
        s = new_s+1;
        if( *s==0 )
            throw alglib::ap_error("Cannot parse value");
        if( strchr(delim,*s)!=NULL )
        {
            c_result.x = 0;
            return c_result;
        }
        if( strchr("+-",*s)!=NULL )
        {
            if( !_parse_real_delim(s, delim, &c_result.x, &new_s) )
                throw alglib::ap_error("Cannot parse value");
            return c_result;
        }
        throw alglib::ap_error("Cannot parse value");
    }

    // error
    throw alglib::ap_error("Cannot parse value");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x58(%rbp)
movq %rdi, %rax
movq %rax, -0x50(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x427a0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x20(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x4c220
testb $0x1, %al
jne 0x49496
jmp 0x494a8
movq -0x58(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x427c0
jmp 0x497d7
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rdx
leaq 0xf061(%rip), %rsi      # 0x58518
leaq -0x28(%rbp), %rcx
callq 0x4c220
testb $0x1, %al
jne 0x494c9
jmp 0x495d7
movq -0x28(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rdx
addq $0x8, %rdx
leaq 0xee05(%rip), %rsi      # 0x582e9
leaq -0x28(%rbp), %rcx
callq 0x4c220
testb $0x1, %al
jne 0x49544
movl $0x20, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x60(%rbp)
leaq 0xefe1(%rip), %rsi      # 0x584ed
callq 0x42660
jmp 0x49513
movq -0x60(%rbp), %rdi
leaq 0x1b65a(%rip), %rsi     # 0x64b78
leaq -0x2bd75(%rip), %rdx    # 0x1d7b0
callq 0x3490
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x31e0
jmp 0x497e4
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x49572
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movsbl (%rax), %esi
callq 0x30e0
cmpq $0x0, %rax
jne 0x495c5
movl $0x20, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x68(%rbp)
leaq 0xef60(%rip), %rsi      # 0x584ed
callq 0x42660
jmp 0x49594
movq -0x68(%rbp), %rdi
leaq 0x1b5d9(%rip), %rsi     # 0x64b78
leaq -0x2bdf6(%rip), %rdx    # 0x1d7b0
callq 0x3490
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x31e0
jmp 0x497e4
movq -0x58(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x42820
jmp 0x497d7
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rdx
addq $0x8, %rdx
leaq 0xecff(%rip), %rsi      # 0x582e9
leaq -0x28(%rbp), %rcx
callq 0x4c220
testb $0x1, %al
jne 0x495fc
jmp 0x4977e
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x49667
movl $0x20, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x70(%rbp)
leaq 0xeebe(%rip), %rsi      # 0x584ed
callq 0x42660
jmp 0x49636
movq -0x70(%rbp), %rdi
leaq 0x1b537(%rip), %rsi     # 0x64b78
leaq -0x2be98(%rip), %rdx    # 0x1d7b0
callq 0x3490
movq -0x70(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x31e0
jmp 0x497e4
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movsbl (%rax), %esi
callq 0x30e0
cmpq $0x0, %rax
je 0x49697
movq -0x58(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
leaq -0x38(%rbp), %rsi
callq 0x42820
jmp 0x497d7
movq -0x10(%rbp), %rax
movsbl (%rax), %esi
leaq 0xee73(%rip), %rdi      # 0x58518
callq 0x30e0
cmpq $0x0, %rax
je 0x4972e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x38(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x4c220
testb $0x1, %al
jne 0x4971c
movl $0x20, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x78(%rbp)
leaq 0xee09(%rip), %rsi      # 0x584ed
callq 0x42660
jmp 0x496eb
movq -0x78(%rbp), %rdi
leaq 0x1b482(%rip), %rsi     # 0x64b78
leaq -0x2bf4d(%rip), %rdx    # 0x1d7b0
callq 0x3490
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x31e0
jmp 0x497e4
movq -0x58(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x42820
jmp 0x497d7
movl $0x20, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x80(%rbp)
leaq 0xeda4(%rip), %rsi      # 0x584ed
callq 0x42660
jmp 0x49750
movq -0x80(%rbp), %rdi
leaq 0x1b41d(%rip), %rsi     # 0x64b78
leaq -0x2bfb2(%rip), %rdx    # 0x1d7b0
callq 0x3490
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x31e0
jmp 0x497e4
movl $0x20, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x88(%rbp)
leaq 0xed51(%rip), %rsi      # 0x584ed
callq 0x42660
jmp 0x497a3
movq -0x88(%rbp), %rdi
leaq 0x1b3c7(%rip), %rsi     # 0x64b78
leaq -0x2c008(%rip), %rdx    # 0x1d7b0
callq 0x3490
movq -0x88(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x31e0
jmp 0x497e4
movq -0x50(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x34c0
nopl (%rax)