// File: /workspace/github_cpp_makefile_star2_O2/DCTewi[P]Truthtable-Calculator/functions.cpp
// Function: getResultOf(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::map<char, int, std::less<char>, std::allocator<std::pair<char const, int>>>&)
bool getResultOf(const std::string &expr, std::map<char, int> &valueof)
{
    // Cache
    std::stack<bool> s;
    for (int i = 0; i < static_cast<int>(expr.size()); i++)
    {
        const char &now = expr[i];
        // Variables
        if (isalpha(now))
        {
            s.push(valueof[now]);
        }
        // Operators
        else if (now == '!')
        {
            if (s.size() < 1)
            {
                throw std::overflow_error("Illegal Expression!");
            }
            bool top = s.top(); s.pop();
            s.push(!top);
        }
        else if (now == '&' || now == '*')
        {
            if (s.size() < 2)
            {
                throw std::overflow_error("Illegal Expression!");
            }
            bool a = s.top(); s.pop();
            bool b = s.top(); s.pop();
            s.push(a && b);
        }
        else if (now == '|' || now == '+')
        {
            if (s.size() < 2)
            {
                throw std::overflow_error("Illegal Expression!");
            }
            bool a = s.top(); s.pop();
            bool b = s.top(); s.pop();
            s.push(a || b);
        }
        else if (now == '-')
        {
            if (s.size() < 2)
            {
                throw std::overflow_error("Illegal Expression!");
            }
            bool a = s.top(); s.pop();
            bool b = s.top(); s.pop();
            s.push((!a) || b);
        }
        else if (now == '=')
        {
            if (s.size() < 2)
            {
                throw std::overflow_error("Illegal Expression!");
            }
            bool a = s.top(); s.pop();
            bool b = s.top(); s.pop();
            s.push(a == b);
        }
    }
    if (s.size() == 1)
    {
        return s.top();
    }
    else
    {
        throw std::overflow_error("Illegal Expression!");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x37d0
xorl %r12d, %r12d
movslq 0x8(%r14), %rax
cmpq %rax, %r12
jge 0x2dbd
movq (%r14), %r13
movsbl (%r13,%r12), %ebp
movl %ebp, %edi
callq 0x21f0
testl %eax, %eax
je 0x2b1f
addq %r12, %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x37ec
cmpl $0x0, (%rax)
setne 0x7(%rsp)
movq %r15, %rdi
leaq 0x7(%rsp), %rsi
callq 0x4648
incq %r12
jmp 0x2ad6
movzbl %bpl, %eax
leal -0x26(%rax), %ecx
cmpl $0x7, %ecx
ja 0x2bc7
leaq 0x24ce(%rip), %rdx      # 0x5004
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movq %r15, %rdi
callq 0x4708
cmpq $0x1, %rax
jbe 0x2e09
movq 0x38(%rsp), %rax
cmpq 0x40(%rsp), %rax
jne 0x2b6e
movq 0x50(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movb -0x1(%rax), %bpl
movq %r15, %rdi
callq 0x4894
movq 0x38(%rsp), %rax
cmpq 0x40(%rsp), %rax
jne 0x2b97
movq 0x50(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movzbl -0x1(%rax), %r13d
movq %r15, %rdi
callq 0x4894
testb %bpl, %bpl
movl $0x0, %eax
cmovel %eax, %r13d
movb %r13b, 0x7(%rsp)
movq %r15, %rdi
leaq 0x7(%rsp), %rsi
callq 0x4648
jmp 0x2b1a
cmpl $0x7c, %eax
je 0x2c33
cmpl $0x3d, %eax
je 0x2d3f
cmpl $0x21, %eax
jne 0x2b1a
movq %r15, %rdi
callq 0x4708
testq %rax, %rax
je 0x2e5d
movq 0x38(%rsp), %rax
cmpq 0x40(%rsp), %rax
jne 0x2c0c
movq 0x50(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movb -0x1(%rax), %bpl
movq %r15, %rdi
callq 0x4894
xorb $0x1, %bpl
movb %bpl, 0x7(%rsp)
movq %r15, %rdi
leaq 0x7(%rsp), %rsi
callq 0x4648
jmp 0x2b1a
movq %r15, %rdi
callq 0x4708
cmpq $0x1, %rax
jbe 0x2e25
movq 0x38(%rsp), %rax
cmpq 0x40(%rsp), %rax
jne 0x2c62
movq 0x50(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movb -0x1(%rax), %bpl
movq %r15, %rdi
callq 0x4894
movq 0x38(%rsp), %rax
cmpq 0x40(%rsp), %rax
jne 0x2c8b
movq 0x50(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movzbl -0x1(%rax), %r13d
movq %r15, %rdi
callq 0x4894
testb %bpl, %bpl
pushq $0x1
popq %rax
cmovnel %eax, %r13d
movb %r13b, 0x7(%rsp)
movq %r15, %rdi
leaq 0x7(%rsp), %rsi
callq 0x4648
jmp 0x2b1a
movq %r15, %rdi
callq 0x4708
cmpq $0x1, %rax
jbe 0x2e41
movq 0x38(%rsp), %rax
cmpq 0x40(%rsp), %rax
jne 0x2ce8
movq 0x50(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movb -0x1(%rax), %bpl
movq %r15, %rdi
callq 0x4894
movq 0x38(%rsp), %rax
cmpq 0x40(%rsp), %rax
jne 0x2d11
movq 0x50(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movzbl -0x1(%rax), %r13d
movq %r15, %rdi
callq 0x4894
testb %bpl, %bpl
pushq $0x1
popq %rax
cmovel %eax, %r13d
movb %r13b, 0x7(%rsp)
movq %r15, %rdi
leaq 0x7(%rsp), %rsi
callq 0x4648
jmp 0x2b1a
movq %r15, %rdi
callq 0x4708
cmpq $0x1, %rax
jbe 0x2e79
movq 0x38(%rsp), %rax
cmpq 0x40(%rsp), %rax
jne 0x2d6e
movq 0x50(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movb -0x1(%rax), %bpl
movq %r15, %rdi
callq 0x4894
movq 0x38(%rsp), %rax
cmpq 0x40(%rsp), %rax
jne 0x2d97
movq 0x50(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movb -0x1(%rax), %r13b
movq %r15, %rdi
callq 0x4894
cmpb %r13b, %bpl
sete 0x7(%rsp)
movq %r15, %rdi
leaq 0x7(%rsp), %rsi
callq 0x4648
jmp 0x2b1a
leaq 0x8(%rsp), %rdi
callq 0x4708
cmpq $0x1, %rax
jne 0x2ea9
movq 0x38(%rsp), %rax
cmpq 0x40(%rsp), %rax
jne 0x2deb
movq 0x50(%rsp), %rcx
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rcx), %rax
movb -0x1(%rax), %bl
leaq 0x8(%rsp), %rdi
callq 0x3a4a
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x2217(%rip), %rsi      # 0x5032
movq %rax, %rdi
callq 0x2040
jmp 0x2e93
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x21fb(%rip), %rsi      # 0x5032
movq %rax, %rdi
callq 0x2040
jmp 0x2e93
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x21df(%rip), %rsi      # 0x5032
movq %rax, %rdi
callq 0x2040
jmp 0x2e93
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x21c3(%rip), %rsi      # 0x5032
movq %rax, %rdi
callq 0x2040
jmp 0x2e93
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x21a7(%rip), %rsi      # 0x5032
movq %rax, %rdi
callq 0x2040
movq 0x511e(%rip), %rsi      # 0x7fb8
movq 0x510f(%rip), %rdx      # 0x7fb0
movq %rbx, %rdi
callq 0x2220
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x2177(%rip), %rsi      # 0x5032
movq %rax, %rdi
callq 0x2040
movq 0x50ee(%rip), %rsi      # 0x7fb8
movq 0x50df(%rip), %rdx      # 0x7fb0
movq %rbx, %rdi
callq 0x2220
jmp 0x2efe
jmp 0x2ee9
jmp 0x2ee9
jmp 0x2ee9
jmp 0x2ee9
jmp 0x2efe
jmp 0x2efe
jmp 0x2ee9
movq %rax, %r14
movq %rbx, %rdi
callq 0x20f0
jmp 0x2f01
jmp 0x2efe
jmp 0x2efe
jmp 0x2efe
jmp 0x2efe
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x3a4a
movq %r14, %rdi
callq 0x2240