// File: mouda[P]LTE_random_access-simulate/ap.cpp
// Function: alglib_impl::ae_str2bool(char const*, alglib_impl::ae_state*, char const**)
ae_bool ae_str2bool(const char *buf, ae_state *state, const char **pasttheend)
{
    ae_bool was0, was1;
    const char *emsg = "ALGLIB: unable to read boolean value from stream";
    
    was0 = ae_false;
    was1 = ae_false;
    while( *buf==' ' || *buf=='\t' || *buf=='\n' || *buf=='\r' )
        buf++;
    while( *buf!=' ' && *buf!='\t' && *buf!='\n' && *buf!='\r' && *buf!=0 )
    {
        if( *buf=='0' )
        {
            was0 = ae_true;
            buf++;
            continue;
        }
        if( *buf=='1' )
        {
            was1 = ae_true;
            buf++;
            continue;
        }
        ae_break(state, ERR_ASSERTION_FAILED, emsg);
    }
    *pasttheend = buf;
    if( (!was0) && (!was1) )
        ae_break(state, ERR_ASSERTION_FAILED, emsg);
    if( was0 && was1 )
        ae_break(state, ERR_ASSERTION_FAILED, emsg);
    return was1 ? ae_true : ae_false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0x1a32d(%rip), %rax     # 0x581b8
movq %rax, -0x28(%rbp)
movb $0x0, -0x19(%rbp)
movb $0x0, -0x1a(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x29(%rbp)
je 0x3deda
movq -0x8(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x9, %ecx
movb %al, -0x29(%rbp)
je 0x3deda
movq -0x8(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0xa, %ecx
movb %al, -0x29(%rbp)
je 0x3deda
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
sete %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x3dee3
jmp 0x3def1
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x3de97
jmp 0x3def3
movq -0x8(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x20, %ecx
movb %al, -0x2a(%rbp)
je 0x3df47
movq -0x8(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x9, %ecx
movb %al, -0x2a(%rbp)
je 0x3df47
movq -0x8(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0xa, %ecx
movb %al, -0x2a(%rbp)
je 0x3df47
movq -0x8(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0xd, %ecx
movb %al, -0x2a(%rbp)
je 0x3df47
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x2a(%rbp)
movb -0x2a(%rbp), %al
testb $0x1, %al
jne 0x3df50
jmp 0x3dfa6
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0x3df6e
movb $0x1, -0x19(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x3def3
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x31, %eax
jne 0x3df8f
movb $0x1, -0x1a(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x3def3
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl $0x3, %esi
callq 0x3ab10
jmp 0x3def3
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
testb $0x1, -0x19(%rbp)
jne 0x3dfcf
testb $0x1, -0x1a(%rbp)
jne 0x3dfcf
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl $0x3, %esi
callq 0x3ab10
testb $0x1, -0x19(%rbp)
je 0x3dfed
testb $0x1, -0x1a(%rbp)
je 0x3dfed
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl $0x3, %esi
callq 0x3ab10
movb -0x1a(%rbp), %al
andb $0x1, %al
negb %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)