// File: /workspace/github_cpp_makefile_star2_O3/WayfireWM[P]wf-utils/wayfire/parser/condition_parser.cpp
// Function: wf::condition_parser_t::_factor(wf::lexer_t&)
void condition_parser_t::_factor(lexer_t &lexer)
{
    _symbol = lexer.parse_symbol();

    if (_symbol.type == symbol_t::type_t::IDENTIFIER || _symbol.type == symbol_t::type_t::SIGNAL)
    {
        // Identifier.
        auto identifier = get_string(_symbol.value);

        // Keyword.
        _symbol = lexer.parse_symbol();
        if (_symbol.type != symbol_t::type_t::KEYWORD)
        {
            throw std::runtime_error("Condition parser error. Expected keyword.");
        }
        auto keyword = get_string(_symbol.value);
        if ((keyword != "equals") && (keyword != "contains") && (keyword != "is"))
        {
            std::string error = "Condition parser error. Unsupported keyword. keyword: ";
            error.append(keyword);
            throw std::runtime_error(error);
        }

        // Value.
        _symbol = lexer.parse_symbol();
        if (_symbol.type != symbol_t::type_t::LITERAL)
        {
            throw std::runtime_error("Condition parser error. Expected literal.");
        }

        // Create condition.
        if (keyword == "equals" || keyword == "is")
        {
            _root = std::make_shared<equals_condition_t>(identifier, _symbol.value);
        }
        if (keyword == "contains")
        {
            _root = std::make_shared<contains_condition_t>(identifier, _symbol.value);
        }

        _symbol = lexer.parse_symbol();
    }
    else if ((_symbol.type == symbol_t::type_t::OPERATOR) && (get_string(_symbol.value) == "!"))
    {
        auto not_condition = std::make_shared<not_condition_t>();
        _factor(lexer);
        not_condition->child = _root;
        _root = not_condition;
    }
    else if ((_symbol.type == symbol_t::type_t::STRUCTURAL) && (get_string(_symbol.value) == "("))
    {
        _expression(lexer);
        // Expect ) and discard it
        if (_symbol.type != symbol_t::type_t::STRUCTURAL || (get_string(_symbol.value) != ")"))
        {
            throw std::runtime_error("Condition parser error. Expected \')\'");
        }
        _symbol = lexer.parse_symbol();
    }
    else {
        throw std::runtime_error("Condition parser error. Unexpected symbol.");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %r15
movq %r15, %rdi
callq 0x738e
movl (%r15), %eax
leaq 0x8(%rsp), %r12
leaq 0x18(%rbx), %r15
leaq 0x58(%rsp), %rdi
leaq 0x8d67(%rip), %rbp      # 0x12460
movl %eax, 0x10(%rbx)
movq %r15, (%rdi)
movzbl 0x20(%r12), %eax
movq %r12, %rsi
callq *(%rbp,%rax,8)
movzbl 0x28(%rsp), %eax
leaq 0x8608(%rip), %r13      # 0x11d20
leaq 0x58(%rsp), %rdi
movq %r12, %rsi
callq *(%r13,%rax,8)
movl 0x10(%rbx), %eax
cmpl $0x6, %eax
je 0x973f
cmpl $0x3, %eax
je 0x993e
cmpl $0x1, %eax
jne 0x9983
leaq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0xb34c
movq %rsp, %rdi
movq %r14, %rsi
callq 0x738e
leaq 0x8(%rsp), %r12
leaq 0x38(%rsp), %rdi
movl -0x8(%r12), %eax
movl %eax, 0x10(%rbx)
movq %r15, (%rdi)
movzbl 0x20(%r12), %eax
movq %r12, %rsi
callq *(%rbp,%rax,8)
movzbl 0x28(%rsp), %eax
leaq 0x38(%rsp), %rdi
movq %r12, %rsi
callq *(%r13,%rax,8)
cmpl $0x4, 0x10(%rbx)
jne 0x9b94
leaq 0x38(%rsp), %rdi
movq %r15, %rsi
callq 0xb34c
leaq 0x2a0f(%rip), %rsi      # 0xc1b8
leaq 0x38(%rsp), %rdi
callq 0x5080
testl %eax, %eax
je 0x97e5
leaq 0x2a01(%rip), %rsi      # 0xc1bf
leaq 0x38(%rsp), %rdi
callq 0x5080
testl %eax, %eax
je 0x97e5
leaq 0x29e2(%rip), %rsi      # 0xc1b5
leaq 0x38(%rsp), %rdi
callq 0x5080
testl %eax, %eax
jne 0x9bff
movq %rsp, %rdi
movq %r14, %rsi
callq 0x738e
leaq 0x8(%rsp), %r12
leaq 0x30(%rsp), %rdi
movl -0x8(%r12), %eax
movl %eax, 0x10(%rbx)
movq %r15, (%rdi)
movzbl 0x20(%r12), %eax
movq %r12, %rsi
callq *(%rbp,%rax,8)
movzbl 0x28(%rsp), %eax
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq *(%r13,%rax,8)
cmpl $0x2, 0x10(%rbx)
jne 0x9bcb
leaq 0x2983(%rip), %rsi      # 0xc1b8
leaq 0x38(%rsp), %rdi
callq 0x5080
testl %eax, %eax
je 0x9858
leaq 0x296b(%rip), %rsi      # 0xc1b5
leaq 0x38(%rsp), %rdi
callq 0x5080
testl %eax, %eax
jne 0x98a9
leaq 0x8(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x30(%rsp), %rdx
leaq 0x58(%rsp), %rcx
movq %rsp, %rsi
movq %r15, %r8
callq 0xa0e2
vmovaps (%rsp), %xmm0
vxorps %xmm1, %xmm1, %xmm1
vmovaps %xmm1, (%rsp)
movq 0x8(%rbx), %rdi
vmovups %xmm0, (%rbx)
testq %rdi, %rdi
je 0x98a9
callq 0x6972
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x98a9
callq 0x6972
leaq 0x290f(%rip), %rsi      # 0xc1bf
leaq 0x38(%rsp), %rdi
callq 0x5080
testl %eax, %eax
je 0x9a79
movq %rsp, %rdi
movq %r14, %rsi
callq 0x738e
leaq 0x8(%rsp), %r14
leaq 0x30(%rsp), %rdi
movl -0x8(%r14), %eax
movl %eax, 0x10(%rbx)
movq %r15, (%rdi)
movzbl 0x20(%r14), %eax
movq %r14, %rsi
callq *(%rbp,%rax,8)
movzbl 0x28(%rsp), %eax
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq *(%r13,%rax,8)
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x991a
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5230
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9a6a
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x5230
jmp 0x9a6a
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0xb34c
leaq 0x271a(%rip), %rsi      # 0xc06d
movq %r12, %rdi
callq 0x5080
movq (%r12), %rdi
movl %eax, %ebp
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x9978
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5230
testl %ebp, %ebp
je 0x9ad7
movl 0x10(%rbx), %eax
cmpl $0x5, %eax
jne 0x9b44
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0xb34c
leaq 0x34ad(%rip), %rsi      # 0xce4e
movq %r12, %rdi
callq 0x5080
movq (%r12), %rdi
leaq 0x10(%rsp), %r13
movl %eax, %ebp
cmpq %r13, %rdi
je 0x99c6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5230
testl %ebp, %ebp
jne 0x9b44
movq %rbx, %rdi
movq %r14, %rsi
callq 0x947e
cmpl $0x5, 0x10(%rbx)
jne 0x9b62
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0xb34c
leaq 0x342b(%rip), %rsi      # 0xce23
movq %r12, %rdi
callq 0x5080
movq (%r12), %rdi
movl %eax, %ebp
cmpq %r13, %rdi
je 0x9a18
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5230
testl %ebp, %ebp
jne 0x9b62
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x738e
movl (%r12), %eax
leaq 0x58(%rsp), %rdi
movl %eax, 0x10(%rbx)
leaq 0x8(%rsp), %rbx
movq %r15, (%rdi)
movzbl 0x20(%rbx), %eax
leaq 0x8a13(%rip), %rcx      # 0x12460
movq %rbx, %rsi
callq *(%rcx,%rax,8)
movzbl 0x28(%rsp), %eax
leaq 0x58(%rsp), %rdi
leaq 0x82bc(%rip), %rcx      # 0x11d20
movq %rbx, %rsi
callq *(%rcx,%rax,8)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x30(%rsp), %rdx
leaq 0x58(%rsp), %rcx
movq %rsp, %rsi
movq %r15, %r8
callq 0xa1c0
vmovaps (%rsp), %xmm0
vxorps %xmm1, %xmm1, %xmm1
vmovaps %xmm1, (%rsp)
movq 0x8(%rbx), %rdi
vmovups %xmm0, (%rbx)
testq %rdi, %rdi
je 0x98c2
callq 0x6972
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x98c2
callq 0x6972
jmp 0x98c2
leaq 0x8(%rsp), %r15
leaq 0x58(%rsp), %rdx
movq %rsp, %rsi
movq %r15, %rdi
movq $0x0, -0x8(%r15)
callq 0xa29e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x96c2
movq (%rsp), %rdi
movq (%rbx), %rax
leaq 0x8(%rbx), %r14
movq %r14, %rsi
movq %rax, 0x8(%rdi)
addq $0x10, %rdi
callq 0x9d38
movq (%rsp), %rax
movq %r14, %rdi
movq %r15, %rsi
movq %rax, (%rbx)
callq 0x9d38
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x9a6a
callq 0x6972
jmp 0x9a6a
movl $0x10, %edi
callq 0x5110
movq %rax, %r14
leaq 0x2b76(%rip), %rsi      # 0xc6ce
movq %rax, %rdi
callq 0x50d0
jmp 0x9b7e
movl $0x10, %edi
callq 0x5110
movq %rax, %r14
leaq 0x2b33(%rip), %rsi      # 0xc6a9
movq %rax, %rdi
callq 0x50d0
movq 0x946b(%rip), %rsi      # 0x12ff0
movq 0x942c(%rip), %rdx      # 0x12fb8
movq %r14, %rdi
callq 0x5370
movl $0x10, %edi
callq 0x5110
movq %rax, %r14
leaq 0x2a76(%rip), %rsi      # 0xc61e
movq %rax, %rdi
callq 0x50d0
movq 0x9439(%rip), %rsi      # 0x12ff0
movq 0x93fa(%rip), %rdx      # 0x12fb8
movq %r14, %rdi
callq 0x5370
jmp 0x9c5e
movl $0x10, %edi
callq 0x5110
movq %rax, %r14
leaq 0x2aa0(%rip), %rsi      # 0xc67f
movq %rax, %rdi
callq 0x50d0
movq 0x9402(%rip), %rsi      # 0x12ff0
movq 0x93c3(%rip), %rdx      # 0x12fb8
movq %r14, %rdi
callq 0x5370
jmp 0x9c5e
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2a39(%rip), %rsi      # 0xc648
leaq 0x2a68(%rip), %rdx      # 0xc67e
movq %rsp, %rdi
callq 0x6386
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rsi
movq %rsp, %rdi
callq 0x5090
movl $0x10, %edi
callq 0x5110
movq %rax, %r14
movq %rsp, %rsi
movq %rax, %rdi
callq 0x5350
movq 0x93a1(%rip), %rsi      # 0x12ff0
movq 0x9362(%rip), %rdx      # 0x12fb8
movq %r14, %rdi
callq 0x5370
movq %r14, %rdi
movq %rax, %rbx
callq 0x51a0
jmp 0x9c6e
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x9ce5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5230
jmp 0x9ce5
movq 0x8(%rsp), %rdi
movq %rax, %rbx
testq %rdi, %rdi
je 0x9d26
callq 0x6972
jmp 0x9d26
jmp 0x9ce2
jmp 0x9ce2
jmp 0x9ce2
movq %r14, %rdi
movq %rax, %rbx
callq 0x51a0
jmp 0x9ce5
jmp 0x9d08
movq %r14, %rdi
movq %rax, %rbx
callq 0x51a0
jmp 0x9d0b
jmp 0x9ce2
jmp 0x9d30
jmp 0x9d30
jmp 0x9ccb
movq %r14, %rdi
movq %rax, %rbx
callq 0x51a0
jmp 0x9d26
jmp 0x9d30
jmp 0x9d30
jmp 0x9ce2
jmp 0x9d30
jmp 0x9d30
movq %rax, %rbx
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9d0b
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5230
jmp 0x9d0b
jmp 0x9d08
jmp 0x9d30
jmp 0x9d30
movq %rax, %rbx
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9d26
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x5230
movq %rbx, %rdi
callq 0x5390
jmp 0x9d30
movq %rax, %rdi
callq 0x6209